
Ciekawostka -- co� s�dzicie o tym? Pozdrowie�stwa -- Jacko

-- 
BOP s. c.
ul. Bora-Komorowskiego 24, 80-377 Gdansk, Poland
tel. (+48 58) 553 46 59,  fax (+48 58) 511 03 81
bop@bop.com.pl, http://www.bop.com.pl

---------- Forwarded message ----------
Date: Fri, 7 Sep 2007 16:10:32 +0200
From: Frank Mittelbach <frank.mittelbach@latex-project.org>
To: tex-implementors@tug.org
Subject: [SPAM] [tex-implementors] discretionary bug/feature?

since there is some traffic on this list right now I got reminded of
something strange/interesting that was shown to me by Morten last year
november.

He showed me a nice example of a TeX behavior that suspiciously looks
like a bug:

\tracingparagraphs=1
\nopagenumbers
\parindent=0pt
\setbox0=\hbox{C}
\hsize=\wd0

C\par

\discretionary{AA}{BB}{C}\par

\bye


 After staring at the code, I strongly believe that this is a bug in module
 851 (or 854 if you like). What happens is the following:

 In 851 it is tested if if the badness of the current potential break is
 infinity or if it is a forced break. In either case the starting node is
 deactivated (except in very special circumstances (which is 854)).

 what is not tested is whether or not we are in a discretionary case
 (break_type=hyphenated) that information is available but only used for trace
 display and some other case.

 therefore a prebreak that results in an overfull box (ie badness>10000) will
 deactivate the start node, even if the distance from the start node to the
 non-hyphenated node of the \discretionary might fit into the line

 ergo we see this strange behaviour.

 I think this is a bug and not a feature. It is true that one has to
 deactivate nodes and one of TeX's rule is not to do backtracking, eg when
 the is a long backskip in a paragraph later nodes might in theory be valid
 breakpoints except for the fact that the corresponding break nodes have
 already beend deactivated. However, that is ok under the assumption that one
 does conceptionally always move in one direction and not backtrack over
 previous nodes. However, in case of the \discretionary this doesn't hold as
 the pre-break is effectively not there if the non-break part is being
 choosen. Therefore it is not correct that the pre-break can deactivate nodes
 on the active list.

comments/opinions?

cheers
frank
