[Tex/LaTex] footnotemark in description environment generates error

cross-referencingdescriptionfootnotes

I am writing a manual for a product, which has additional features only on select models. I, obviously, try to use footnotes to indicate the same.

Please use this Preamble

MWE:

\begin{description}
    \item[] \screenshot{figure name}{figure caption}
    \item[A brilliant feature\footnotemark]\footnotetext{\label{fn:onlyCol}available on select models} It helps spawn a new civilization.
    \item[Activate brilliant feature]\textsuperscript{\ref{fn:onlyCol}} Activates the above mentioned brilliant feature.
\end{description}

Errors:

Use of \@xfootnotemark doesn't match its definition. ... A brilliant feature \footnotemark]

Argument of \stepcounter has an extra }. ... A brilliant feature \footnotemark]

Paragraph ended before \stepcounter was complete. ... A brilliant feature \footnotemark]

Steps taken so far:

  1. tried removing \label{fn:onlyCol}
  2. tried using \footnote{available on select models}
  3. Answer by Lockstep
  4. Answer by Uriel CP

Class used: Article

Package: Hyperref and others.

Compiler: XeLaTeX

IDE: Texstudio

Note: The suggested Similar Questions do not indicate that this question is a duplicate.

EDIT:

This works

\item[Activate brilliant feature]\textsuperscript{\ref{fn:onlyCol}} Activates the above mentioned brilliant feature.

But this doesn't

\item[Activate brilliant feature\textsuperscript{\ref{fn:onlyCol}}] Activates the above mentioned brilliant feature.

May I ask why? or will that be another question?

Best Answer

This seems to be a case of a fragile command (\footenotemark) in a moving argument (\item). So put \protect before the \footnotemark.

 \item[A brilliant feature\protect\footnotemark]\footnotetext{\label{fn:onlyCol}available on select models} It helps spawn a new civilization.

The LaTeX book gives some information about fragile commands. At least every command that has an optional argument or a * form is fragile. \footnotemark (and \footnote) have an optional argument and so they are fragile. Normally the \item in a list is a safe place, but apparently due to your customization with \setlist is has become a moving place that is unsafe for fragile commands. Usually the kind of error message you get:

Use of \@xfootnotemark doesn't match its definition

gives me a hunch that there are fragile commands involved.

Anyway, putting \protect before a command when it is not really needed is usually harmless.

Related Question