Knuth-Plass: adjacent demerits on the first line

Didier Verna didier at didierverna.net
Wed May 3 16:24:16 CEST 2023


  Dear all,

if I understand sections #859 and #864 in the KP algorithm correctly,
TeX adds adjacent demerits to solutions for the /first/ line which are
not in the decent fit class. That is because the root active node in
#864 is initialized with a fitness of decent_fit, and there's no
special-casing of the first line in #859.

If this is correct, I find it weird to consider adjacent demerits for
the first line, given that there is no previous line to actually compare
with.

Again, IIUC, doing this will favor paragraph solutions for which the
first line is as close to natural spacing as possible. But what about
the repercussions on the subsequent lines? Given the default values for
adjacent demerits and hyphen penalties for example, it seems to me that
it would be possible for the KP algorithm to prefer a paragraph solution
with a decent first line over one with fewer hyphens.

I couldn't find a rationale for this design decision anywhere, so I'm
wondering if there is one, and if somebody actually knows about it.

Thanks!

-- 
Resistance is futile. You will be jazzimilated.

Lisp, Jazz, Aïkido: http://www.didierverna.info



More information about the texhax mailing list.