[Tex/LaTex] Align two figures vertically with different caption lenghts

captionsfloatsvertical alignment

I have many figures: the sizes are the same, but captions are not.
How can I fix my problem with the different locations of the figure? Maybe there is an easy way to to that, because I have many figures…

The doc is twosided and single column.

The result should look like here (Since the captions have different lengths, I cannot horizontally align the subfigures), but for one page – one figure, without any subfigures.

Thank you.enter image description here

Best Answer

The simplest might be to just wrap the \caption in a minipage of a specific (to be determined) height.

Something like:

 \fbox{\begin{minipage}[t][5cm][t]{1.0\linewidth}
    \caption{This is a short caption}
  \end{minipage}}

I added a \fbox to show the size of this minipage. Of couse the 6cm part has to be adjusted and probably best stored in a length such that we don't have to change 6cm by hand al over the pace (left as an excersize).

Below I've added a MWE showing what this looks like. I've also added how one should redefine \cation to do this automatically. This of course assumes \caption is only used in this contrex, that is no figures that are not full page figures, and no tables.

\documentclass[a4paper]{memoir}
\usepackage{kantlipsum}
\begin{document}

sdf % to get to a LH page

\newpage

% \fbox added to show the size of the caption minipage

\begin{figure}[p]
  \centering
      \rule{0.7\textwidth}{10cm}
      \fbox{\begin{minipage}[t][6cm][t]{1.0\linewidth}
        \caption{\kant*[1]}
      \end{minipage}}
\end{figure}

\clearpage

\begin{figure}[p]
  \centering
  \rule{0.7\textwidth}{10cm}
  \fbox{\begin{minipage}[t][5cm][t]{1.0\linewidth}
    \caption{This is a short caption}
  \end{minipage}}
\end{figure}

\clearpage

% automatic, assumes \caption are only used in constructions like
% above
\let\normalcaption\caption
% this will loose the [] option for \caption
\renewcommand\caption[1]{
  \begin{minipage}[t][5cm][t]{1.0\linewidth}
    % now call the normal caption to make the formatting
    \normalcaption{#1}
  \end{minipage}
}



\begin{figure}[p]
  \centering
  \rule{0.7\textwidth}{10cm}
  \caption{\kant*[1]}
\end{figure}

\clearpage

\begin{figure}[p]
  \centering
  \rule{0.7\textwidth}{10cm}
  \caption{This is a short caption}
\end{figure}
\end{document}

enter image description here