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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.