
使用 XeLaTeX,以下原始程式碼可以按預期工作:
\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}
但是,如果我註解掉該行
\setmathfont{texgyrebonum-math.otf}
並取消註解該行
\setmathfont{TeX Gyre Bonum Math}
然後我得到錯誤
Package fontspec Error: The font "TeX Gyre Bonum Math" cannot be found.
然而,後者指定數學字體的「詳細」形式確實適用於 TeX Gyre Pagella Math 和 TeX Gyre Termes Math。
命令
otfinfo -a `kpsewhich texgyrebonum-math.otf`
給出了預期的結果TeX Gyre Bonum Math
。和
/usr/local/texlive/2019/texmf-var/fonts/conf/texlive-fontconfig.conf
已經包含以下行:
<dir>/usr/local/texlive/2019/texmf-dist/fonts/opentype</dir>
可能出什麼問題了?