# Measure distance from text to bottom margin

I'm making some boxes for providing answers. The box macro takes the height of the box as an argument. I need to measure the remaining space from the line the box starts at, to the bottom of the page.

Consider the following MWE. The first box has the length I want, I need to provide the remaining length to the end of the page as an argument to the second box. How may I achieve this?

(Bonus question: why do I get Underfull \hbox (badness 10000) in paragraph error in this MWE?)

\documentclass[]{article}

\begin{document}

\end{document}

• you have \\  at end of paragraph. \\  anywhere is usually wrong. at end of paragraph it is always wrong and will always give you underful boxes. – David Carlisle Dec 8 '14 at 9:28
• @DavidCarlisle Actually, you have \\  at the end of the paragraph. But I see your point ;-) – Holene Dec 8 '14 at 10:01

No box requirements can go without a solution using tcolorbox!

tcolorbox provides height fill option to fill the remaining space in the page.

\documentclass[]{article}
\usepackage[most]{tcolorbox}
\newtcbox{example}[1][]{%
enhanced jigsaw,
colback=white,
colframe=black,
boxrule=1pt,
sharpish corners,
arc=0mm,
boxsep=0mm,
left=\dimexpr\textwidth-2pt\relax,   %% 2pt= 2* boxrule width (1pt)
right=0mm,
%width=\textwidth,
height fill,   %% <---- ths fills the remaining space
#1,
}

%\usepackage{showframe}
\begin{document}

• I get I do not know the key '\tbc\sharpish corners' and ... \tbc\height fill error when I try to compile your example... – Holene Dec 9 '14 at 6:41
• @Holene Please update tcolorbox. – user11232 Dec 9 '14 at 13:01
• Done! How can I get tcolorbox to fill the width of the line? – Holene Dec 11 '14 at 13:20