词汇表无法编译 frougon 的波浪下划线

词汇表无法编译 frougon 的波浪下划线

我希望使用波浪下划线回答/u/frougon以及词汇表。我已将以下代码保存在名为的文件中test.tex

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\makeatletter
\newcommand{\math@param}[3]{%
  \fontdimen#3
  \ifx#1\displaystyle\textfont#2
  \else\ifx#1\textstyle\textfont#2
  \else\ifx#1\scriptstyle\scriptfont#2
  \else\scriptscriptfont#2 \fi\fi\fi
}

\newdimen\@my@yshift
\newcommand*{\myvecBelow}[1]{\mathord{\mathpalette\@myvecBelow{#1}}}

% Squiggly line below the math expression
\newcommand*{\@myvecBelow}[2]{%
  \begin{tikzpicture}[baseline=(n.base)]
    \node (n) [inner sep=0]
      {\global\@my@yshift=\math@param{#1}{2}{5}%
       \vrule width 0pt height 0pt depth 0.5\@my@yshift\relax
       $\m@th #1#2$};
    % Make sure the snake is always drawn with a little shift below the south
    % border of node n.
    \draw[decorate, decoration={snake, amplitude=0.3pt, segment length=2pt}]
      ([yshift=-0.3\@my@yshift]n.south west) --
      ([yshift=-0.3\@my@yshift]n.south east);
  \end{tikzpicture}%
}
\makeatother

\usepackage{glossaries-extra}
\makeglossaries
\newglossaryentry{myvecBelow}{name={\ensuremath{x}},description={squiggly underline}}
%\newglossaryentry{myvecBelow}{name={\ensuremath{\myvecBelow{x}}},description={squiggly underline}}
\begin{document}
$\myvecBelow{x}$\glsadd{myvecBelow}
\printglossary
\end{document}

如果我执行以下命令:

lualatex test
makeglossaries test
lualatex test

最终,这些表演圆满结束,并取得了以下的成果:

成功运行

但是,如果我将该\newglossaryentry行更改为注释掉的行,则第一次执行将lualatex中止并显示以下错误消息:

! Undefined control sequence.
\in@ #1#2->\begingroup \def \in@@ 
                                  ##1#1{}\toks@ \expandafter {\in@@ #2{}{}#1...

l.36 ...Below{x}}},description={squiggly underline}}

相关内容