haozhu233 / haozhu233/kableExtra
version 1.4.0 of kableExtra, save_kable() does not export the pdf as formatted in html
- Dominant language
- R
- Stars
- 737
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
**Description**
The output of the function `save_kable()` of package versions **1.3.4** and **1.4.0**, differs.
More specifically, the function `save_kable()` of package version **1.3.4** works as expected. It extracts the *HTML* (refer to the left image) and *PDF* (refer to the right image) in the correct format.

However, the same function of the package version **1.4.0**, does not work as expected. After installing the recommended package `webshot2` with its dependencies, the function extracts the *HTML* (refer to the left image) in the correct format, but the *PDF* (refer to the right image) is not extracted as expected.

\
\
In addition, it was noted that the exported info messages of the function `save_kable()`, differ between the two versions:
**kableExtra version: 1.3.4**

**kableExtra version: 1.4.0**

\
\
**To Reproduce**
Please try to reproduce the below code, using versions **1.3.4** and **1.4.0** of the package `kableExtra`, and inspect the pdf outputs.
```
iris_df <- iris[(48:52), ]
rownames(iris_df) <- NULL
pdf_df <- knitr::kable(iris_df, caption = "Iris Dataset", align = "ccccr") |>
kableExtra::kable_paper() |>
kableExtra::column_spec(5, bold = TRUE, border_right = TRUE, background ="#F2EFC8") |>
kableExtra::kable_styling(bootstrap_options = "basic", full_width = FALSE, position = "center", font_size = 20) |>
kableExtra::kable_classic(full_width = FALSE, html_font = "Cambria") |>
kableExtra::pack_rows(group_label = "setosa species", start_row = 1, end_row = 3, underline = TRUE) |>
kableExtra::pack_rows(group_label = "versicolor species", start_row = 4, end_row = 5, underline = TRUE) |>
kableExtra::footnote(general = "The end")
kableExtra::save_kable(pdf_df, "iris_df.pdf")
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided save_kable() reproduction with kableExtra 1.3.4 and 1.4.0, including the recommended webshot2 dependency. Compare the HTML and PDF output and the exported messages; done means version 1.4.0 produces a PDF formatted consistently with the HTML and the expected messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100