I originally posted with issues here:
Rmarkdown with xelatex
I have since reinstalled, but now I'm having an entirely new issue.
Using the following code (inside a .Rmd file):
---
header-includes:
- \usepackage{graphicx}
output:
pdf_document:
latex_engine: xelatex
---
```{r}
knitr::include_graphics("F:/Big Folder/My Folder/image.png")
```
I get the following error:
! Missing $ inserted.
<inserted text>
$
l.134 .../Big Folder/My Folder/image}
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
I think it has something to do with the space in the path, because when I put the image directly in F, it works fine.
Unfortunately, this project requires that I use folders with spaces in the name.
I'm on Windows 10 64 bit, running MikTex 2.9 with updated packages (including fontspec). Miktex is installed in program files, but I also tried an install to a different folder but had the same result.
I'm also running a recently installed/updated rstudio with updated knitr and rmarkdown packages.
This does work on pdflatex, even with spaces in the file name.