
運行pdflatex
以下文檔
\documentclass{article}
\usepackage{glossaries-extra}
\newglossaryentry{injective}{name={\ensuremath{X\overset{1:1}{\rightarrow}Y}},description={injective function}}
\makeglossaries
\begin{document}
\glsadd{injective}
\printglossaries
\end{document}
產生以下編譯錯誤:
! Argument of \@tempc has an extra }.
<inserted text>
\par
l.3 ...arrow}Y}},description={injective function}}
答案1
\overset
不穩健,因此寫入檔案時會失敗。嘗試
...X\protect\overset...
順便說一句,我可能會使用amsmath
and\xrightarrow{1{:}1}
而不是\overset
構造