帶有 unicode-math 和 ntheorem 的不可見數學字符

帶有 unicode-math 和 ntheorem 的不可見數學字符

lualaTeX當使用(來自 TeXLive 2011)編譯此程式碼時,

\documentclass{minimal}
\usepackage{unicode-math}
\usepackage{ntheorem,thmtools}
\setmathfont{xits-math}
\makeatletter
\newtheoremstyle{mathfonttest}
  {\item[\theorem@headerfont $ABC$ DEF $:!?$ ]} % 1. option
  {\item[$ABC$ DEF ]} % 2. option
 \makeatother
\declaretheorem[style=mathfonttest]{test}

\begin{document}
\begin{test} % 1. option, ABC invisible
  Something. 
\end{test}
\begin{test}[triggers 2. option] % 2. option, ABC visible
  Something.
\end{test}
\end{document}

第一個 ABC,更一般地說,內聯數學模式中的任何希臘或拉丁字符(當前面有時\theorem@headerfont)都是不可見的,我不知道為什麼。我想做的是在諸如“1.1”之類的定義的可選或替代描述中使用數學代碼。定義($pi$)'。

有誰知道如何解決這個問題或規避它?

答案1

問題是呼叫\theorem@headerfont並且\theorem@checkbold這個巨集確實

\if b\expandafter\@car\f@series\@nil\boldmath\fi

這就是消失的原因:使用的字體是粗體,這會導致\boldmath起作用,但 XITS Math 已粗體版本。

如果您想ntheorem在定理標籤中使用 and math,那麼您需要使用非粗體字體。

最新的 TeX 發行版 (TeX Live 2012) 應該會有粗體版本的 XITS Math,因此您可以嘗試更新您的版本。

相關內容