# [texhax] determine remaining space

Uwe Lück uwe.lueck at web.de
Thu Sep 8 12:19:39 CEST 2005

At 16:49 07.09.05, Florian Knorn wrote:

>could anybody plz tell me a macro that returns the remaing space in the
>current text line ? like \remainingspace would contain the length like
>"3cm" if the remaining space to the end of the line is 3cm.

I have a really miraculous algorithm for this general problem,
yet the present e-mail is too short to hold it
(cf. Simon Singh, Lueck's Last Algorithm, chap. 2.4 :-)

-- Uwe

p.s.: Place a "marker" phantom box (e.g. with a small random
height); typeset the paragraph in a testing \vbox with same
parameters as in the text, take line by line from the \vbox,
take word by word from each line into a measuring \hbox
-- until you find you find the "marker" box ...