5

Since it is impossible to use \vfill inside a framebox, is there any way of getting the current height position of text? I want to fill in a framebox so that it uses all the space left on a page, instead of trial and error...

1 Answers1

1

Is there any way of getting the current height position of text?

If this were your only question, then you have the answer in Aditya's \measurepage in How to define a figure size so that it consumes the rest of a page?

I don't consider your question as duplicate though since it is specific to using \framebox which cannot take a macro directly as height using \framebox(<width>,<height>){<>} syntax. A possibility using Aditya's \measurepage macro is to use \parbox as in the MWE below.

\documentclass[]{article}
\usepackage[showframe]{geometry}
\usepackage{lipsum}

\newcommand\measurepage{\dimexpr\pagegoal-\pagetotal-\baselineskip\relax} \newcommand{\MyFrameBox}[1]{% {\addtolength{\linewidth}{%-\marginparsep -9.5pt} \noindent \framebox{ \parbox[t][\measurepage]{\linewidth}{ #1 }}}} \begin{document} \lipsum[1-2]

\MyFrameBox{\lipsum[1]} % %Here is the next text \end{document}

The showframe option of the geometry was just used here so that you can see where the text ends.

hpesoj626
  • 17,282