bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: heading spacing


From: Stepan Kasal
Subject: Re: heading spacing
Date: Tue, 23 Sep 2003 10:09:25 +0200
User-agent: Mutt/1.2.5.1i

Hello,

thank you, Karl, for resolving the issue of space before and after
the section title.

On Mon, Sep 22, 2003 at 09:42:59AM -0400, Karl Berry wrote:
> As for \nobreaks,

Well, though I love the concept of glues in TeX very much, the
axioms defining where a break can occur can give strange results.
I cannot do anything without my copy of the TeXbook.

Break can occur (in vertical list):
- at a kern, if it's immediately followed by a glue,
- at a glue, if it's preceded by a non-discardable item,
- at a penalty.

Examples:
nobreak, kern, glue .. break can occur at the kern, as it's followed
        by a glue
kern, nobreak, glue .. no chance to break
nobreak, kern, nobreak, glue .. no chance to break, but the first
        nobreak is redundant

Now we get back to your mail:

> 1) it seems we need a \nobreak before the \kern, since that kern is
>    immediately followed by glue.

No, it's not followed by a glue, it's followed by a penalty (nobreak).
So your added nobreak is redundant.  (I suppose it wouldn't help you
much if I created a patch and attached it to this mail.)

> 2) I guess you're right that \nobreak is not needed at the end, although
>    it still seems scary to me.

I understand the feeling.  When someone spends hours looking for the
reason "why TeX breaks here", they start to be scared and irrationally
throw \nobreaks here and there. [*]
But this is no way.  We have to chew the axioms over and over, until
we understand them, though they may seem counterintuitive.

>    I suppose in theory there could be a
>    kern and then glue coming up next (from whatever follows the section
>    heading), but I don't think that ever happens in practice.

A nobreak wouldn't help in this situation.  I suggest:

kern, nobreak, glue,  kern, glue  ... a break can occur at the second kern

You suggest:

kern, nobreak, glue, nobreak,  kern, glue
    ... a break can still occur at the second kern, as it's immediately
        followed by a glue

[*] A note:
Such an irrational behaviour often doesn't help:
        \nobreak\sectiontitle
doesn't help if \sectiontitle contains a penalty < 10000.
It can even give opposite results then what the author meant
sometimes:
        X\kern1pt Y    is not breakable,
while
        X\nobreak\kern 1pt Y    can be broken at the kern.

Have a nice day,
        Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]