![帶有 unicode-math 和 ntheorem 的不可見數學字符](https://rvso.com/image/254712/%E5%B8%B6%E6%9C%89%20unicode-math%20%E5%92%8C%20ntheorem%20%E7%9A%84%E4%B8%8D%E5%8F%AF%E8%A6%8B%E6%95%B8%E5%AD%B8%E5%AD%97%E7%AC%A6.png)
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,因此您可以嘗試更新您的版本。