0

In a document comprising an image, then a section header, then another image:

\documentclass{article}
\usepackage{graphicx}
\parindent=0pt
\begin{document}

\includegraphics[height=???]{foo.png}

\section{Boo}

\includegraphics[height=???]{foo.png}

\end{document}

How to compute image heights such that they're equally high, and together take the vertical space that the section header doesn't occupy?

enter image description here

Assigning the section header to a box adds or removes vertical space in ways I don't understand, and measuring the box height is therefore not accurate:

\documentclass{article}
\usepackage{graphicx}
\parindent=0pt
\begin{document}

\setbox0=\vbox{\section{Boo}}

\includegraphics[height=\dimexpr(\textheight-\ht0)/2\relax]{foo.png}

\box0

\includegraphics[height=\dimexpr(\textheight-\ht0)/2\relax]{foo.png} \end{document}

Since \vfill knows how to fill space, is there a analogous way for an image to do so too? I know we can't measure a \vfill, but could there be another way to measure the free height between two elements?

0 Answers0