In my memoir LuaLaTeX document, I have two figure floats that fit together on a single page if there is no other text.
\begin{figure}\centering%
\includegraphics{fig_a.png}%
\caption{My caption}%
\label{fig:fig-a}%
\end{figure}%
\begin{figure}\centering%
\includegraphics{fig_b.png}%
\caption{My caption}%
\label{fig:fig-b}%
\end{figure}%
For pedagogical reason, I'd like these two appear on the same page. Sometimes they do, but only if I'm lucky with LaTeX's decisions. Is there any way I can force these figures to appear on the same page, without messing up other parts of the typesetting?
I can't make them subfigures, as they are too different semantically.
I tried simply putting them in the same figure environment:
\begin{figure}\centering%
\includegraphics{fig_a.png}%
\caption{My caption}%
\label{fig:fig-a}
\includegraphics{fig_b.png}%
\caption{My caption}%
\label{fig:fig-b}%
\end{figure}%
And this appears to work, except that there is too little vertical spacing between the figures, compared to what LaTeX would have produced by itself. I'm also worried about subverting the figure environment to have two figures in it, would that have any other unintended consequences?
\vspace{..}after the first caption – David Carlisle Jan 06 '24 at 12:09[p]option in the two floats. Even in there are some text within, they will stay together as long you avoid this option in the previous floats. – Fran Jan 06 '24 at 19:00