-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copernicus template update - fixes syntax highlight problem (#391)
* Update template for follow guidelines from Copernicus: no additional packages can be used from those in the cls file. This requires to deactivate Pandoc highlighting for typesetting. algorithms packages can't be loaded in template too * Adapt the skeleton and document all this. Add command to install packages in the skeleton. Co-authored-by: Christophe Dervieux <[email protected]>
- Loading branch information
Showing
6 changed files
with
68 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: rticles | ||
Type: Package | ||
Title: Article Formats for R Markdown | ||
Version: 0.19.2 | ||
Version: 0.19.3 | ||
Authors@R: c( | ||
person("JJ", "Allaire", role = "aut", email = "[email protected]"), | ||
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,6 @@ running: | |
# This section is mandatory even if you declare that no competing interests are present. | ||
competinginterests: | | ||
The authors declare no competing interests. | ||
# OPTIONAL: | ||
algorithms: true | ||
# See https://publications.copernicus.org/for_authors/licence_and_copyright.html, normally used for transferring the copyright, if needed. | ||
# Note: additional copyright statements for affiliated software or data need to be placed in the data availability section. | ||
copyrightstatement: | | ||
|
@@ -87,15 +85,17 @@ appendix: | | |
Please add `\clearpage` between each table and/or figure. Further guidelines on figures and tables can be found below. | ||
output: | ||
rticles::copernicus_article: default | ||
rticles::copernicus_article: | ||
highlight: NULL | ||
keep_tex: true | ||
bookdown::pdf_book: | ||
base_format: rticles::copernicus_article # for using bookdown features like \@ref() | ||
--- | ||
|
||
\introduction[Introduction] | ||
|
||
Introduction text goes here. | ||
You can change the name of the section if neccessary using `\introduction[modified heading]`. | ||
You can change the name of the section if necessary using `\introduction[modified heading]`. | ||
|
||
The following settings can or must be configured in the header of this file and are bespoke for Copernicus manuscripts: | ||
|
||
|
@@ -119,8 +119,23 @@ The following settings can or must be configured in the header of this file and | |
|
||
See the defaults and examples from the skeleton and the official Copernicus documentation for details. | ||
|
||
**Important**: Always double-check with the official manuscript preparation guidelines at [https://publications.copernicus.org/for_authors/manuscript_preparation.html](https://publications.copernicus.org/for_authors/manuscript_preparation.html), especially the sections "Technical instructions for LaTeX" and "Manuscript composition". | ||
Please contact Daniel Nüst, `[email protected]`, with any problems. | ||
**Please note:** Per [their | ||
guidelines](https://publications.copernicus.org/for_authors/manuscript_preparation.html), | ||
Copernicus does not support additional \LaTeX{} packages or new \LaTeX{} | ||
commands than those defined in their `.cls` file. This means that you cannot add any extra dependencies and a warning will be thrown if so. | ||
This extends to syntax highlighting of source code. Therefore this template sets | ||
the parameter `highlight` in the YAML header to `NULL` to deactivate Pandoc | ||
syntax highlighter. This prevent addition of external packages for highlighting | ||
inserted by Pandoc. However, it might be desirable to have syntax highlight | ||
available in preprints or for others reasons. Please see | ||
`?rmarkdown::pdf_document` for available options to activate highlighting. | ||
|
||
**Important**: Always double-check with the official manuscript preparation | ||
guidelines at | ||
[https://publications.copernicus.org/for_authors/manuscript_preparation.html](https://publications.copernicus.org/for_authors/manuscript_preparation.html), | ||
especially the sections "Technical instructions for LaTeX" and "Manuscript | ||
composition". Please contact Daniel Nüst, `[email protected]`, with | ||
any problems. | ||
|
||
# Content section one | ||
|
||
|
@@ -290,10 +305,15 @@ x & y & z\\ | |
\end{matrix} | ||
$$ | ||
|
||
## ALGORITHM | ||
## ALGORITHM/PROGRAMMING CODE | ||
|
||
If you want to use algorithms, you can either enable the required packages in the header (the default, see `algorithms: true`), or make sure yourself that the \LaTeX packages `algorithms` and `algorithmicx` are installed so that `algorithm.sty` respectively `algorithmic.sty` can be loaded by the Copernicus template. | ||
Copernicus staff will remove all undesirable packages from your LaTeX source code, so please stick to using the header option, which only adds the two acceptable packages. | ||
If you want to use algorithms, you need to make sure yourself that the \LaTeX packages `algorithms` and `algorithmicx` are installed so that `algorithm.sty` respectively `algorithmic.sty` can be loaded by the Copernicus template. Both need to be available through your preferred \LaTeX{} distribution. With TinyTeX (or TeX Live), you can do so by running `tinytex::tlmgr_install(c("algorithms", "algorithmicx"))` | ||
|
||
```{r, echo = FALSE, eval = tinytex::is_tinytex()} | ||
tinytex::tlmgr_install(c("algorithms", "algorithmicx")) | ||
``` | ||
|
||
Copernicus staff will no accept any additional packages from your LaTeX source code, so please stick to these two acceptable packages. They are needed to use the example below | ||
|
||
\begin{algorithm} | ||
\caption{Algorithm Caption} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.