How to use preamble.tex with Rmarkdown rticles template for R Journal Submission

Hi everyone. I have a problem with the preamble.tex file used in the Rmarkdown rticles template for R Journal Submission. This is the procedure I'm following:

  1. Create a new Rmarkdown rticles template for submission to the R Journal
  2. Knit the document and everything seems to be fine
  3. Add some latex code to preamble.tex (like \usepackage{subfig} )
  4. Knit the document and it doesn't compile anymore.

If I just remove \usepackage{subfig} from preamble.tex then everything works fine. I think the problem is related to the fact that the \usepackage{...} code isn't put in the preamble of the .tex document but I don't know how to fix that.

If you want to test the procedure above, I created a git repo here with all the Rmarkdown files up to point 3. If I knit the Rmd document that I get an error.

Hope it's clear enough. I posted the same question on SO.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

This is due to a bug in the rticles package, which I just resolved on Github. If you install the Github version, it should work now:


Apologies for the trouble, and many thanks for filing the very detailed bug report!