rstudio / rticles

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

header-includes should be moved outside individual templates #345

Open slemonide opened 3 years ago

slemonide commented 3 years ago

I think it would be reasonable to move this chunk of code outside individual templates:

$for(header-includes)$
$header-includes$
$endfor$

It should be possible to include additional packages for any template. Also, it is easy to miss this, as is the case for arxiv template (which has this chunk missing).

cderv commented 3 years ago

move this chunk of code outside individual templates:

What do you think of ?

These are pandoc templates and they can't inherit from each others. (at least not since recent pandoc versions). I think we need to have them separate even with common element.

We could obviously create a generator of Pandoc templates base on some intial templates to fill in with common element (to become pandoc templates to be used which each format) but this is some work.

It should be possible to include additional packages for any template. Also, it is easy to miss this, as is the case for arxiv template (which has this chunk missing).

We missed that when reviewing the Axriv template a while back now. Pleaso open a PR to add those line.

eliocamp commented 3 years ago

Perhaps part of the testing process could be that each template has that chunk of code.

cderv commented 3 years ago

That is a great idea !

I think we would need to have a documentation (maybe a vignette) explaining how to contribute a new format in rticles, including what to think about while tranforming the journal tex template to a pandoc template for the package. This would detail which pieces includes for Pandoc to work, and which other common piece are useful to have in each template.

This relates to https://github.com/rstudio/rticles/pull/346#discussion_r518728148

What do you think ?

cderv commented 2 years ago

Perhaps part of the testing process could be that each template has that chunk of code.

453 brings tests to check that this is included in all templates.

It does not for now put it in a partial, but this could be considered if we upgrade the min Pandoc requirement