[comp.text.tex] \ref inside \caption

eliot@phoenix.Princeton.EDU (Eliot Handelman) (09/14/90)

This bombs:

\begin{figure}

...

\caption{Another view of figure~\ref{otherfigure}}

\end{figure}

The error is that there are too many }'s. Is there a quick fix? 

piet@cs.ruu.nl (Piet van Oostrum) (09/19/90)

>>>>> In article <2505@idunno.Princeton.EDU>, eliot@phoenix.Princeton.EDU
>>>>> (Eliot Handelman) writes:

EH> This bombs:
EH> \begin{figure}
EH> ...
EH> \caption{Another view of figure~\ref{otherfigure}}
EH> \end{figure}

EH> The error is that there are too many }'s. Is there a quick fix? 

Yes:
\caption{Another view of figure~\protect\ref{otherfigure}}
                                ^^^^^^^^
(Fragile command in moving argument)
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl   (*`Pete')