Building r-package results in error in Creating pdf output from LaTeX

When I'm trying to build my r-package or run devtools::document() I get below error. The problem appears to be about the building of the pdf manual using TeX and Latex.

I have tried to shorten the text in the Roxygen2 descriptions; however, these are not reflected in the error output. That is, I cannot see the new text; it seems like devtools::document() does not use the updated files. I've tried with restarting my computer.

Updating text documentation
Loading text
Converting Rd files to LaTeX ..
Creating pdf output from LaTeX ...

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(./Rd2.tex (/usr/local/texlive/2020/texmf-dist/tex/latex/base/book.cls

Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  Running 'texi2dvi' on '/Users/john/Desktop/r-package/kokoo' failed.

Before the error I also get a lot of issues, such as:

Overfull \hbox (18.76248pt too wide) in paragraph at lines 1170--1170
 []\T1/zi4/m/n/9 example_1 <- myTestFunction(data_x, data_y parameter = 2)[] 
Overfull \hbox (13.3567pt too wide) in paragraph at lines 6--8
[]| \T1/zi4/m/n/10 Example_data_10\T1/ptm/m/n/10 ,

Any guidance is much appreciated.

1 Like

LaTeX errors related to building the PDF manual are notoriously difficult to troubleshoot. Do you have a specific need for the PDF manual on your local machine? If not, I recommend disabling this step during your regular builds and checks as you develop your package. Unless you are trying to do something particularly complex with your function documentation, the manual should build fine on the CRAN servers (you can confirm with devtools::check_win_release() to build your package on win-builder).

You can pass the flag --no-manual to both R CMD build and R CMD check. And you configure the build tools in RStudio (Build->Configure Build Tools...) to also skip the manual.

1 Like

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

The overfull hboxes are just warnings, you can ignore them, if you can live with them, in a serious documentation, I wouldn't ignore them. Moreover, I wouldn't just skip the documentation, you just made a small mistake anywhere, latex doesn't like mistakes. Since you're in a latex unfriendly environment, you need to know what your doing. Just delete your stuff untill it works, and find your bug. :slight_smile: