Print

Print


On Wed, 21 Sep 2011, Lars Hellstr?m wrote:

    Joseph Wright skrev 2011-09-21 14.03:
    > Hello all,
    > 
    > I am currently working on some galley-related code, and looking at the
    > e-TeX extensions to Knuth's paragraph-breaking penalty system. The roles
    > of \clubpenalties, \widowpenalties and \displaywidowpenalties are clear,
    > and it seems reasonable to provide a documented interface to these
    > primitives. On the other hand, \interlinepenalties

    (None of these are e-TeX extensions, AFAICT.)

if you mean *explicitly* the plurals, then
these must be e-tex; i'm not familiar with
the plural forms.  the singular forms are
all tex primitives.

    > seems to be very
    > difficult both to explain and to see a real case for use. Does anyone
    > have experience in using \interlinepenalties, and if so can then suggest
    > a good example where it works to solve a real-life problem.

    I don't have experience of using it (at least as far as I recall), but
    rereading now the TeXbook description of it, I realise there are a couple of
    cases where I could well have had reason to use it. Imagine a situation
    where you have a long list (typically not in the \begin{list}...\end{list}
    sense) of items -- e.g. lines of source code -- which usually fit on one
    line but sometimes need to be broken into several, and therefore constitute
    paragraphs; it is then natural to discourage page breaks inside an item. Of
    course, for items less than four lines long the \clubpenalty and
    \widowpenalty will usually have significant effect along these lines anyway,
    but I can see \interlinepenalty being closer to what my actual intent would
    be.

there are definitely situations where a
paragraph of more than 4 lines must be
all together on a page, and in such a
case, \interlinepenalty=10000 is a much
cleaner solution than putting the paragraph
in a box, since it avoids vertical spacing
problems with top-lines-with-no-ascenders
and bottom-lines-with-no-descenders.
						-- bb