LaTeX packages, Rocker basis

I am using a Rocker image for using RStudio with Binder. With that I need Latex.

Is there any good way for me to install needed Latex packages? I keep having issues.

I tried two options:

  1. Installing the package via the Dockerfile (RUN tlmgr install thumbpdf)
  2. Running tinytex::latexmk(...) in RStudio and hoping the package will install itself.

As an example, see:

Try running:

library("knitr")
library("tinytex")

## create paper
latexmk("paper.tex", engine = "pdflatex")

I hope my question is clear enough. I would appreciate any help. Thanks!

@karthik is probably the best person to ask about adding things to a Rocker image as I don’t think this is specific to using the Dockerfile with Binder.