1

I'm using pandoc to render a markdown document to a pdf. Everything was working fine when I had pandoc 1.x (I think it was 1.16), which I had installed using apt-get. But then I upgraded to version 2.9.2.1 using the website instructions and now I get the following error when I try to compile my markdown:

Error producing PDF.
! LaTeX Error: File `unicode-math.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.16   \defaultfontfeatures

The exact command I'm using in pandoc is this:

pandoc input.md \
    -f markdown-implicit_figures \
    -V geometry:a4paper \
    -V geometry:margin=2.5cm \
    -V mainfont="Helvetica" \
    --pdf-engine=xelatex \
    -o output.pdf

I googled this problem and found some information saying that this is probably due to that the new pandoc version is not "reading" the sty files from the previous version, but I couldn't find clear instructions to fix it. I'm using Ubuntu 18.04.4 LTS.

4
  • 1
    the error message says that a sty is not found, not a font. Install unicode-math in your tex system. Commented May 8, 2020 at 17:24
  • Thanks, I've edited the question to clarify this. My system already has unicode-math but pandoc/Latex don't seem to find it for some reason
    – Luise
    Commented May 8, 2020 at 17:33
  • 1
    check in the log-file (if you can find it, where latex finds the documentclass. Then you know which tex system pandoc is using. Commented May 8, 2020 at 17:41
  • Clearly not a macOS / MacPorts question, but for the benefit of those MacPorts users who might arrive here after searching for LaTeX Error: File `<something>.sty' not found, particularly after a fresh MacPorts install, try sudo port install texlive. Then go make some tea, because it's going to be a while. (reference)
    – Kevin E
    Commented Oct 13, 2023 at 14:45

1 Answer 1

0

On Linux Mint I was able to fix this error by installing the following packages:

sudo apt texlive-latex-recommended install fonts-lmodern lmodern  texlive-latex-extra

If that doesn't work then you might use apt-cache search to find a related package:

apt-cache search unicode-math

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .