[Tex/LaTex] LaTeX: Text/Parbox at bottom of page

spacingvertical alignment

I have a problem similar to this question, but slightly more involved. I need for the parbox in my example to always appear at the bottom of the page, regardless of whether TeX places it on a page by itself or not. (This example is tailored for letterpaper output)

\documentclass{report}

\begin{document}
This text might fit onto one page
\vskip 7.2in %% compare result when set to 7in
but push the following parbox onto the next page.
\par\null\vfill

\parbox{\textwidth}{This parbox should always 
  appear at the bottom of the page.}

\clearpage
More stuff.
\end{document}

This method works as intended as long as the parbox is not flushed to the next page by itself (e.g., try setting the vskip to 7.0in or less). However, if the element preceeding the parbox is perfectly sized, as in the example, then the parbox will appear at the top of the next page instead of at the bottom.

As far as I understand the problem is that I cannot figure out a way to make
sure that the \null\vfill always gets placed on the same page as the parbox, and not just inserted at the bottom of the "full" page. (since the vfill has no minimum height?)

Just to be clear, I do not want to force the parbox appear alone at the bottom of its own page, it should only be alone on the page if the layout requires it.

Best Answer

Here I use \needspace{1\baselineskip}, since your \parbox is one row high. The argument of \needspace should be the needed height of the \parbox that follows.

In the MWE, I show if for your skip value of 6.8, 7.0, 7.2, and 7.4 in. In all cases, the \parbox gets pushed to the page bottom.

\documentclass{report}
\usepackage{needspace}
\begin{document}
This text might fit onto one page
\vskip 6.8in %% compare result when set to 7in
but push the following parbox onto the next page.
\par\needspace{1\baselineskip}%
\null\vfill

\parbox{\textwidth}{This parbox should always 
  appear at the bottom of the page.}

\clearpage
This text might fit onto one page
\vskip 7.0in %% compare result when set to 7in
but push the following parbox onto the next page.
\par\needspace{1\baselineskip}%
\null\vfill

\parbox{\textwidth}{This parbox should always 
  appear at the bottom of the page.}

\clearpage
This text might fit onto one page
\vskip 7.2in %% compare result when set to 7in
but push the following parbox onto the next page.
\par\needspace{1\baselineskip}%
\null\vfill

\parbox{\textwidth}{This parbox should always 
  appear at the bottom of the page.}

\clearpage
This text might fit onto one page
\vskip 7.4in %% compare result when set to 7in
but push the following parbox onto the next page.
\par\needspace{1\baselineskip}%
\null\vfill

\parbox{\textwidth}{This parbox should always 
  appear at the bottom of the page.}

\clearpage
More stuff.
\end{document}
Related Question