编译以下代码时出现错误:
\documentclass[12pt,a4paper,answers]{exam}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheoremstyle{exerci}{}{}{}{}{\bfseries}{.}{.5em}{\thmnote{#3}~\thmname{#1}~\thmnumber{#2}}
\theoremstyle{exerci}
\newtheorem{exo}[]{Exercice}
\renewcommand{\solutiontitle}{\noindent\textbf{Solution :}\enspace}
\usepackage{etextools,etoolbox}
\AtBeginEnvironment{solution}{%
\let\oldfootnote\footnote% Store original footnote
\renewcommand{\footnote}[1]{% Update \footnote
\oldfootnote{#1}% Original footnote
\ifprintanswers
\begingroup\edef\x{\endgroup\AfterGroup{\noexpand\footnotetext[\thefootnote]{#1}}}\x%
\fi
}%
}
\begin{document}
\begin{exo}[]\label{}
A question.
\begin{solution}
An answer\footnote{I would like to add that
\[\frac{f(x)-f(0)}{x-0}=x\ln(x)\underset{x\to 0^+}{\longrightarrow} 0.\]} continued.
\end{solution}
\end{exo}
\end{document}
错误代码如下:
! Use of \@xfootnote doesn't match its definition.
<argument> \def \reserved@a {
\def \@currenvir {equation*}\edef \@currenvline...
l.31 ...\underset{x\to 0^+}{\longrightarrow} 0.\]}
continued.
显然solution
环境帮助我定义了这里不喜欢在脚注中使用数学。然而,情况并非总是如此,因为一些包含数学的短脚注恰好可以正确编译。
有人能解决吗?