[comp.text] A TeX beginner's question

andy@ecrcvax.UUCP (Andrew Dwelly) (09/11/87)

Keywords:\vskip ????


I recently started using TeX on a Vax running 4.3, and a qms laser printer
for output. There are no other users here at the moment so I am posting 
this question to the net instead.

If I start a new page with a \vskip command, to move a title halfway down
a page, TeX seems to ignore it, and sets the title at the top of the page.

On the other hand if I print something and then \vskip, it works perfectly.

So, \eject
    \vskip 200mm
    Title

fails (eg Title is at the top of the page), but

   \eject
   dummy text
   \vskip 200mm
   Title

seems to work exactly as expected. What am I doing wrong ????.

I am away for a week, and besides I'm sure this is obvious so please mail me
with any answers.

thanks very much
				Andy.

gary@apex.UUCP (Gary Wisniewski) (09/17/87)

In article <430@ecrcvax.UUCP> andy@ecrcvax.UUCP (Andrew Dwelly) writes:
>I recently started using TeX on a Vax running 4.3, and a qms laser printer
>[...]
>If I start a new page with a \vskip command, to move a title halfway down
>a page, TeX seems to ignore it, and sets the title at the top of the page.
>
>On the other hand if I print something and then \vskip, it works perfectly.

You're not missing anything.  \vskip will perform no action if it is
found just after a page break.  If you want blank space at the top of
a page, type:

	\vfil\eject
	\leavevmode\vskip 1in	%skip an inch at the top

 /\   Actually, TeX has a set of tokens called `discardable items'
/ss\  which consist of glue and penalties.  When a page break occurs
\  /  (usually at a penalty) all discardable items are removed, since
 \/   you would not normally want such routine glue items as \parskip
 ||   or \baselineskip glue to appear just after a page break.  The
      \leavevmode control sequence is defined in plain TeX to the
control sequence "\unhbox\voidbox".  The effect is to enter horizontal
mode, insert \parindent glue, and begin setting a paragraph.  The
\vskip immediately after causes a skip because \vskip is an inherently
vertical command---horizontal mode is exited and since we are no longer
at the page break, a skip occurs.

Actually, the best way to set information in the middle of a page is
to use stretchable glue:

	\leavevmode\vfil
	\centerline{\bf Title of the Book}
	\vskip 20pt
	\centerline{\small by Me}
	\vfil\eject

This causes the \vfil glue to consume the same amount.  A favorite
technique of mine is to use infinite glue with a multiplier:

	\leavevmode\vskip 0pt plus 1fil
	\centerline{\bf Title of the Book}
	\vskip 20pt
	\centerline{\small by Me}
	\vskip 0pt plus 2fil\eject

Now, the title will appear about one third down from the top of the
page.  This is because the first \vskip has half the stretchability
of the second.  Think of the first and second \vskips as consuming
(1+2)/3 of the vertical whitespace on the page.  This has the
desirable effect of maintaining the ratio of whitespace even if the
page dimensions are changed.

(Who could resist an occasional dangerous bend?)

Gary Wisniewski
{allegra,bellcore,cadre}!pitt!darth!apex!gary

kuo@skatter.UUCP (Dr. Peter Kuo) (09/19/87)

In article <430@ecrcvax.UUCP>, andy@ecrcvax.UUCP (Andrew Dwelly) writes:
$ 
$ I recently started using TeX on a Vax running 4.3, and a qms laser printer
$ for output. There are no other users here at the moment so I am posting 
$ this question to the net instead.
$ 
$ If I start a new page with a \vskip command, to move a title halfway down
$ a page, TeX seems to ignore it, and sets the title at the top of the page.
$ 
$ On the other hand if I print something and then \vskip, it works perfectly.
$ 
$ So, \eject
$     \vskip 200mm
$     Title
$ 
$ fails (eg Title is at the top of the page), but
$ 
$    \eject
$    dummy text
$    \vskip 200mm
$    Title
$ 
$ seems to work exactly as expected. What am I doing wrong ????.
$ 
$ I am away for a week, and besides I'm sure this is obvious so please mail me
$ with any answers.
$ 
$ thanks very much
$ 				Andy.

I am not sure why, but the way to do it is to use \vglue instead of \vskip.
I think the difference is in the way \vskip and \vglue are defined to TeX.
Actually, think at it now, \vskip would (possibly) mean vertical skip after
the previous material, but at the top of a page, there is NO stuff to skip
from, so to speak. The page is not formed until it is \shipout.
This works fine for me for both VMS and PC TeX's.

... Peter/
-------------------------------------------------------------------------------
Note:    Wednesday mornings (CST) are bad for sending Bitnet mail to me as
	 one of our intermediate local link is not available due to backup.
-------------------------------------------------------------------------------
Peter Kuo                   | Bitnet (VMS)  : KUO@SASK
Accelerator Laboratory      |
(a.k.a. The Beam Warehouse) | uucp   (Unix) : !alberta\
Univ. of Saskatchewan       |                 !ihnp4  -- !sask!skatter!kuo
Saskatoon, Saskatchewan     |                 !utcsri /
CANADA  S7N 0W0             |
(Earth)                     | Ma Bell       : (306) 966-8528

Disclaimer: I don't know what I am saying, I'm only a physicist.
            Don't quote me on anything! I speak only for myself.