LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Frank Mittelbach <[log in to unmask]>
Thu, 22 Sep 2011 23:37:26 +0200
text/plain (89 lines)
Am 22.09.2011 21:25, schrieb Joseph Wright:

>> In TeX the display counts as 3 lines (regardless of the number of real
>> lines it would occupy in a grid system).
> We should document that as part of the galley: I didn't know that :-)
>>> The
>>> \clubpenalty =>   \clubpenalties is easy to understand, as both are
>>> related to the start of a paragraph.
>> not quite \clubpenalties refer to the beginning of every partial
>> paragraph. However \clubpenalty only refers to the penalty after the
>> first line of a paragraph.
> The interesting thing is that this is not the case. While I can't find
> it in The TeXbook or TeX by Topic, using \tracingall shows that, as the
> e-TeX manual says, \clubpenalty applies to each _partial_ paragraph. For
> example, try

looks like a typical lie from the TeX book (as Don said somewhere in the 
book he does that sometimes). I just checked the code, it is indeed 
apply at each start of a partial paragraph, but widowpenalty is applied 
only to the very end; in front of a display \displaywidowpenalty is used 

> So e-TeX\d generalisation is correct, its more that it's somewhat
> different to the one I expected :-)

yes looks like it.

>> Point is when I want to have at least 3 lines after a heading I should set
>> <heading>
>> \interlinepenalties = 3 10000 10000 1000
>> <first para>
>> \interlinepenalties = 0
>> now if that para contains a display I still get only 3 lines fixed to
>> the heading.

of course my example above is wrong first of all I missed out one 0 but 
more importantly the last value is repeated so you have to write instead

\interlinepenalties = 4 10000 10000 10000 0

if you want to achieve what I claimed

> What it seems is needed is an interface that makes sense, i.e. which
> separates out:
>    1) The general interline penalty
>    2) The penalty for lines(s) at the start of the paragraph as a whole
>    3) The penalty for lines(s) at the end of the paragraph as a whole
>    4) The penalty for line(s) before display math
>    5) The penalty for line(s) after display math
>    6) Additional penalties between arbitrary lines
> or some such structure. This will require a bit of thought, as it means
> synchronising the various primitives in an ordered way.


> One additional note from my experiments is that \interlinepenalties is
> reset by \par, in the same way \parshape is. I can't see this mentioned
> anywhere. In contrast, neither \interlinepenalty nor \clubpenalties are!
> Quite surprising.

looks like an oversight in the e-TeX manual. But it does make a lot of 
sense to do this (actually very nice because that means you don't have 
to bother about resetting).

As i said the main use case was preventing pagebreaks for a while 
(couple of lines) after something like a heading, so essentially a 
onetime operation, while culb and widow penaltis are intended for the 
general visual behavior of (i like always at least 1 or tw lines of a 
paragraph on a page if possible) so that this is typically a setting 
that you want to generally apply.

however that is inconsistent with \interlinepenalty which stays the way 
it is forever.