[texhax] question about \vfil

Matej Košík kosik at fiit.stuba.sk
Mon Oct 10 00:11:58 CEST 2005


Robin Fairbairns wrote:
>>Could somebody please explain me why this:
>>
>>	\vfil abc\vfil\bye
>>
>>doesn't have the same effect as this:
>>
>>	\vbox to \vsize {
>>	        \vfil
>>        	abc
>>	        \vfil
>>	}
>>	\bye
> 
> 
> for two reasons.
> 
> 1. \vfil is discardable at the top of a page (just like space is
>    discardable at the start of a line), so your first example doesn't
>    even see the first \vfil
> 2. \bye contains \vfill, so even if you manage to get the first \vfil
>    noticed, it's overwhelmed by the "greater infinity" of \vfill
> 
> 
>>The former one is simpler and thus nicer. But there \vfil-s seem to be
>>ignored. I do not understand why because as far as my humble knowledge,
>>TeX starts to process the input in vertical mode. So the initial \vfil
>>shouldn't be ignored.
>>
>>I would really appreciate some explanation or some link to a relevant
>>information. I do not understand the horizontal/vertical mode stuff very
>>well.
> 
> 
> it's all described in the texbook, and no doubt also in tex by topic
> (google for it -- it's a good "free"[*] book).
> 
> correct the two errors i mentioned, and you have
> 
> \vbox{}\vfill abc\vfill\bye
> 
> but now "abc" is 33% of the way down the page: tex has added up the
> \vfill's and apportioned space appropriately.  the second \vfill above
> isn't needed:
> 
> \vbox{}\vfill abc\bye
> 
> (your \vbox to\vsize works because it's not a page, even though it's
> the same size as one.)
> 
> [*] as in, if you can, you're invited to send a donation to the author
> 

Thank you (Robin & Oleg) for your help.

So there were (at least) three mistakes (stemming out from my
ignorance). Now these things seem to me completely clear.
-- 
Matej Košík



More information about the texhax mailing list