Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a latex document, which works fine but when ever I try to add in an image with a figure caption it gives me an error saying there are to many }'s.

\begin{figure}[h!]
  \caption{A picture of a gull.}

  \includegraphics[width=0.5\textwidth]{uml-usecase/overview.png}
\end{figure}

My current packages are:

\usepackage{amsfonts}
\usepackage{amssymb,amsmath}
\usepackage{amsthm}

\usepackage{newlfont}
%\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{rotating}

\usepackage{latexsym}
\usepackage{natbib}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{xthesis}
\usepackage{xtocinc} %Include Table of Contents as the first entry in TOC
\usepackage{subfigure}
\usepackage{times}

\usepackage{hyperref}
\usepackage{xcolor}
\usepackage[dvips]{graphicx}
\bibpunct[, ]{(}{)}{;}{a}{,}{,}

As far as I can see it's right, can anyone figure out where I am going wrong?

share|improve this question
1  
None of the fragments shown here causes this. Its a simple syntax error like {}}. What about a minimal example of a complete document shows the error? –  Meinersbur May 1 '10 at 12:57
    
Migrate to tex.se? –  Phonon Aug 30 '11 at 17:03
2  
@Phonon: No, don't migrate old questions. Even less if they are already solved. –  Paŭlo Ebermann Aug 30 '11 at 18:38
    
+1 for asking the question. It really help me in figuring out the error in my thesis writing. –  Aditya Kumar Jul 3 '12 at 18:30
add comment

migrated from stackoverflow.com Aug 31 '11 at 4:30

This question came from our site for professional and enthusiast programmers.

closed as too localized by lockstep, egreg, Joseph Wright Sep 3 '11 at 21:38

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Most probably it is the package xthesis that contains some pieces of code to redefine \@xfloat in a bad way. It seems that many university's thesis templates contain such a definition from a file named doublespace.sty. The solution is to (re)define \@xfloat in a "good" way, for example: a work around here

share|improve this answer
add comment

The solution to this problem was the package "rotation" when removed, allowed the figure caption to work.

Thanks for all the help!

share|improve this answer
4  
Because rotation loads graphicx if not loaded yet. You can also put \usepackage[dvips]{graphicx} before \usepackage{rotation}. But what has this to do with "too many }'s"??? –  Meinersbur May 1 '10 at 13:34
    
It could be a LaTeX bug. I see no reason for a downvote. –  Phonon Aug 30 '11 at 17:05
add comment