5

I am trying to compile a Markdown file to PDF using pandoc and xelatex.

The command I employed is like this:

pandoc --pdf-engine=xelatex pantest.md -o pantest.pdf

The error information comes as follows:

Error producing PDF.
! Undefined control sequence.
l.931   \file_get:nnN

The markdown file I put into test is quite simple:

abcdefg

It does not contain any CJK characters.

I am using Windows 10, pandoc 2.7 and MikTex 2.9.


Following debugging steps suggested by @mb21 in the comment section, the error information seems to have relation with the "unicode-math". Here is the new error I have now:

command used:

pandoc pantest.md -s -o pantest.tex
xelatex pantest.tex

Error information generated:

l.931   \file_get:nnN
                      {unicode-math-table.tex} {} \l__um_mathtable_tl

'pdflatex pantest.tex' works fine.

L.J
  • 1,066
  • 2
  • 13
  • 28
  • To debug the PDF creation, it can be useful to look at the intermediate representation: instead of -o test.pdf, use for example -s -o test.tex to output the generated LaTeX. You can then test it with `pdflatex test.tex`. – mb21 Mar 13 '19 at 14:29
  • @mb21 Thanks for pointing out this! I followed the debugging steps as you suggested. It turns out that the error information is related to a specific package called "unicode-math". I added details in my original post. – L.J Mar 14 '19 at 02:43
  • I'm fairly certain that this is a problem with the locally installed LaTeX packages. Can you update those and try again? – tarleb Mar 14 '19 at 06:46
  • I updated my Miktex intsallation today and use Xelatex. I have always the same error message `! Undefined control sequence. l.931 \file_get:nnN` – Faouzi Bellalouna Apr 06 '19 at 15:09
  • I am having the same issue as @FaouziBellalouna. I guess I updated some of my Rstudio packages and the Rmarkdown code that was working before fine, stopped working out of the sudden. – R.Andres Castaneda Dec 10 '19 at 14:33
  • @R.AndresCastaneda Excuse me but I've forgotten how I solved this problem. I'm really sorry but I searched in my questions and haven't found any thing – Faouzi Bellalouna Dec 10 '19 at 16:29
  • @R.AndresCastaneda If you are using R Markdown, you may give TinyTeX a try, since this issue appears to have affected several people but no one has a solution (and I was unable to reproduce it with MiKTeX): https://github.com/rstudio/rmarkdown/issues/1733#issuecomment-564754202 – Yihui Xie Dec 11 '19 at 22:07

1 Answers1

0

I think you need to update your LaTeX packages in MiKTeX, as confirmed by several other users here. Alternatively, you could try TinyTeX.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419