0

With XeLaTeX, the following source works as expected:

\documentclass{article}

\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Bonum}
\setmathfont{texgyrebonum-math.otf} % this way OK
%\setmathfont{TeX Gyre Bonum Math} % but this way gives "font cannot be found" error

\begin{document}
\[
\int_{0}^{1} e^{-\frac{1}{2} \xi^{2}} d \xi
\]
\end{document}

However, if I comment out the line

\setmathfont{texgyrebonum-math.otf}

and uncomment the line

\setmathfont{TeX Gyre Bonum Math}

then I get error

Package fontspec Error: The font "TeX Gyre Bonum Math" cannot be found.

The latter, "verbose", form of specifying the math font does work, however, with TeX Gyre Pagella Math and TeX Gyre Termes Math.

Command

otfinfo -a `kpsewhich texgyrebonum-math.otf`

gives the expected result TeX Gyre Bonum Math. And

/usr/local/texlive/2019/texmf-var/fonts/conf/texlive-fontconfig.conf 

already includes the line:

<dir>/usr/local/texlive/2019/texmf-dist/fonts/opentype</dir>

What could be wrong?

  • works okay for me. Is your system up-to-date? – Ulrike Fischer Aug 19 '19 at 16:40
  • Yes, I had just used the TeX Live Utility before trying to compile the source. And of course file /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/tex-gyre-math is there (otherwise, the form with texgyrebonum-math.otf surely would not have worked). – murray Aug 19 '19 at 16:52
  • 2
    oh unix. Using font names doesn't work for fonts in the texmf tree unless you have added the tree to your fontconfig. – Ulrike Fischer Aug 19 '19 at 17:06
  • My /usr/local/texlive/2019/texmf-var/fonts/conf/texlive-fontconfig.conf already includes the line <dir>/usr/local/texlive/2019/texmf-dist/fonts/opentype</dir>. – murray Aug 19 '19 at 18:25
  • 1
    Solved: I needed to add file texgyrebonum-math.otf to the macOS system fonts (using Font Book). I didn't realize (or didn't remember) that an OpenType font has to be made known to the OS if it is to be referred to by font name rather than by file name. – murray Aug 19 '19 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.