Graphics, Figures & TablesError in figure caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mikkelDK
Posts: 2
Joined: Sun Nov 28, 2010 4:24 pm

Error in figure caption

Post by mikkelDK »

Hi,

I have a problem with a symbol that I have defined when using it in figure captions (and captions of algorithms as well). It is a 180 degrees rotation of a curvearrowleft from amssymb. This minimal example generates the error:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{amssymb}
\usepackage{rotating}

\newcommand{\arcTo}
{\begin{sideways}
  \begin{sideways}
    $\curvearrowleft$
  \end{sideways}
\end{sideways}}

\begin{document}

\begin{figure}
\caption{This is test a test $r_1\arcTo r_2$}
\end{figure}

\end{document}
The error is:
! Argument of \@caption has an extra }.
<inserted text>
\par
l.15 \caption{This is test a test $r_1\arcTo r_2$}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
I hope you can help me.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Error in figure caption

Post by CrazyHorse »

mikkelDK wrote: I have a problem with a symbol that I have defined when using it in figure captions (and captions of algorithms as well). It is a 180 degrees rotation of a curvearrowleft from amssymb. This minimal example generates the error:

I hope you can help me.
use ...\protect\arcTo ...

and there is also a \rotatebox{180}{...} instead of a doubled sideways.

Herbert
mikkelDK
Posts: 2
Joined: Sun Nov 28, 2010 4:24 pm

Re: Error in figure caption

Post by mikkelDK »

Thank you!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Error in figure caption

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules. Please keep that in mind for the future so that further reminders will not be necessary.


Best regards and welcome to the board
Thorsten
Post Reply