Open egouldo opened 2 years ago
When kableExtra is loaded, it will add some LaTeX depedencies in the .tex
file
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
That is the only difference, and it seems one of them conflict with what is already in the template. The one being \usepackage{colortbl}
which conflict with jss.cls
when this is called.
See kableExtra documentation: http://haozhu233.github.io/kableExtra/awesome_table_in_pdf.pdf for a workaround:
```{r}
options(kableExtra.latex.load_packages = FALSE)
library(kableExtra)
kableExtra::kableExtra_latex_packages()
)
header-includes:
- \usepackage{booktabs}
- \usepackage{longtable}
- \usepackage{array}
- \usepackage{multirow}
- \usepackage{wrapfig}
- \usepackage{float}
- \usepackage{pdflscape}
- \usepackage{tabu}
- \usepackage{threeparttable}
- \usepackage{threeparttablex}
- \usepackage[normalem]{ulem}
- \usepackage[utf8]{inputenc}
- \usepackage{makecell}
- \usepackage{xcolor}
You'll just loose some coloring feature I guess.
cc @haozhu233 in you case you already encounter that.
And it will be the same with huxtable as it uses also colortbl
huxtable::report_latex_dependencies()
#> \usepackage{array}
#> \usepackage{caption}
#> \usepackage{graphicx}
#> \usepackage{siunitx}
#> \usepackage[normalem]{ulem}
#> \usepackage{colortbl}
#> \usepackage{multirow}
#> \usepackage{hhline}
#> \usepackage{calc}
#> \usepackage{tabularx}
#> \usepackage{threeparttable}
#> \usepackage{wrapfig}
#> \usepackage{adjustbox}
#> \usepackage{hyperref}
#> % These are LaTeX packages. You can install them using your LaTex management software,
#> % or by running `huxtable::install_latex_dependencies()` from within R.
#> % Other packages may be required if you use non-standard tabulars (e.g. tabulary).
So basically this is an issue with JSS unless we can deal with it by changing some order of loading or configuration.
My understanding is that colortbl
will do some stuff \AtBeginDocument
, and this is conflicting with the jss
class. Hence the issue in JSS format only.
Hope it helps understand
By filing an issue to this repo, I promise that
xfun::session_info('rticles')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rticles')
.I understand that my issue may be closed if I don't fulfill my promises.
Problem Description
JSS document fails to knit when the
kableExtra
library is loaded. Suspect, possibly related to #329? When working in another document with an older version ofjss.cls
I get the error reported in #329, and when replacing with newestjss.cls
provided with `rticles' I get the error in the MRE below.MRE
Stock JSS template used below, with addition of call to
kableExtra
library, and session / tlmgr info chunk.! Undefined control sequence.
...@setup \CT@row@color \CT@cell@color \CT@do@color \endgroup \@t... l.78 \begin{document} Error: LaTeX failed to compile Untitled.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Untitled.log for more info. Execution halted ``` Is there any suggested work around while awaiting a fix? I've tried using `huxtable` and get the same error, but only after creating a table, not when the `huxtable` library is called like in the MRE above. # Session Info ``` R version 4.2.0 (2022-04-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.6.5, RStudio 2022.2.3.492 Locale: en_AU.UTF-8 / en_AU.UTF-8 / en_AU.UTF-8 / C / en_AU.UTF-8 / en_AU.UTF-8 Package version: base64enc_0.1.3 bslib_0.3.1 digest_0.6.29 evaluate_0.15 fastmap_1.1.0 fs_1.5.2 glue_1.6.2 graphics_4.2.0 grDevices_4.2.0 highr_0.9 htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.8.0 knitr_1.39 magrittr_2.0.3 methods_4.2.0 R6_2.5.1 rappdirs_0.3.3 rlang_1.0.2 rmarkdown_2.14.3 rticles_0.23.6 sass_0.4.1 stats_4.2.0 stringi_1.7.6 stringr_1.4.0 tinytex_0.40 tools_4.2.0 utils_4.2.0 xfun_0.31 yaml_2.3.5 ``` TeXLive install: ``` tlmgr revision 63068 (2022-04-18 07:58:07 +0200) tlmgr using installation: /Users/egould/Library/TinyTeX TeX Live (https://tug.org/texlive) version 2022 ```