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

draw horizontal rule IF not at top of a new page

37 views
Skip to first unread message

iaw4

unread,
May 25, 2011, 5:09:09 PM5/25/11
to

dear tex wizards---

I want to draw a fat horizontal bar for visual separation between some
unusual parts of my book. (Think end of chapter summary or solutions
to the questions in a chapter.) obviously, visual separation is
useful only if it is in the middle of a page. if I just crossed over
to a new page, having a fat separating line at the top of this page is
not a good thing. is there a way to test for this? somehow,
\vspace{} probably does something like this, too, because it knows to
do nothing if it is at the top of a page.

(it is not a good thing to have a horizontal divider as the last item
on a page either, but this would presumably be easier to fix---I could
issue a \Needspace{} just before drawing the rule. if the rule is
towards the end of a page, this would force the rule to the top of the
next page, where presumably it would then not be draw, if I knew how
to force this elimination.)

is this possible?

if not, \vspace{} will have to be my fallback...

sincerely,

/iaw

Enrico Gregorio

unread,
May 25, 2011, 5:27:32 PM5/25/11
to
iaw4 <ivo...@gmail.com> wrote:

\newcommand{\separation}{%
\par\vskip\medskipamount
\leaders\vrule width \textwidth\vskip 0.4pt
\vskip\medskipamount\nointerlineskip}

By rule, TeX won't break a page at the leaders or at the second
glob of glue. But these three items will vanish at a page break
taken at the first glob of glue.

Ciao
Enrico

0 new messages