I have been using R and Texworks for some time now, but when I try using them together (i.e. R Markdown) things start to go wrong - even at the start. I'm guessing the problem is something really simple, if you know how to fix it please feel free to reply. Here is the chain of events:
- Installed R and Rstudio and all its necessary packages. R version 3.4.1, Rstudio version 1.0.153 on Windows 10.
- Installed LyX (2.2) which comes with Texworks and MikTex (2.9) package manager. Installed all necessary packages to get even the most complex dissertations compiling.
- Open Rstudio.
- File -> New File -> R Markdown...
- Select PDF as default output. This then give the introduction template.
- Click on Knit. ('Answer 'Do you want to allow this app from an unknown publisher to make changes to your devide?' thrice)
Error message in R Markdown window:
! LaTeX Error: File `url.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.5100 \let pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 In addition: Warning message: running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS dfth.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output dfth.pdf --template "C:\Users\ALEX.LAU\Documents\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43 Execution halted
Things I've tried:
Installing url.sty in Miktex. Restart Rstudio. Same error.
Change output from pdflatex to xelatex (suggestion from a previous post). Get a similar error saying I must install mathspec.sty. Installed mathspec.sty in Miktex. Same error.
Outputting as html works though so I guess there is a problem linking Rstudio/R markdown with Miktex packages?
Thanks