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}
\newcommand\mybox[1]{\vrule\leaders\vbox{\offinterlineskip\hrule width.1pt\vskip#1\hrule\kern-\dp\strutbox\hrule width0pt depth\dp\strutbox}\hfill\vrule\mbox{\vspace*{2em}}\\}
\begin{document}
Please provide the answer in the box below \par\mybox{1in}
Please provide the answer in the box below \par\mybox{4in}
\end{document}
\\
at end of paragraph.\\
anywhere is usually wrong. at end of paragraph it is always wrong and will always give you underful boxes.\\
at the end of the paragraph. But I see your point ;-)