devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Error in `value[[3L]]()`: Failed to build manual

Open mcol opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Building the pdf manual failed for me with this rather unhelpful message and backtrace:

devtools::build_manual(pkg = ".")
Error in `value[[3L]]()`:
! Failed to build manual
Run `rlang::last_trace()` to see where the error occurred.
Backtrace:
    ▆
 1. └─devtools::build_manual(...)
 2.   └─base::tryCatch(...)
 3.     └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 4.       └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 5.         └─value[[3L]](cond)

Only after looking at the code of build_manual() and figuring out the command that it was trying to run via callr (R CMD Rd2pdf --force --output=pkg.BuildResults/pkg_0.0.1.pdf /scratch/dev/pkg) I got an actionable error from pdfTeX:

! LaTeX Error: File `inconsolata.sty' not found.

Describe the solution you'd like

It would be nice if the console error would bubble up to devtools so one could debug the problem much more speedily.

mcol avatar Nov 15 '24 12:11 mcol

I ran into this issue as well. I also agree that the error is uninformative.

FWIW while devtools maintainers consider an improved error message (or not) -- a solution that allowed me to execute devtools::build_manual(pkg = ".") successfully was to install a few $\LaTeX$ packages using tinytex; a solution inspired by this Stack Overflow solution.

tinytex::tlmgr_install(c("titling", "framed", "inconsolata", "collection-fontsrecommended"))

math-mcshane avatar Feb 27 '25 08:02 math-mcshane

@math-mcshane, thank you for the comment here! It helped me solve the same problem. After using devtools::build_manual() many times over multiple years, it was a bit of struggle getting it to work again on a fresh install of Ubuntu 24.04. The problem is often often reported but helpful documentation is quite scattered. Your comment and linked SO solution finally solved it for me, especially the hint in the SO post that I needed also texlive-fonts-extra (sudo apt install texlive-fonts-extra in my case). That was after a lot of other texlive installing, extra installing via tinytex, etc.

ctoney avatar Mar 16 '25 15:03 ctoney

thank you for going down this rabbit hole - was finally able to fix it (in windows, had to install miktex as I could never get tinytex to work).

+1 on adding more helpful errors here.

Eflores89 avatar Jun 09 '25 14:06 Eflores89