I work with RStudio (version 3.1.2). When I try to Knit PDF in my R Markdown script, I receive the following output:
Error in eval(expr,envir,enclos): object 'pdflatex' not found
I have installed MikTex basic and have searched solutions on the web. There is one in stackoverflow for Mac users, I work with Windows 7. It seems the problem is not having a path to the Tex installation. I found this brief guide to solve it on Windows: enter link description here
So, I did what it says: Sys.which("pdflatex")
and received:
pdflatex
""
Ten I typed: Sys.getenv("PATH")
, obtaining:
1 "C:\Program Files\R\R-3.1.2\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;:/usr/texbin:/usr/texbin"
Finally, I entered: Sys.setenv(PATH=paste(Sys.getenv("PATH"),"/usr/texbin",sep=":"))
, but when I try to knit PDF again it shows me the same error message. Thanks for all your time, I would appreciate any help.
Edit your PATH variable. You're on windows, but you've tried to add a UNIX-style directory (i.e., separated from the other directories by
:
and using/
rather than\
).'/usr/texbin/'
is probably not a directory on your computer.