5

This happens in both XeLaTeX and LuaLaTeX, and the relevant package's behavior in question is unicode-math. Pagella Math lacks a \setminus symbol, and I substitute in Asana Math's \setminus symbol. But more that that gets substituted in; most obvious are the scr and cal styles, which is unexpected behavior. Testing \sum, it does not appear to get substituted in, which is expected behavior.

Is there something I'm missing or is this a bug in the package or in either font's OpenType behavior?

I think I've worked around this problem by first specifying Pagella Math as the math font for its mathematical operators, then specifying Asana Math for its \setminus, then finally specifying Pagella Math again to substitute back in its version of math styles, but my question still stands.

\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}

Without the Asana Math line: missing \setminus, Pagella's version of \sum and scr missing <code>\setminus</code>, Pagella's <code>\sum</code>, Pagella's <code>scr</code>

With the Asana Math line: Asana's \setminus, Pagella's version of \sum, Asana's version of scr Asana's <code>\setminus</code>, Pagella's <code>\sum</code>, Asana's <code>scr</code>

3

That is a rather known bug (?) in range processing of unicode-math. The trick is to load the main math font again with an empty range after all other ranges.

\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}

enter image description here

  • Thanks! When triggers this bug to occur? Some seem to trigger it while others don't. – jhanschoo Jan 13 '17 at 16:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.