My Problem: I would like to have all images in my Latex document beeing well sized in height and width. Precisly I want, that protrait and landscape images get a predefined size in the document. I got this by this style:

    \ifthenelse{\lengthtest{\widthW > \heightH}}{

The second thing is, I want to use this in a \subfigure because I have a lot of images which have to be side by side.

The problem is, everything works great, but as soon as I try to centering this images I got:

! LaTeX Error: Something's wrong--perhaps a missing \item.

Thats my code:

\subfigure[comment]{\includegraphicsJustified{images/img1.png}  }
\subfigure[comment]{\includegraphicsJustified{images/img2.png}  }
\caption{whole comment}

Note again: without the \centering command it works.

I tried to add this to my style, to automaticly center all figure elements:

\def\figure{\@ifnextchar[\figure@i \figure@ii}

This works great, but not when I use the \subfigure:

! LaTeX Error: Something's wrong--perhaps a missing \item.

Without the \subfigure I can use my \includegraphicsJustified{} command and it get centered. Note also: When I use the subfigure with a normal \includegraphics{} it works!

Is there anybody out there who could explain this or much better can distribute a solution?

  • What package are you using that supports \subfigure, subfigure? This has been replaced by subfig that provides \subfloat.
    – Werner
    Oct 1, 2012 at 3:29
  • Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Oct 2, 2012 at 6:10

1 Answer 1


Try putting the subfigure inside a minipage, see below,

\subfigure[comment]{\includegraphicsJustified{images/img1.png} }
\subfigure[comment]{\includegraphicsJustified{images/img2.png} }
\caption{whole comment}

I firmly believe that you can carry out the rest of the fine tuning.

For further details, please see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=errmissitem.

Hope this helps.

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.