Recently, I've encountered errors compiling tex files using XeLaTeX in Sublime Text. I've compiled these same files earlier before without any major errors. I can't recall making any major changes to LaTeX, though I may have had performed a few OS updates. The problem seems to be that it can't find certain packages. It gives me errors along these lines:

LaTeX Error: File `siunitx.sty' not found. [^^I^^I^^I\allowdisplaybreaks]

I don't understand what's going on as the package at the following location: /opt/local/share/texmf-texlive/tex/latex/siunitx/siunitx.sty. The same issue happens with other packages including: lipsum, newtxmath, ebgaramond, & ebgaramond-maths. For some reason LaTeX is having trouble locating them.

The other errors I'm get are along the lines of:

Missing = inserted for \ifnum. [^^I^^I\newcommand]

I figure they're related to the missing package ordeal. Does anyone know what may be causing this and/or how to fix this?

  • 1
    Which OS? Is /opt/local/share/texmf-texlive in your TEXMF search path (try kpsewhich -var-value=TEXMF to see the search path)? As long as you have errors because of missing packages, other errors could be caused by this. Commented Apr 17, 2019 at 6:04
  • @Schweinebacke MacOS Mojave. kpsewhich gives me the following paths: /Users/Username/.texlive2016/texmf-config,/Users/Username/.texlive2016/texmf-var,/Users/Username/Library/texmf,!!/opt/local/etc/texmf,!!/opt/local/var/db/texmf,!!/opt/local/share/texmf-local,!!/opt/local/share/texmf,!!/opt/local/share/texmf-texlive
    – iteu
    Commented Apr 17, 2019 at 18:59
  • 1
    Try texhash (or sudo texhash if root rights are needed to write to /opt/local/share/texmf-local). After this successfully completes, kpsewhich siunitx.sty should find /opt/local/share/texmf-texlive/tex/latex/siunitx/siunitx.sty. If so, try another LaTeX run. BTW: .texlve2016 sounds like a very old TeX Live installation. Commented Apr 22, 2019 at 7:13

1 Answer 1


I managed to fix the problem with help from egreg. It turns out I had a MacPorts version of TeX Live installed in addition to MacTex. After I properly removed MacPorts, I was able to compile using MacTex with no further errors.

Details available here: Fontspec compilation error with MacTeX-2018

You must log in to answer this question.

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