3

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}

enter image description here

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.)

  • 1
    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 – egreg Jul 11 '17 at 20:45
  • 1
    with xelatex you get this output which suggests it is a luatex or unicode-math issue rather than the font at fault. – David Carlisle Jul 11 '17 at 20:46
  • 1
    Do you know a workaround to keep the font and the engine, but avoid this issue? Thanks. – balcinus Jul 11 '17 at 21:16
3

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
  \input luaotfload.sty
  \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 xetex

enter image description here

Output with luatex

enter image description here

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}

enter image description here

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}

enter image description here

  • 1
    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. – balcinus Jul 11 '17 at 21:58
  • 1
    @balcinus XITS Math is based on the first version of STIX. – egreg Jul 11 '17 at 22:00
  • 1
    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 :) – balcinus Jul 11 '17 at 22: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.