0

I'm having difficulties arranging my 4 figures in a 2*2 and have them appear on different pages.

This is what it looks like: https://i.stack.imgur.com/rVCYW.jpg

This is the code that I tried (using Overleaf)

\begin{figure}[H]
     \centering
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=1\textwidth]{Images/beginner.png}
         \caption{Beginner}
     \end{subfigure}
     \hfill
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=1\textwidth]{Images/intermediate.png}
         \caption{Intermediate}
     \end{subfigure}
\newline
     \centering
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=1\textwidth]{Images/advanced.png}
         \caption{Advanced}
     \end{subfigure}
     \hfill
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=1\textwidth]{Images/expert.png}
         \caption{Experts}
     \end{subfigure}
        \caption{lorem ipsum}
\end{figure}

If i break it up into two pieces and insert

\end{figure}
\begin{figure}

then the problem is fixed but the captions become (a), (b) (a), (b).

I want the first and second figures to appear on the above page because there is a huge blank.

So like this: https://i.stack.imgur.com/HPM2m.jpg

Zarko
  • 296,517
  • For two pages, you need two figures. You can use \ContinuedFloat from the caption package to make the caption numbers match up. And [ht] will almost always look better than [H]. – John Kormylo Oct 25 '21 at 13:33

1 Answers1

1

To divide the 2x2 subfigures to fill the blank space left at the bottom of a page (because the 2x2 does not fit but a 2x1 will):

(1) Create two figures using [ht!], with a 1x2 subfigures each.

(2) Add \clearpage after the first figure.

(3) Put \addtocounter{subfigure}{2} inside the first subfigure of the second page to continue the subfigures numbering.

(4) Decrease the number of the figure's by 1 since the 4 sub-figures are part of the same figure.

The second figure will go to the top of the second page with the right caption.

c

\documentclass[12pt,a4paper]{article}

\usepackage{graphicx}

\usepackage{subcaption} % subfigures <<<<<<<<<<<<<<<<

\usepackage{kantlipsum}% dummy text for the example

\begin{document}

\kant[1-2]

%make two figures \begin{figure}[ht!] \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=1\textwidth]{example-image-a} \caption{Beginner} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=1\textwidth]{example-image-a} \caption{Intermediate} \end{subfigure} \end{figure}

\clearpage % newpage and clear the floats

\begin{figure}[ht!] \addtocounter{figure}{-1}% added <<<<< \centering \begin{subfigure}[b]{0.45\textwidth} \addtocounter{subfigure}{2} % added <<<<<<<<<<<<<<<<<<<<<< \centering \includegraphics[width=1\textwidth]{example-image-b} \caption{Advanced} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=1\textwidth]{example-image-b} \caption{Experts} \end{subfigure} \caption{lorem ipsum} \end{figure}

\end{document}

Simon Dispa
  • 39,141