7

I have a multi-page document that has many small sections split with \hrule lines. Occasionally a section will end immediately before a page break, and so the next section will begin right at the top of the next page. The \hrule above the new section on the new empty page then ends up looking silly.

Is it possible to define a macro like \hruleButOnlyIfNotAtTopOfPage?

Note that I'm using Plain TeX.

1 Answer 1

9

leaders are your friend:

enter image description here

\vsize=4cm

\def\r{\par\smallskip\leaders\hrule\vskip.4pt\smallskip}
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r
aaaa
\r

\bye

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .