35

I have a LaTeX file with packages

\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}
\usepackage{tikz,graphics,color,fullpage,float,epsf,caption,subcaption}

and I use the subfigure environment:

\begin{figure}
\begin{subfigure}{1\textwidth}
...
\end{subfigure}

\vspace{5mm}

\begin{subfigure}{1\textwidth}
...
\end{subfigure}

\end{figure}

This compiles perfectly fine on my machine. However, when I submit the LaTeX file to a journal and looks at the PDF output, it shows an error

! LaTeX Error: Environment subfigure undefined.

I'm really lost on how to fix this, since as I said, it works fine on my machine. What should I do?

EDIT: I'm using the document class

\documentclass[smallextended]{svjour3}

This site seems to have some information on the document class if necessary: http://www.e-publications.org/springer/support/spr-chicago.html

3
  • 3
    What document class are you using? Note also that hyperref should be loaded later than all those packages and that epsf should not be loaded.
    – egreg
    Sep 13 '14 at 17:42
  • 1
    to add to egreg's comment, since graphicx loads graphics, the latter is also unnecessary. Sep 13 '14 at 21:02
  • tikz loads an enhanced version of color so color is not needed either.
    – cfr
    Sep 13 '14 at 23:08
12
+50

I would suggest a work-around, if all else fails, as it is difficult to test this without going through the submission process yourself. In that regard, avoid using the subfigure environment altogether, and default to using a tabular structure for arranging your subfigures. While this comes with manual numbering of subfigures, it's not that difficult to maintain references manually.

Here's a minimal example that should show you the implementation:

enter image description here

\documentclass[smallextended]{svjour3}
\usepackage{lipsum}% Just for this example
\usepackage{graphicx}
\begin{document}

See Figure~\ref{fig:myfig}(a) or~(b). \lipsum[1]

\begin{figure}
  \centering
  \begin{tabular}{@{}c@{}}
    \includegraphics[width=.7\linewidth,height=75pt]{example-image-a} \\[\abovecaptionskip]
    \small (a) An image
  \end{tabular}

  \vspace{\floatsep}

  \begin{tabular}{@{}c@{}}
    \includegraphics[width=.6\linewidth,height=100pt]{example-image-b} \\[\abovecaptionskip]
    \small (b) Another image
  \end{tabular}

  \caption{This is a figure caption}\label{fig:myfig}
\end{figure}

\lipsum[2]

\end{document}
0
30

or you can try:

\usepackage{subcaption}
\captionsetup{compatibility=false}
1
  • So weird that this works, but \usepackage{subfig} doesn't. Oh well.
    – axolotl
    Oct 7 '20 at 2:49

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.