Diagnosing R package build warning: "LaTeX errors when creating PDF version" Diagnosing R package build warning: "LaTeX errors when creating PDF version" r r

Diagnosing R package build warning: "LaTeX errors when creating PDF version"


Try R CMD Rd2pdf mypackage to create the manual, and possibly also set the --no-clean option to keep the temporary files. This should allow you to debug the LaTeX code triggering the error.


Though @Dirk's answer also helped me to fix the problem I would like to add a bit which might especially help recent updaters. That is, people who haven't encountered other LaTeX / R troubles after the update to 3.1.3 yet. The problem is little bit more general than just building. For me, on OS X the problem was that R CMD Rd2pdf as well as the R CMD CHECK expected texi2dvi to be in /usr/local/bin while it was in /usr/bin. A symlink helped to fix the problem. On terminal type:

# to check whether the same issue exists for youwhich texi2dvi# if socd /usr/local/binln -s /usr/bin/texi2dvi

Of course if the first line returns something else, you need to adapt the symlink here.


Concluding from the comments and from my own experience the problem often seems to be that some TeX fonts are missing, most often

  • inconsolata.sty and
  • upquote.sty

First you have to find the right directory where TeX fonts are stored - in my case this is:

C:\Program Files\R\R-3.3.0\share\texmf\tex\latex

Then you can download them here:

Just copy them to the respective folder and in many cases the problem will be solved (in my case too). This should work for all operating systems.