rticles icon indicating copy to clipboard operation
rticles copied to clipboard

header-includes should be moved outside individual templates

Open slemonide opened this issue 5 years ago • 4 comments

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).

slemonide avatar Nov 06 '20 11:11 slemonide

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.

cderv avatar Nov 06 '20 11:11 cderv

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

eliocamp avatar Nov 09 '20 22:11 eliocamp

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 avatar Nov 12 '20 11:11 cderv

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

cderv avatar Dec 02 '21 15:12 cderv