UK TeX FAQ -- question label extrabrace

### An extra '`}`'??

You've looked at your LaTeX source and there's no sign of a misplaced `}` on the line in question.

Well, no: this is TeX's cryptic way of hinting that you've put a fragile command in a moving argument.

For example, `\``footnote` is fragile, and if we put that in the moving argument of a `\``section` command, as

>     \section{Mumble\footnote{I couldn't think of anything better}}

we get told

>     ! Argument of \@sect has an extra }.

The same happens with captions (the following is a simplification of a comp.text.tex post):

>     \caption{Energy: \[e=mc^2\]}

giving us the error message

>     ! Argument of \@caption has an extra }.

The solution is usually to use a robust command in place of the one you are using, or to force your command to be robust by prefixing it with `\``protect`, which in the `\``section` case would show as

>     \section{Mumble\protect\footnote{I couldn't think of anything better}}

In both the `\``section` case and the `\``caption` case, you can separate the moving argument, as in `\``section[`moving`]{`static`}`; this gives us another standard route - simply to omit (or otherwise sanitise) the fragile command in the moving argument. So, one might rewrite the `\``caption` example as:

>     \caption[Energy:  $E=mc^2$]{Energy: \[E=mc^2\]}

for, after all, even if you want display maths in a caption, you surely don't want it in the list of figures.

The case of footnotes is somewhat more complex; "footnotes in LaTeX section headings" deals specifically with that issue.

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=extrabrace