1

I have a 4 by 3 set of figures which I want to combine into a single figure. However, when I used the following set of codes, it gives me three set of figures (Figure 1, Figure 2 and Figure 3), instead of Figure 1a, Figure 1b and Figure 1c with an overall Figure 1 caption. Any help would be appreciated.

\documentclass[12pt]{article}

\usepackage{rotating}
\usepackage{subfigure}

\begin{document}

\begin{sidewaysfigure}
\centering
\subfigure[$y=1$]{\includegraphics[width=4cm]{11.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{12.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{13.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{14.png}}
\caption{Figure 1a}
\subfigure[$y=1$]{\includegraphics[width=4cm]{21.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{22.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{23.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{24.png}}
\caption{Figure 1b}
\subfigure[$y=1$]{\includegraphics[width=4cm]{31.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{32.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{33.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{34.png}}
\caption{Figure 1c}
\end{sidewaysfigure}

\end{document}
2
  • 1
    Welcome to TeX.SE. The subfigure package is outdated. Use subfig or subcaption instead.
    – user31729
    Mar 28, 2018 at 6:50
  • Currently you effectively have 3 figures with 4 subfigures each. Do you want to introduce a subsubfigure level? Mar 28, 2018 at 13:53

1 Answer 1

1

Fortunately, \thefigure can be set to almost anything.

\documentclass[12pt]{article}

\usepackage{rotating}
\usepackage{subfigure}

\begin{document}
\listoffigures

\begin{sidewaysfigure}
\centering
\subfigure[$y=1$]{\includegraphics[width=4cm]{11.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{12.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{13.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{14.png}}
\renewcommand{\thefigure}{1a}
\caption{Figure 1a}
\subfigure[$y=1$]{\includegraphics[width=4cm]{21.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{22.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{23.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{24.png}}
\renewcommand{\thefigure}{1b}
\caption{Figure 1b}
\subfigure[$y=1$]{\includegraphics[width=4cm]{31.png}}
\subfigure[$y=2$]{\includegraphics[width=4cm]{32.png}}
\subfigure[$y=3$]{\includegraphics[width=4cm]{33.png}}
\subfigure[$y=4$]{\includegraphics[width=4cm]{34.png}}
\renewcommand{\thefigure}{1c}
\caption{Figure 1c}
\addtocounter{figure}{-2}% \thefigure will be restored automatically
\end{sidewaysfigure}

\end{document}

This version creates a separate subsubfigure environment.

\documentclass[12pt]{article}

\usepackage{rotating}
\usepackage{subcaption}
\DeclareCaptionSubType{subfigure}
\captionsetup[subfigure]{labelformat=simple,labelsep=colon}
\captionsetup[subsubfigure]{labelformat=parens,labelsep=space}
\renewcommand{\thesubfigure}{\figurename~\thefigure\alph{subfigure}}
\renewcommand{\thesubsubfigure}{\roman{subsubfigure}}
\AtBeginDocument{% trial and error
  \let\oldsubsubfigure=\subsubfigure
  \renewcommand{\subsubfigure}{\expandafter\def\csname @captype\endcsname{subfigure}%
    \oldsubsubfigure}%
}

\begin{document}
\listoffigures

\begin{sidewaysfigure}
\begin{subfigure}{\linewidth}
  \centering
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{11.png}
    \caption{$y=1$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{12.png}
    \caption{$y=2$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{13.png}
    \caption{$y=3$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{14.png}
    \caption{$y=4$}
  \end{subsubfigure}
  \caption{Figure 1a}
\end{subfigure}
\begin{subfigure}{\linewidth}
  \centering
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{21.png}
    \caption{$y=1$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{22.png}
    \caption{$y=2$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{23.png}
    \caption{$y=3$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{24.png}
    \caption{$y=4$}
  \end{subsubfigure}
  \caption{Figure 1a}
\end{subfigure}
\begin{subfigure}{\linewidth}
  \centering
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{31.png}
    \caption{$y=1$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{32.png}
    \caption{$y=2$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{33.png}
    \caption{$y=3$}
  \end{subsubfigure}%
  \begin{subsubfigure}{4cm}
    \includegraphics[width=4cm]{34.png}
    \caption{$y=4$}
  \end{subsubfigure}
  \caption{Figure 1a}
\end{subfigure}
\caption{main caption}
\end{sidewaysfigure}

\end{document}
2
  • Many thanks. This works nicely. I wonder if it is possible to have an overall caption in addition to the sub-captions.
    – Al Leong
    Apr 3, 2018 at 3:37
  • \renewcommant{\thefigure}{1}, add another caption and decrement the figure counter again. This is all a giant fudge. Apr 3, 2018 at 3:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .