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.

LaTeX sometimes does some tricks to fill lines to the end, to fill pages up to the bottom and to prevent pages only containing a single line of text. When I create some tikzpictures there are sometimes sizes which could be variable to aid LaTeX in filling up pages. For example some variable width to fill exactly the textwidth or some variable height to fill the page to the bottom or to prevent a single line from beeing pushed to the otherwise empty next page.

Is it possible to declare such variable sizes and if yes how?

share|improve this question
I think you're looking for \vfill and \hfill. –  recluze Nov 20 '12 at 13:39
This is not easy and would almost certainly require two passes. The point is that by the time TeX starts juggling spaces a TikZ picture is a sealed box and TeX can't unbox it and reconfigure the sizes (at least, not without considerable work). One could try breaking up a diagram into pieces that are only loosely interconnected, but how successful that is would depend a lot on the picture. –  Loop Space Nov 20 '12 at 14:28
Have a look at the linegoal package. It provides a length register \linegoal that contains the remaining space of the current line (requires to pdflatex runs). –  Daniel Feb 18 '13 at 18:45
@JosephWright These days I unfortunately do not have as much time for TeX-SX as I used to. Any comments of mine that should be converted to answers are fair game for others to do so. –  Loop Space Sep 9 at 21:14

Your Answer


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

Browse other questions tagged or ask your own question.