[texhax] Add space and separator except at top of page in LaTeX

Philip TAYLOR (Ret'd) P.Taylor at Rhul.Ac.Uk
Sat Nov 29 19:54:59 CET 2008


If it were /just/ vertical white space, TeX would
do what you want automatically; however, you not
only want to lose VWSP at top of page but a
horizontal rule as well.  The key lies in what
exactly TeX is defined to jettison at top of page,
and the answer "discardable items" (pp.~110--112),
which include glue, kerns and penalty items.

Now there's no way you can convert a rule into
a kern or a penalty item, but you /can/ convert
it into a special sort of glue called "leaders".
So if you write (for example)

	\leaders \hrule \vskip 0,4pt

your rule will be concealed inside leaders, and
therefore become discardable.

Whether this will work out of the box with LaTeX,
I cannot say, but others more experienced with
LaTeX should be able to advise.

Philip TAYLOR
--------

Ryan Hinton wrote:

> Can I detect in a macro when I am at the top of a page to avoid adding 
> boxes (vertical space and horizontal rule)?
> 
> I am using LaTeX to write my homework solutions.  For clarity, I add 
> some vertical space and a horizontal rule to visually separate the 
> problems.  But I do not need this visual separation if a new problem 
> starts at the top of a page, so I would like to omit it to save space 
> and minimize confusion.


More information about the texhax mailing list