[Tex/LaTex] Length of \vfill


Is there a way to get the size of \vfill? I want to do some math with the spacing, and I already tried to do:


I got an error.

Any sugestions?

Best Answer

\vfill is infinite glue. The amount is not a fixed value, but a "rubber length" that can span from 0pt to "infinity". Its real length is known, when TeX constructs its parental vertical box. Experts can inspect the box and determine the exact settings that TeX has chosen. However, there is also an easier way. Many TeX compilers support a feature that tells the position: pdfTeX (the inventor of the feature) in both modes PDF and DVI, XeTeX, LuaTeX). The position is known at the time, when the page is shipped out. Module savepos of package zref provides a wrapper that deals with the internals. It records the positions in the auxiliary file (.aux) as references and makes them available in the next LaTeX run.



\section{Hello World}

Vertical space on the previous page
between the lines: \posdiff{top}{bottom}

For the experts that want to debug TeX boxes:

  • \showbox expects a box handle and shows the box with its node contents in the .log file.
  • \showlists without parameters displays the current vertical main list.
  • \showboxbreadth and \showboxdepth are integer registers that control how much of the box contents is shown (boxes can be very huge). Their default values are -1 in LaTeX that suppresses the output.
  • The output is printed in the .log file only unless \tracingonline (also an integer register) is set to a positive value.