Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\vskip et the beginning of a page

52 views
Skip to first unread message

Olive

unread,
May 22, 2013, 6:37:57 AM5/22/13
to
In plain TeX as well as LaTeX \vskip has no effect at the beginning of the page. I do not understand what is responsible for that. \vskip is a primitive command, what does it do exactly? I am asking an explanation in order to understand the behaviour of \vskip and/or the concept of glue not a "workaround" to insert space at the beginning of the page.

Olive

zappathustra

unread,
May 22, 2013, 6:56:23 AM5/22/13
to
Olive <diolu.remov...@bigfoot.com> a écrit:
> In plain TeX as well as LaTeX \vskip has no effect at the beginning of the page. I do not understand what is responsible for that. \vskip is a primitive command, what does it do exactly? I am asking an explanation in order to understand the behaviour of \vskip and/or the concept of glue not a "workaround" to insert space at the beginning of the page.

TeX simply discards glues (and other things) at the top of a page.
That’s generally useful, e.g. when the page is broken between two
paragraphs separated by space you generally don’t want that space to
be visible any more; in other words, vertical space make little sense
across pages (of course, there are plenty of situation where this is
not true).

You may read chapter 27 of Victor Eijkhout’s TeX by Topic to get a
better understanding of page breaking in TeX (the book is available on
CTAN or in hardcopy from lulu.com).

Best,
Paul

Olive

unread,
May 22, 2013, 8:29:23 AM5/22/13
to
> You may read chapter 27 of Victor Eijkhout’s TeX by Topic to get a
> better understanding of page breaking in TeX (the book is available on
> CTAN or in hardcopy from lulu.com).

Thank you, good reference!

Olive

Enrico Gregorio

unread,
May 22, 2013, 5:14:57 PM5/22/13
to
The explanations have been given; the workaround is, in Plain TeX,

\vglue <glue specification>

This is interesting in this respect, because it shows how to avoid
that the glue is discarded at the top of a page.

\def\vglue{\afterassignment\vgl@\skip@=}
\def\vgl@{\par \dimen@\prevdepth \hrule height\z@
\nobreak\vskip\skip@ \prevdepth\dimen@}

Thus

\vglue 1cm plus .5cm minus .5cm

becomes

\afterassignment\vgl@\skip@=1cm plus .5cm minus .5cm

The assignment is performed by storing the specification in
the scratch register \skip@; then \vgl@ is expanded. It does \par
(as \vskip impliditly does) and records the \prevdepth (basically,
the depth of the last typeset line) and then typesets a zero
height rule, which is not discardable. The \nobreak prohibits a
break at the following glue and then the \prevdepth parameter
is restored, so to get correct computation of the interline glue.

Ciao
Enrico
0 new messages