與定理名稱(XeTeX)相關的奇怪錯誤

與定理名稱(XeTeX)相關的奇怪錯誤

試著用定理[name=Dominio e codominio dell'operatore $D^{\vct{q}}$,label=thm:oss:DomCodomDq]給出以下錯誤:

TeXShop 控制台上的錯誤

此錯誤由以下 MWE 給出:

\documentclass[a4paper]{report}  
\usepackage{amsmath,amssymb,thmtools}  
\newtheorem{oss}{Osservazione}  
\begin{document}  
\begin{oss}[name=Dominio e codominio dell'operatore $D^{\overrightarrow{q}}$,label=thm:oss:DomCodomDq]  
\end{oss}  
\end{document}

其中\vct已被其原始名稱替換\overrightarrow。該錯誤顯然與 相關\vct,因為刪除 就會消除該錯誤。這是什麼意思以及我該如何解決它?

答案1

定義一個虛擬物件:

\documentclass[a4paper]{report}  
\usepackage{amsmath,amssymb,thmtools}  
\newtheorem{oss}{Osservazione}  
\begin{document}  
\def\dummy{$D^{\overrightarrow{q}}$}
\begin{oss}[name=Dominio e codominio dell'operatore \protect\dummy,label=thm:oss:DomCodomDq]  
\end{oss}  
\end{document}

或使用:

$D^{\protect\overrightarrow{q}}

相關內容