3

I'm trying to include a uml diagram, which as it's quite large i'd like to rotate. However, if I try and add a caption I get an error and it won't build.

I'm adding the figure like this:

\usepackage{rotating}
...
\begin{sidewaysfigure}
\centering
\includegraphics[scale=0.6]{clientUML.eps}
\label{fig:clientUML}
\caption{UML for client} 
\end{sidewaysfigure}

And I get this error:

<clientUML.eps>
! Undefined control sequence.
\@tempf ... \@parboxrestore \normalsize \@fs@capt 
                                                  {\@nameuse {fnum@#1}}{\ign...
l.87 \caption{UML for client}

Any ideas? It works if I take the caption line out - but I need to include on.

Thanks in advance.

EDIT:

I also have this in my preamble - I need boxes round my figures:

\usepackage{float}
\floatstyle{boxed} 
\restylefloat{figure}
  • 1
    If I expand your code to a full, but minimal document it works fine for me. Please add a minimal working example (MWE) that shows the described behavior. Most likely you are using a package which interferes somehow. – Martin Scharrer Apr 19 '11 at 14:09
5

Did you use \restylefloat in your preamble? If you omit this command, there will be no error.

Instead of using the rotating and the float package you can simply use the rotfloat package.

\documentclass[a4paper]{report}
\usepackage{rotfloat}
\floatstyle{boxed} 
\restylefloat{figure}
\begin{document}
\begin{sidewaysfigure}
\centering
\includegraphics[scale=0.6]{test.jpg}
\label{fig:clientUML}
\caption{UML for client} 
\end{sidewaysfigure}
\end{document}
  • yes - i've added the lines i'm using - I need boxes round my floats if possible. – Freddie Apr 19 '11 at 14:14
  • @Freddie: I've updated my code. – Thorsten Apr 19 '11 at 14:23
  • great - that's sorted it. Thanks :) – Freddie Apr 19 '11 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.