在“unicode-math”的范围选项中指定字符时,为什么替代数学样式字符也会被替换?

在“unicode-math”的范围选项中指定字符时,为什么替代数学样式字符也会被替换?

这在 XeLaTeX 和 LuaLaTeX 中都会发生,相关包的行为是unicode-math。Pagella Math 缺少一个\setminus符号,我用 Asana Math 的\setminus符号代替。但更多的是替换了 ;最明显的是scrcal样式,这是意外行为。测试\sum,它似乎没有被替换,这是预期的行为。

是我遗漏了什么吗,还是这是包中的错误,或者是字体的 OpenType 行为中的错误?

我想我已经解决了这个问题,首先将 Pagella Math 指定为其数学运算符的数学字体,然后为其指定 Asana Math \setminus,最后再次指定 Pagella Math 以替换其数学样式版本,但我的问题仍然存在。

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

\setmathfont{texgyrepagella-math.otf}

% this line specifies to use \setminus from Asana-Math, but Asana-Math's special math styles are substituted as well; comment to void this behavior
\setmathfont[range={"29F5-"29F5}]{Asana-Math.otf}

% uncomment this line to substitute back Pagella Math's math styles while retaining math symbols
%\setmathfont[range={up,it,tt,bfup,bfit,bb,bbit,scr,,cal,bfcal,frak,bffrak,sfup,sfit,bfsfup,bfsfit}]{texgyrepagella-math.otf}

\title{Unicode Math test}
\author{John Doe}
\begin{document}

\maketitle

\(X\setminus Y\) and \(\sum a\).

\noindent normal
\begin{eqnarray}
  ABCDEFGHIJKLMNOPQRSTUVWXYZ \\
  abcdefghijklmnopqrstuvwxyz \\
  \Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega \\
  \alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
  \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega \\
  1234567890
\end{eqnarray}
symup
\begin{eqnarray}
  \symup{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symup{abcdefghijklmnopqrstuvwxyz} \\
  \symup{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symup{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symup{1234567890}
\end{eqnarray}
symit
\begin{eqnarray}
  \symit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symit{abcdefghijklmnopqrstuvwxyz} \\
  \symit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symit{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symit{1234567890}
\end{eqnarray}
symtt
\begin{eqnarray}
  \symtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symtt{abcdefghijklmnopqrstuvwxyz} \\
  \symtt{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symtt{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symtt{1234567890}
\end{eqnarray}
symbfup
\begin{eqnarray}
  \symbfup{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfup{abcdefghijklmnopqrstuvwxyz} \\
  \symbfup{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfup{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfup{1234567890}
\end{eqnarray}
symbfit
\begin{eqnarray}
  \symbfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfit{abcdefghijklmnopqrstuvwxyz} \\
  \symbfit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfit{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfit{1234567890}
\end{eqnarray}
symbb
\begin{eqnarray}
  \symbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbb{abcdefghijklmnopqrstuvwxyz} \\
  \symbb{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbb{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbb{1234567890}
\end{eqnarray}
symbbit
\begin{eqnarray}
  \symbbit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbbit{abcdefghijklmnopqrstuvwxyz} \\
  \symbbit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbbit{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbbit{1234567890}
\end{eqnarray}
symscr
\begin{eqnarray}
  \symscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symscr{abcdefghijklmnopqrstuvwxyz} \\
  \symscr{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symscr{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symscr{1234567890}
\end{eqnarray}
symbfscr
\begin{eqnarray}
  \symbfscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfscr{abcdefghijklmnopqrstuvwxyz} \\
  \symbfscr{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfscr{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfscr{1234567890}
\end{eqnarray}
symcal
\begin{eqnarray}
  \symcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symcal{abcdefghijklmnopqrstuvwxyz} \\
  \symcal{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symcal{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symcal{1234567890}
\end{eqnarray}
symbfcal
\begin{eqnarray}
  \symbfcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfcal{abcdefghijklmnopqrstuvwxyz} \\
  \symbfcal{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfcal{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfcal{1234567890}
\end{eqnarray}
symfrak
\begin{eqnarray}
  \symfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symfrak{abcdefghijklmnopqrstuvwxyz} \\
  \symfrak{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symfrak{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symfrak{1234567890}
\end{eqnarray}
symbffrak
\begin{eqnarray}
  \symbffrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbffrak{abcdefghijklmnopqrstuvwxyz} \\
  \symbffrak{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbffrak{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbffrak{1234567890}
\end{eqnarray}
symsfup
\begin{eqnarray}
  \symsfup{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symsfup{abcdefghijklmnopqrstuvwxyz} \\
  \symsfup{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symsfup{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symsfup{1234567890}
\end{eqnarray}
symsfit
\begin{eqnarray}
  \symsfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symsfit{abcdefghijklmnopqrstuvwxyz} \\
  \symsfit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symsfit{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symsfit{1234567890}
\end{eqnarray}
symbfsfup
\begin{eqnarray}
  \symbfsfup{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfsfup{abcdefghijklmnopqrstuvwxyz} \\
  \symbfsfup{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfsfup{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symsfup{1234567890}
\end{eqnarray}
symbfsfit
\begin{eqnarray}
  \symbfsfit{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfsfit{abcdefghijklmnopqrstuvwxyz} \\
  \symbfsfit{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfsfit{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfsfit{1234567890}
\end{eqnarray}
symbfsf
\begin{eqnarray}
  \symbfsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\
  \symbfsf{abcdefghijklmnopqrstuvwxyz} \\
  \symbfsf{\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda\Mu\Nu
  \Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega} \\
  \symbfsf{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu
    \xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega} \\
  \symbfsf{1234567890}
\end{eqnarray}

\end{document}

没有 Asana Math 线:缺少\setminus,Pagella 版本的\sumscr 缺少 <code>\setminus</code>,Pagella 的 <code>\sum</code>,Pagella 的 <code>scr</code>

使用 Asana Math 行:Asana 的\setminus,Pagella 版本的\sum,Asana 版本的scr Asana 的 <code>\setminus</code>、Pagella 的 <code>\sum</code>、Asana 的 <code>scr</code>

答案1

这是 的范围处理中一个相当知名的错误 (?) unicode-math。诀窍是在所有其他范围之后再次加载主数学字体,并使用空范围。

\documentclass{article}
\usepackage{unicode-math}

\setmathfont{texgyrepagella-math.otf}
\setmathfont[range={\setminus}]{Asana-Math.otf}
\setmathfont[range={}]{texgyrepagella-math.otf}

\begin{document}

\(X\setminus Y\) and \(\sum a\).

\[ \symscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \]

\end{document}

在此处输入图片描述

相关内容