3

devtools::build_manual() produces Error: Failed to build manual (at least on windows).

Steps to reproduce:

  1. create a new R project on R Studio.
  2. Add this documentation for the hello_world function, document and build the package.
#' Hello world doc
#'
#' @export
#'
hello <- function() {
  print("Hello, world!")
}
  1. Try running devtools::build_manual()

Error: Failed to build manual

This seems to be a recent issue; I could build my packages manuals not too long ago. I tried the check_manual() function in this issue, and this is what I get:

> check_man()
Checking:  hello.RdError: Failed to build manual
Called from: value[[3L]](cond)
Browse[1]> e
System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr (last 10 lines):
E> ima/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/urw/times/utmb8a.pfb><c:/Use
E> rs/plima/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/urw/times/utmr8a.pfb><c
E> :/Users/plima/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/urw/times/utmri8a.
E> pfb>
E> Output written on Rd2.pdf (1 page, 50650 bytes).
E> Transcript written on Rd2.log.
E> Warning in sys2(makeindex, shQuote(idxfile)) : '"makeindex"' not found
E> Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
E>   unable to run 'makeindex' on 'Rd2.idx'
E> Error in running tools::texi2pdf()

I don't know what to do with this output. All I know is that I could build manuals not too long ago.

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] manualtest_0.1.0

loaded via a namespace (and not attached):
 [1] magrittr_2.0.1    usethis_2.0.1     devtools_2.4.2    pkgload_1.2.1     R6_2.5.0          rlang_0.4.11     
 [7] fastmap_1.1.0     fansi_0.5.0       tools_4.1.0       pkgbuild_1.2.0    sessioninfo_1.1.1 utf8_1.2.2       
[13] cli_3.0.1         withr_2.4.2       ellipsis_0.3.2    remotes_2.4.0     rprojroot_2.0.2   tibble_3.1.3     
[19] lifecycle_1.0.0   crayon_1.4.1      processx_3.5.2    purrr_0.3.4       callr_3.7.0       vctrs_0.3.8      
[25] fs_1.5.0          ps_1.6.0          testthat_3.0.4    memoise_2.0.0     glue_1.4.2        cachem_1.0.5     
[31] pillar_1.6.1      compiler_4.1.0    desc_1.3.0        prettyunits_1.1.1 pkgconfig_2.0.3  
Phil
  • 7,287
  • 3
  • 36
  • 66
Pedro Lima
  • 81
  • 7
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. It looks like there is probably something specific in your documentation code that's causing a problem. If you create brand new package project and build that, do you get the same error? – MrFlick Nov 05 '21 at 01:49
  • As I mentioned above, this happens even when I create a new package from scratch. I just added the hello world code, which will not be so illuminating. – Pedro Lima Nov 05 '21 at 18:42
  • Does `Sys.which("makeindex")` return a path? Have you changed/altered any of the LaTeX distirbutiions on your machine recently? The paths shown seem to indicate you used TinyTex. Maybe try `tinytext::reinstall_tinytex()` to try to repair your install. – MrFlick Nov 05 '21 at 19:25
  • > Sys.which("makeindex") returns "". I have not changed latex distributions, and I can generate pdfs from regular Rmd files. Will try reinstalling tinytex – Pedro Lima Nov 05 '21 at 19:36
  • Then somehow something has gone wrong with your LaTeX distribution install. That required program should have been included. I would try reinstalling TinyTex to see if that fixes things. – MrFlick Nov 05 '21 at 19:38

1 Answers1

5

Running tinytex::tlmgr_install("makeindex") solved the issue, without the need to reinstall tinytex.

Pedro Lima
  • 81
  • 7