Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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...

share|improve this question
    
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). –  Claudio Fiandrino Dec 27 '12 at 11:12
    
Also, you can use backticks ` to mark your inline code. –  Torbjørn T. Dec 27 '12 at 11:13
    
possible duplicate of How to compute the remaining space on the current page –  Stephen Dec 27 '12 at 18:36
    
Check out [tex.stackexchange.com/a/17813/22413]. –  A.Ellett Dec 27 '12 at 20:43
    

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.