I can knit the file below to pdf when in a rmarkdown-only environment. However, when I try to do the same thing within a bookdown project, the process fails by just reproducing the html file when using knit/knit to pdf and when using bookdown::render_book('03-Mass.rmd','pdf_book') I get
tlmgr search --file --global "/tikzlibrarytopaths.code.tex"
Error in system2("tlmgr", args, ...) :
'CreateProcess' failed to run 'C:\Users\David Stevens\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat search --file --global "/tikzlibrarytopaths.code.tex"'
In addition: Warning message:
In system2("tlmgr", args, ...) :
'CreateProcess' failed to run 'C:\Users\David Stevens\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat update --all --self'
Please delete _main.Rmd after you finish debugging the error.
This may be a difference between Windows and Mac, but I didn't have the same problem. Did you first run
bookdown_site('.')
within your project directory?
If so, the tex engine tlmgr failed to find "/tikzlibrarytopaths.code.tex", which sounds like a PATH problem. I've been away from Windows for quite some time, so cum grano salis, etc. but either the location of the bat file or the tex file could be mis-specified.
pdf_document and pdf_book does not use the same latex template. It may be possible that your missing some latex package for the pdf book output and that you installation of TinyTex have issue.
You can try to see if the installation works. I tried
Thanks. I tried tinytex::tlmgr_search("/tikzlibrarytopaths.code.tex") and got no response except a repeat of the command - nothing like what cderv got in the example, and the same for tinytex::tlmgr_update(). I'm using TeXlive (full installation) rather than tinytex for the pdf creation. That could be the issue but the pdf engines are the same for both, to my understanding. I could be wrong.