rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.47k stars 518 forks source link

Check formats and Pandoc 2.11 new citeproc #333

Closed cderv closed 3 years ago

cderv commented 3 years ago

Pandoc 2.11 modifies the way citation are processed, we must check it still works with the rticles template.

I know there is some changes that are missing in the templates.

For example, Pandoc has introduced a new cslreferences environment that we included in our template https://github.com/rstudio/rticles/commit/ee529ada1ee5dc144300383aa8f88364108b6679

but in Pandoc 2.11 it has now changed to CSLreferences https://github.com/jgm/pandoc/commit/e0984a43a99231e72c02a0a716c8d0315de9abdf#diff-64a9e5fa4509dce2699276c9e39993b4474e2446c3e86941a2f78a379f8c4079

So we have this error:

! LaTeX Error: Environment CSLReferences undefined.

We must find a way to support both - all the more because RStudio IDE will bundle Pandoc 2.11+ - so currently rticles is broken with this version.

cderv commented 3 years ago

So one solution is to define in the template both environment.

It seems there is no way to make some part of a Pandoc's template conditional on the Pandoc's version. However, we could make that happens by definining a variable from R to pass to template to activate or not this template part.

Anyway, in both case we would need to copy paste this code in each template. However, Pandoc has a new feature from 2.8+ called partials that could help us maintained shared part of template in all the template files. This would require to have all the tex template in the same folder to avoid having a partial per template folder. We could also create a small script to easily modify all our template with the Pandoc required part to be sure all our template have it.

Anyhow, I'll go with the simple solution for now (inserting both), and we can discuss a more complex one (conditional insertion) and/or a change in our template udpates following Pandoc changes.

cderv commented 3 years ago

Oh and we could also not support between Pandoc 2.8 and Pandoc 2.10.1 for Pandoc citation processing... but not sure that is a good idea though

cderv commented 3 years ago

Let's not that the style has changed when you render with Pandoc 2.8.1 or Pandoc 2.11.0.1 for example with ACM default template

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.