12

You can use the range feature of unicode-math to set the math font for a specific unicode slots or the macro accessing the glyph. I tried this with the sum sign & Latin Modern, see my example:

\documentclass{scrartcl}

\usepackage{amsmath}
\usepackage{unicode-math} % use unicode in math & setup math fonts
\setmathfont{Asana Math}
%\setmathfont[range=\sum]{Latin Modern Math} % substitute Sum sign

\begin{document}

Notice the different sum sign $\sum$, as intended. 

Notice also, the difference in spacing, not intended:
\begin{equation}
    \begin{bmatrix}
        0           & \frac{1}{2}   & \frac{2}{3} \\
        \frac{3}{4} & 0             & \frac{4}{5} \\
        \frac{5}{6} & \frac{6}{7}   & 0
    \end{bmatrix}
    \begin{pmatrix}
        A \\
        B \\
        C
    \end{pmatrix}
\end{equation}
\end{document}

However, not only the sum sign, but also the spacing in the matrices changes. With Latin Modern commented out (as in the example): Latin Modern Deactive With Latin Modern active (remove % before relevant line): Latin Modern Active Why is that? BTW, I'm using Lualatex from TeXLive 2012.

1 Answer 1

12

LuaTeX takes global math constants from the last defined font (I’m not yet sure if this can be considered a bug or a feature). A simple workaround is to call Asana Math again with an empty range (calling it without a range will undo previous font calls):

\usepackage{amsmath}
\usepackage{unicode-math} % use unicode in math & setup math fonts
\setmathfont{Asana Math}
\setmathfont[range=\sum]{Latin Modern Math} % substitute Sum sign
\setmathfont[range={}]{Asana Math}

\begin{document}

Notice the different sum sign $\sum$, as intended.

Notice also, the difference in spacing, not intended:
\begin{equation}
    \begin{bmatrix}
        0           & \frac{1}{2}   & \frac{2}{3} \\
        \frac{3}{4} & 0             & \frac{4}{5} \\
        \frac{5}{6} & \frac{6}{7}   & 0
    \end{bmatrix}
    \begin{pmatrix}
        A \\
        B \\
        C
    \end{pmatrix}
\end{equation}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .