0

using TeXShop in OS X Maverick, a simple subfigure script is returning "undefined control sequence". Although I can bypass it and still generate the image-included pdf by typing "s" to "ignore all" (of the warnings), I would still like to know the cause and fix for this. Thanks!

The sample script is:

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htdp]
  \begin{center}
    \subfigure{\includegraphics[width=0.3\textwidth]{fig1}}
    \subfigure{\includegraphics[width=0.3\textwidth]{fig2}}
\end{center}
\end{figure}

\end{document}
  • 1
    You need to add \usepackage{subfigure} to the preamble. Notice, however, that this package is obsolete; you should use subfig or subcaption instead and change to the syntax for those packages. – Gonzalo Medina Jul 16 '14 at 03:45
  • Fixed it with the preamble! Thanks! Can you give a quick example of the new syntax? – neither-nor Jul 16 '14 at 03:47
  • 1
    Refer to the documentation for the packages. Also, there are plenty of examples in the site of the syntax for both packages. – Gonzalo Medina Jul 16 '14 at 03:55
  • For an example with subcaption, see the first code in http://tex.stackexchange.com/a/37597/3954. – Gonzalo Medina Jul 16 '14 at 03:58

0 Answers0