7

I would like to put a \rulecommand inside a caption. Classical solution is supposed to be \protect{} but that's not working. I still get Error: Argument of \@caption has an extra }. Why?

Here is a minimum example. (using MiKTeX 2.9 on XP)

\documentclass[]{revtex4-1}
\begin{document}
    \begin{figure}
        \caption{\protect{ \rule{.6em}{.2ex} }}
    \end{figure}
\end{document}
1
  • 6
    \protect\rule not \protect{ Commented Oct 8, 2013 at 9:30

1 Answer 1

8

\protect does not take a {} argument: it must immediately precede the token it is protecting so

 \caption{\protect\rule{.6em}{.2ex}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .