无法使用 Libertinus Math

无法使用 Libertinus Math

我将 Libertinus 存储库克隆到子目录中,并尝试使用 xelatex 编译以下内容:

\documentclass{amsbook}
\usepackage{fontspec}
\usepackage{amsmath, amssymb}
\usepackage{unicode-math}

\setmainfont[
    Path = ./libertinus/,
    BoldFont={LibertinusSerif-Bold.otf},
    ItalicFont={LibertinusSerif-Italic.otf},
    BoldItalicFont={LibertinusSerif-BoldItalic.otf}
    ]{LibertinusSerif-Regular.otf}

\setmathfont[
    Path=./libertinus/
    ]{LibertinusMath-Regular.otf}

\begin{document}

The following equation should be in Libertinus, but it is not.

\begin{equation}
    \displaystyle\sum_{n=1}^\infty \dfrac{1}{n^2}=\dfrac{\pi^2}{6}
\end{equation}

\end{document}

文本是正确的,但是等式默认使用通常的 LaTeX 数学字体,并且我收到以下一堆错误消息:

* fontspec warning: "script-not-exist-latn"
*
* Font 'LibertinusMath-Regular' does not contain script 'Math'.
*  'Latin' script used instead.

* fontspec warning: "script-not-exist-latn"
* 
* Font 'LibertinusMath-Regular' does not contain script 'Math'.
*  'Latin' script used instead.

* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Style=MathScript' (ssty) not available for font
* 'LibertinusMath-Regular' with script 'Math' and language 'Default'.

* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Style=MathScriptScript' (ssty) not available for font
* 'LibertinusMath-Regular' with script 'Math' and language 'Default'.

我搜索了这些错误消息,但没有找到任何有用的信息。我该如何解决这个问题?

答案1

2019年4月4日,新版本的 Libertinus 字体已在 CTAN(版本 6.8)上部署,并且该问题已得到解决。

更新后的字体将在即将发布的 TeX Live 2019 中提供(并且可能已经适用于 MiKTeX)。

\documentclass{amsbook}
\usepackage{fontspec}
\usepackage{amsmath, amssymb}
\usepackage{unicode-math}

\setmainfont[
  Extension=.otf,
  UprightFont={*-Regular},
  BoldFont={*-Bold},
  ItalicFont={*-Italic},
  BoldItalicFont={*-BoldItalic}
]{LibertinusSerif}

\setmathfont{LibertinusMath-Regular.otf}

\begin{document}

The following equation should be in Libertinus and it is.
\begin{equation}
\sum_{n=1}^\infty \dfrac{1}{n^2}=\dfrac{\pi^2}{6}
\end{equation}

\end{document}

在此处输入图片描述

这是完整的控制台输出。

This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./thebigh.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2019/texmf-dist/tex/latex/amscls/amsbook.cls
Document Class: amsbook 2017/10/31 v2.20.4
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/amssymb.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/unicode-math/unicode-math.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.s
ty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
 (/usr/local/texlive/2019/texmf-dist/tex/latex/filehook/filehook.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/fix-cm.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/local/texlive/2019/texmf-dist/tex/latex/unicode-math/unicode-math-table.t
ex))) (./thebigh.aux)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsfonts/umsb.fd) [1]
(./thebigh.aux) )
Output written on thebigh.pdf (1 page).
Transcript written on thebigh.log.

相关内容