运行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
构造