[Tex/LaTex] Streched vertical space between two subfigures

spacingsubfloatsvertical alignment

I want to add vertical space between two subfigures so that so that the upper figure is aligned with the top of the page and the last line of this figure caption is aligned with the
bottom of the page. My approach is the following one, but without success:

  \begin{figure}[p]
  %
  \centering
  \subfloat[]{\includegraphics[width=5cm]{Lenna.png}}\\
  \vfill
  \subfloat[]{\includegraphics[width=5cm]{Lenna.png}}
  %
  \caption{Vertical filling space (between the two subfigures) should
    be added so that the upper figure is aligned with the top of the
    page and the last line of this figure caption is aligned with the
    bottom of the page.} 
  %
\end{figure}

enter image description here

Best Answer

Below I present two possibilities; in the first one, the object is treated as a floating object; in the second one, the object is static.

One option using a minipage inside the figure environment; the minipage has fixed height equal to \textheight; the object is treated as a float:

\documentclass{article}
\usepackage{showframe}
\usepackage{subfig}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[p]
\begin{minipage}[c][\textheight][c]{\textwidth}
  \centering
  \subfloat[]{\includegraphics[width=5cm]{Lenna.png}}

  \vfill

  \subfloat[]{\includegraphics[width=5cm]{Lenna.png}}

  \caption{Vertical filling space (between the two subfigures) should
    be added so that the upper figure is aligned with the top of the
    page and the last line of this figure caption is aligned with the
    bottom of the page.}
\end{minipage}     
\end{figure}

\end{document}

enter image description here

One option using a minipage and \captionof; the minipage has fixed height equal to \textheight; the object is static:

\documentclass{article}
\usepackage{showframe}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\captionsetup[subfigure]{labelformat=parens,font=footnotesize}
\captionsetup[figure]{labelformat=simple,font=normalsize}

\begin{document}

\noindent\begin{minipage}[c][\textheight][c]{\textwidth}
  \centering
  \includegraphics[width=5cm]{Lenna.png}
  \captionof{subfigure}{}

  \vfill

  \includegraphics[width=5cm]{Lenna.png}
  \captionof{subfigure}{}

  \captionof{figure}{Vertical filling space (between the two subfigures) should
    be added so that the upper figure is aligned with the top of the
    page and the last line of this figure caption is aligned with the
    bottom of the page.} 
\end{minipage}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.