1

For my thesis I want to have two figures placed beside each other, where each figure consists of five subfigures that need to be displayed beneath each other. I managed to do this using a combination of the packages subfig, caption and float. However, now the two figures fill an entire page, and therefore the placement of the figures makes no sense. Also, I don't need all the sufigures to be on one page, however I do want to keep the two different figures, with each its own subfigures.

When using different figure environments with \ContinuedFloat the naming of the subfigures of the different figures is messed up.

Part of my code now:

\documentclass{article}

\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{float}

\begin{document}
\begin{figure}[H]
    \begin{minipage}{0.45\textwidth}
        \noindent\subfloat[1a]{\includegraphics[height=3cm]{image1}}
        \hfill
        \subfloat[1b]{\includegraphics[height=3cm]{this008}}    
        \hfill
        \subfloat[1c]{\includegraphics[height=3cm]{this009}}
        \hfill
        \subfloat[1d]{\includegraphics[height=3cm]{this010}}
        \hfill
        \subfloat[1d]{\includegraphics[height=3cm]{this011}}
        \caption{Caption figure 1}
    \end{minipage}
    \hfill
    \begin{minipage}{0.45\textwidth}
        \noindent\subfloat[2a]{\includegraphics[height=3cm]{d3plot001}}
        \hfill
        \subfloat[2b]{\includegraphics[height=3cm]{d3plot003}}  
        \hfill
        \subfloat[2c]{\includegraphics[height=3cm]{d3plot004}}
        \hfill
        \subfloat[2d]{\includegraphics[height=3cm]{d3plot005}}
        \hfill
        \subfloat[2e]{\includegraphics[height=3cm]{d3plot006}}  
        \caption{Caption figure 2}
    \end{minipage}
\end{figure}
\end{document}

Which produces what I want but it cannot span over multiple pages. I want to have:

 1a          2a
 1b          2b
-pagebreak-
 1c          2c
 1d          2d
 1e          2e
 caption 1   caption 2
0

This solution uses a longtable to create a multipage figure. The entry to the list of figures is written separately at the start.

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{longtable}

\newcommand{\listcaption}[1]{\addcontentsline{lof}{figure}%
  {\protect\numberline{\thefigure}{\ignorespaces#1}}}%

\newsavebox{\boxA}
\newsavebox{\boxB}

\begin{document}
\listoffigures
\newpage

\savebox{\boxA}{\begin{minipage}{0.45\textwidth}
  \captionof{figure}[]{Caption figure 1}
\end{minipage}}% increments figure counter on creation only
\listcaption{Caption figure 1}% write to listoffigures
%
\savebox{\boxB}{\begin{minipage}{0.45\textwidth}
  \captionof{figure}[]{Caption figure 2}
\end{minipage}}%
\listcaption{Caption figure 2}% write to listoffigures
%
\begin{longtable}{cc}
  \endhead
  \usebox{\boxA} & \usebox{\boxB} \\
  \endfoot
  \includegraphics[height=3cm]{image1} & \includegraphics[height=3cm]{d3plot001} \\
  \nopagebreak 1a & 2a \\[\abovecaptionskip]
  \includegraphics[height=3cm]{this008} & \includegraphics[height=3cm]{d3plot003} \\
  \nopagebreak 1b & 2b \\[\abovecaptionskip]
  \includegraphics[height=3cm]{this009} & \includegraphics[height=3cm]{d3plot004} \\
  \nopagebreak 1c & 2c \\[\abovecaptionskip]
  \includegraphics[height=3cm]{this010} & \includegraphics[height=3cm]{d3plot005} \\
  \nopagebreak 1d & 2d \\[\abovecaptionskip]
  \includegraphics[height=3cm]{this011} & \includegraphics[height=3cm]{d3plot006} \\
  \nopagebreak 1e & 2e \\[\abovecaptionskip]
\end{longtable}
\end{document}
| improve this answer | |
  • I think this is a neat way to solve my problem. However, it is indeed undesirable to have the entries in the list of figures, but I am guessing you don't know any way around this? – Miriam Mar 17 '17 at 14:34
  • Actually, I know several. I assume you would like to use the first page instead of the last page. – John Kormylo Mar 17 '17 at 23:01
  • Yes I think that would be the best way to go – Miriam Mar 20 '17 at 9:12
1

Not nice, but with some manipulation of the figure and the subfigure counter it seems to work:

\documentclass{article}

\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage{caption}

\begin{document}
  \begin{figure}
    \begin{minipage}{0.45\textwidth}
        \noindent\subfloat[1a]{\includegraphics[height=3cm]{image1}}
        \hfill
        \subfloat[1b]{\includegraphics[height=3cm]{this008}}    
        \caption{Caption figure 1}
    \end{minipage}
    \hfill
    \begin{minipage}{0.45\textwidth}
        \noindent\subfloat[2a]{\includegraphics[height=3cm]{d3plot001}}
        \hfill
        \subfloat[2b]{\includegraphics[height=3cm]{d3plot003}}  
        \caption{Caption figure 2}
    \end{minipage}
  \end{figure}

  \begin{figure}
    \addtocounter{figure}{-1}%
    \begin{minipage}{0.45\textwidth}
        \ContinuedFloat
        \noindent
        \subfloat[1c]{\includegraphics[height=3cm]{this009}}
        \hfill
        \subfloat[1d]{\includegraphics[height=3cm]{this010}}
        \hfill
        \subfloat[1e]{\includegraphics[height=3cm]{this011}}
        \caption{Caption figure 1}
        \addtocounter{subfigure}{-3}%
    \end{minipage}
    \hfill
    \begin{minipage}{0.45\textwidth}
        \noindent
        \subfloat[2c]{\includegraphics[height=3cm]{d3plot004}}
        \hfill
        \subfloat[2d]{\includegraphics[height=3cm]{d3plot005}}
        \hfill
        \subfloat[2e]{\includegraphics[height=3cm]{d3plot006}}  
        \caption{Caption figure 2}
    \end{minipage}
\end{figure}

\end{document}

enter image description here

| improve this answer | |

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.