TransWikia.com

Use of @xfootnote doesn't match its definition

TeX - LaTeX Asked on May 5, 2021

I get an error when compiling the following code:

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}{noindenttextbf{Solution :}enspace}

usepackage{etextools,etoolbox}

AtBeginEnvironment{solution}{%
  letoldfootnotefootnote% Store original footnote
  renewcommand{footnote}[1]{% Update footnote
    oldfootnote{#1}% Original footnote
    ifprintanswers
      begingroupedefx{endgroupAfterGroup{noexpandfootnotetext[thefootnote]{#1}}}x%
    fi
  }%
}

begin{document}

begin{exo}[]label{}
A question.
begin{solution}
An answerfootnote{I would like to add that
[frac{f(x)-f(0)}{x-0}=xln(x)underset{xto 0^+}{longrightarrow} 0.]} continued.
end{solution}
end{exo}

end{document}

The error code is as follows:

! Use of @xfootnote doesn't match its definition.
<argument> def reserved@a {
def @currenvir {equation*}edef @currenvline...
l.31 ...underset{xto 0^+}{longrightarrow} 0.]}
continued.

Clearly the solution environment one helped me define here doesn’t like math in its footnotes. This is, however, not always the case since some short footnotes containing math happen to compile properly.

Does anyone have a fix?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP