6

I'm trying to use Calibri font, but from what I understand I first need to be able to use the xelatex engine. This is where I run into problems. Sample code and error are below.

Please note that I am very new to latex so chances are I missed something obvious. If it matters I have MikTeX 2.9 installed, and I have successfully generated pdfs using the default pdflatex engine (from what I understand this has very limited fonts.)

I'm on windows 10 64 bit.

---
header-includes:
- \usepackage{fontspec}
output:
   pdf_document:
     latex_engine: xelatex
---


```{r}
data(mtcars)
```

Error:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS 
SimpleTest.utf8.md --to latex --from 
markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --
output SimpleTest.pdf --template "C:\Users\ce29109\Documents\R\win-
library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style 
tango --latex-engine xelatex --variable graphics=yes --variable 
"geometry:margin=1in" 
! Undefined control sequence.
<argument> \LaTeX3 error: 
                       Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }

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 SimpleTest.utf8.md --to latex --from 
markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --
output SimpleTest.pdf --template "C:\Users\ce29109\Documents\R\win-
library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style 
tango --latex-engine xelatex --variable graphics=yes --variable 
"geometry:margin=1in"' had status 43 
Execution halted

Edit:Incorrectly identified latex distribution used, I'm using MikTex

Matt
  • 174
  • 1
  • 2
  • 14
  • 1
    I can't reproduce this, however, a lot of similar posts suggest updating either MikTex or the packages. see https://stackoverflow.com/questions/46105808/rmarkdown-pdf-latex3-error-erroneous-variable, https://tex.stackexchange.com/questions/383240/fontspec-error-in-xelatex , https://tex.stackexchange.com/questions/387386/babylonian-numbers-in-miktex , https://sourceforge.net/p/miktex/discussion/33790/thread/fcf98fa1/ – user20650 Nov 20 '17 at 21:03
  • 1
    I wonder if you are willing to help me test a new LaTeX distribution I recently created: https://yihui.name/en/2017/12/test-tinytex/ – Yihui Xie Dec 04 '17 at 07:03
  • Sure thing. This probably isnt the place for feature requests, but as I work in a non academic environment, built in support for system fonts, colors and graphics would really help. Im not working on a project involving latex at the moment, but as soon as I do Ill pick it up. Thanks for all you have done for r pdf reporting. – Matt Dec 05 '17 at 11:38

0 Answers0