I´ve been trying to get the minimal Demofile for knitr running and compiling in TeXstudio, but I keep getting errormessages.
Here´s the info, mybe somebody can help me out about what I´m doing wrong:
I´m compiling this example file from the knitr website:
\documentclass{article}
\begin{document}
Here is a code chunk.
<<foo, fig.height=4>>=
1+1
letters
chartr('xie', 'XIE', c('xie yihui', 'Yihui Xie'))
par(mar=c(4, 4, .2, .2)); plot(rnorm(100))
@
You can also write inline expressions, e.g. $\pi=\Sexpr{pi}$, and \Sexpr{1.598673e8} is a big number.
\end{document}
I have this added in my Builds as a user command in TeXstudio:
knitr:knitr "C:/Program Files/R/R-3.0.2/bin/Rscript.exe" -e "library(knitr, lib.loc='C:/Users/User/Documents/R/win-library/3.0'); knit2pdf('%.Rnw')"
(based on the info here http://yihui.name/knitr/demo/editors/#comment-784855735 and here http://yihui.name/knitr/demo/editors/ )
Now when compiling I get the error
Couldn´t start Build & View:PdfLaTeX:"C:Program Files (x86)/MikTeX 2.9/miktex/bin/pdflatex.exe" -synctex=1 - interaction=nonstopmode "002-minimal".tex .
and when I hit Ok, it says:
Logfile not found!
TeXstudio works fine with simple .tex-documents. So what am I missing here?
Thanks in advance!
PATH
of your OS – Yihui Xie Oct 14 '13 at 5:23C:\texlive\2013\bin\win32
, how to set it toC:\Program Files\R\R-3.0.2\bin\i386
instead?. Doest this work for XeLaTex instead of PdfLaTex? – doctorate Oct 26 '13 at 7:45Start -> right click Computer -> Properties -> Advanced -> Environment Variables
, lower window). Secondly the other solution was: Create a txtfile, that contains just this:set PATH=C:\Program Files\R\R-3.0.2\bin\x64;%PATH%
where you changeC:\...\x64
with the corresponding directory of your R install. Rename the txtfile tosetpath.bat
, then open commandline, switch to the directory (where setpath.bat is) in cmd and then put inCMD /K setpath.bat
and hit enter. Should do the job. – Can Oct 28 '13 at 20:48