# left( \right) problem with Stix Math Two when \small applied to the group (Lualatex)

Consider the following MWE:

\documentclass[12pt]{article}
\usepackage{unicode-math}
\setmathfont{STIX2Math.otf}

\begin{document}
{\small Small size
$\left(\frac{a}{b}\right) \left(\frac{\frac{a}{b}}{\frac{a}{b}}\right)$
}

Normal size
$\left(\frac{a}{b}\right) \left(\frac{\frac{a}{b}}{\frac{a}{b}}\right)$

\end{document}


If you compile it, you'll notice that parens are not scaled up correctly in the first one with \small directive. If you comment out \setmathfont{Stix Two Math} it works though. So, this seems to be a stix 2 problem. I use a fully updated LuaLatex (MacTeX 2017) system.

My questions a) is this a known issue? b) How can I work around this problem in a transparent way?

(I cannot switch to XeLaTex as I plan to play with some lua code.)

• Apparently LuaTeX doesn't play well with the ssty feature. Not related, but the font name is STIX Two Math; use the proper name if you want to ensure code portability. And yes, it seems a problem with STIX Two Math, as it doesn't happen with XITS Math Jul 11, 2017 at 20:45
• with xelatex you get this output which suggests it is a luatex or unicode-math issue rather than the font at fault. Jul 11, 2017 at 20:46
• Do you know a workaround to keep the font and the engine, but avoid this issue? Thanks. Jul 11, 2017 at 21:16

The problem seems to be in the +ssty option which is used for sizes less than the base size; a bug report has already been filed at Sourceforge.

Here is an example to be compiled with xetex or luatex and yields different results.

\input ifxetex.sty

\ifxetex
\font\extsymbolsA="STIX Two Math/OT:script=math;language=DFLT;"
\font\extsymbolsB="STIX Two Math/OT:script=math;language=DFLT;+ssty=0;"
\else
\font\extsymbolsA="STIX Two Math:mode=base;script=math;language=DFLT;"
\font\extsymbolsB="STIX Two Math:mode=base;script=math;language=DFLT;+ssty=0;"
\fi

\Udelcode(="3 (
\Udelcode)="3 )

\textfont3=\extsymbolsA
$$\left(a\over b\right)$$

\textfont3=\extsymbolsB
$$\left(a\over b\right)$$

\bye


## Output with luatex

The problem seems due to some interaction with the option and LuaTeX or luaotfload.

However, it only seems to affect parentheses and not the other delimiters:

\documentclass[10pt]{article}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}

\begin{document}
{\small Small size
$\left(\frac{a}{b}\right) \left[\frac{a}{b}\right] \left\{\frac{a}{b}\right\} \left\langle\frac{a}{b}\right\rangle$
}

Normal size
$\left(\frac{a}{b}\right) \left[\frac{a}{b}\right] \left\{\frac{a}{b}\right\} \left\langle\frac{a}{b}\right\rangle$

\end{document}


A possible workaround:

\documentclass[10pt]{article}
\usepackage{unicode-math}
\setmathfont{STIX Two Math}
\setmathfont[range={$$,$$}]{XITS Math}

\AtBeginDocument{%
\Udelcode(="4 (
\Udelcode)="4 )
}

\begin{document}
{\small Small size
$\left(\frac{a}{b}\right) \left[\frac{a}{b}\right] \left\{\frac{a}{b}\right\} \left\langle\frac{a}{b}\right\rangle$
}

Normal size
$\left(\frac{a}{b}\right) \left[\frac{a}{b}\right] \left\{\frac{a}{b}\right\} \left\langle\frac{a}{b}\right\rangle$

\end{document}


• That's an acceptable workaround I think. Not sure if the XITS would be the best font to take the parens, as STIX Two is somewhat more similar to Cambria Math (to my eyes, I mean) but your solution seems quite transparent. Thanks, I appreciate it. Jul 11, 2017 at 21:58
• @balcinus XITS Math is based on the first version of STIX. Jul 11, 2017 at 22:00
• I know, but STIX Two looks "a bit" dissimilar to STIX version 1 IMHO. Not that it matters much: it's just parentheses involved in the workaround :) Jul 11, 2017 at 22:02