[R-pkg-devel] LaTeX errors when creating PDF version, Error in texi2dvi

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Jan 24 13:50:01 CET 2022


On 24/01/2022 5:58 a.m., Anthony Hammond wrote:
> Hello,
> 
> Since updating to the current version of R (4.1.2) I can't seem to pass the
> R cmd checks, I get the below message. I've read a lot online about
> installing and linking MikTex, which I've done. Another suggests I need the
> function texi2dvi(), which is available in the tools package. So I'm not
> sure what to do. Any assistance would be appreciated
> 
> Thank you
> Anthony
> 
> checking PDF version of manual ... WARNING
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> * checking PDF version of manual without hyperrefs or index ... ERROR
> Re-running with no redirection of stdout/stderr.
> Hmm ... looks like a package
> You may want to clean up by 'rm -Rf
> C:/Users/ANTHON~1/AppData/Local/Temp/RtmpqkDPxl/Rd2pdf3bb84cc32d1c'
> Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  :
>    pdflatex is not available
> Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  :
>    pdflatex is not available
> Error in running tools::texi2pdf()
> * DONE
> Status: 1 ERROR, 1 WARNING

You should fix the ERROR first.  It's saying that the `pdflatex` program 
isn't being found.  Since you say you've installed MikTeX, that probably 
means that it isn't on the system path.  You need to do 2 things:

1.  Find out where pdflatex.exe is on your system.
2.  Make sure its directory is on the PATH that R sees.

You do step 1 using Windows search tools.  For step 2, use 
Sys.getenv("PATH") in R to see the current path.

If you found pdflatex.exe in C:\Miktex\bin\pdflatex.exe then you'd need 
to add "C:\Miktex\bin" to your path.  You can do this temporarily within 
R using

     Sys.setenv(PATH = paste0(Sys.getenv("PATH"), ";C:\\Miktex\\bin")

but this will only last for the current session.  To add it permanently, 
you'll need to use some Windows configuration tools.

Duncan Murdoch



More information about the R-package-devel mailing list