1

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?

abyshukla
  • 411
  • I can't replicate your particular problem. Please provide a minimal but complete example of code. It should start with \documentclass and end with \end{document}. – Werner Dec 19 '16 at 07:02
  • 1
    Please provide a minimal example (or see here). I cannot reproduce that error if I stick that block of code between \documentclass{article} \usepackage{hyperref} \begin{document} and \end{document}, though the command \screenshot will generate an error. – jon Dec 19 '16 at 07:02
  • apologies. I will add the preamble too... – abyshukla Dec 19 '16 at 07:04
  • Link to the preamble on git added.... – abyshukla Dec 19 '16 at 07:16

1 Answers1

1

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.

  • Yes it did work!! Thanks! Now, how do I know which command needs \protect and which doesn't? – abyshukla Dec 19 '16 at 09:02
  • 1
    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. – Pieter van Oostrum Dec 19 '16 at 09:16
  • Would you please move this reasoning to your answer for others to read? – abyshukla Dec 19 '16 at 09:18
  • Thanks. Would you please look at the details in edit segment of this question? – abyshukla Dec 19 '16 at 09:24