Open zavud opened 5 months ago
I want to make a simple table (where booktabs=TRUE) in a copernicus article.
If you use booktabs = TRUE
, it will require the booktabs CTAN package that is not included in the template.
It would require to add \usepackage
call. However I am seeing now that including in headers have been deactivated in the template because it is disallowed
This is because Copernicus instruction is to not include any other packages. This is from Copernicus instruction: https://publications.copernicus.org/for_authors/manuscript_preparation.html
The most commonly used packages (\usepackage{}) are integrated in the copernicus.cls. Some other packages often used by the community are defined in template.tex. Please do not insert additional ones in your *.tex file.
@RLumSK or @nuest can confirm this is still the case.
I am seeing we also need to update 7.7 version of the template. We'll do that soon !
Table referencing does not work
Referencing works only with Table using a caption as documented: https://bookdown.org/yihui/bookdown/tables.html#tables
So this should work
See Table \@ref(tab:t)
```{r t, echo=FALSE}
df = mtcars[1:3, 1:3]
df$ref = "@Dirac1953888"
knitr::kable(df, booktabs = FALSE, caption = "My caption")
> Citation (@Dirac1953888) which is included in the sample.bib file (provided by the copernicus template) does not properly show up in the "ref" column of the table
Using Markdown citation for processing won't work unless you use a Markdown table. This because Pandoc which does the document parsing and rendering to the desired format will not parse the citation syntax inside a LaTeX content - so it won't see the citation inside column of a latex table
So you could use a markdown table, but as non included latex package can't be added, and Pandoc is using longtable for its LaTeX table, I don't think this will render.
Copernicus seems to have some constraints that leads only a limited set of R Markdown / Pandoc features can be used.
Just adding my two cents. I had a similar issue in the past and what I did was using plain LaTeX. Not super elegant but since the Copernicus template renders a PDF, it worked. Example rmarkdown code chunk:
I want to make a simple table (where
booktabs=TRUE
) in a copernicus article. When I knit the following copernicus article (using the template provided by the package) topdf_book
tlmgr update --all --self tlmgr: package repository https://mirror.easyname.at/ctan/systems/texlive/tlnet (verified) tlmgr install: package already present: hyperref ! Undefined control sequence. l.142 \toprule
Error: LaTeX failed to compile t.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See t.log for more info. Execution halted
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
Package version: base64enc_0.1.3 bslib_0.6.1 cachem_1.0.8 cli_3.6.2 digest_0.6.34 ellipsis_0.3.2
evaluate_0.23 fastmap_1.1.1 fontawesome_0.5.2 fs_1.6.3 glue_1.7.0 graphics_4.3.2
grDevices_4.3.2 highr_0.10 htmltools_0.5.7 jquerylib_0.1.4 jsonlite_1.8.8 knitr_1.45.10
lifecycle_1.0.4 magrittr_2.0.3 memoise_2.0.1 methods_4.3.2 mime_0.12 R6_2.5.1
rappdirs_0.3.3 rlang_1.1.3 rmarkdown_2.25 rticles_0.26.1 sass_0.4.8 stats_4.3.2
stringi_1.8.3 stringr_1.5.1 tinytex_0.49 tools_4.3.2 utils_4.3.2 vctrs_0.6.5
xfun_0.41 yaml_2.3.8