當 \small 應用於群組時 Stix Math Two 的 left( \right) 問題 (Lualatex)

當 \small 應用於群組時 Stix Math Two 的 left( \right) 問題 (Lualatex)

考慮以下 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}

在此輸入影像描述

\small如果您編譯它,您會注意到第一個 with指令中的括號沒有正確縮放。如果你註解掉\setmathfont{Stix Two Math}它仍然有效。所以,這似乎是一個 stix 2 問題。我使用完全更新的 LuaLatex (MacTeX 2017) 系統。

我的問題 a) 這是已知問題嗎? b) 如何以透明的方式解決這個問題?

(我無法切換到 XeLaTex,因為我打算使用一些 lua 程式碼。)

答案1

問題似乎出在+ssty用於小於基本尺寸的尺寸的選項上; A錯誤報告已經在 Sourceforge 上備案。

這是一個使用xetexor編譯的範例luatex,會產生不同的結果。

\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

輸出與xetex

在此輸入影像描述

輸出與luatex

在此輸入影像描述

該問題似乎是由於選項與 LuaTeX 或luaotfload.

然而,它似乎只影響括號,而不影響其他分隔符號:

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

在此輸入影像描述

一個可能的解決方法:

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

在此輸入影像描述

相關內容