Date:     14 March 91                           Message No:     036

To:       TeX implementors and distributors

From:     Barbara Beeton

Subject:  Messages from DEK, part 1


The latest package of marked-up messages from DEK was postmarked
15 January 92.  It contained 10 checks, including two for actual bugs.
Unfortunately, other matters have conspired to delay my forwarding of
all this material, and I apologize.  (I don't suppose anyone out there
would like to be a TUGboat production assistant?  Or has lots of
experience in moving from one office to another with less shelf space
without losing track of anything?  Didn't think so, somehow.)

As some of you may know, DEK was awarded an honorary doctorate by the
Royal Institute of Technology in Stockholm last November.  At that time,
some bug reports and other questions were apparently given to him in
person, and changes have been delayed as explained in this note which
accompanied the package:

    Barbara: Many thanks for this compilation!  I will not however be
    ready to update the sources until February because I mistakenly
    put some things recd in Sweden into the wrong box and they are
    currently being shipped via _sea_ _mail_.
    I have gone through this material but will hold off updating the
    master sources until I've gotten through some other things sent
    to me in Stockholm from Poland, some of which may be extremely
    important

I have just finished checking the /tex area at labrea.  There are no new
files in the errata directory, and as these are usually the first to be
installed, I assume that the main update has not yet been made.


########################################################################

Contents:
    [ part 1 ]
        >>> responses to DEK Sep 26 package
        >>> DEK's alpha test, TeX 3.14a
        >>> TeXbook errata
        >>> inconsistent ligature/kerning behavior
        >>> inconsistent expansion of \string, etc.; \newlinechar
        >>> \halign + box assignment within displays
        >>> positive/negative xn_over_d, tex.web section 107
        >>> DRF's "remaining comments"
        >>> suggestion -- additional tracing facilities for \if*
        >>> DEK's "local" change files, not at labrea
    [ part 2 ]
        >>> glue_ratio overflow
        >>> \TeX logo; some problems with \loop
        >>> cedilla accent macro in plain.tex
        >>> missing \mathsurround in plain.tex
        >>> \arrowvert code, plain.tex
        >>> MF -- bugs or features?  (also, some ACP errata)
        >>> MFbook errata
        >>> WEAVE -- Peter Breitenlohner
        >>> WEAVE -- Brian {Hamilton Kelly}
    [ sent separately ]
        >>> Barry Smith, |history| variable in TeX.WEB
        >>> Chris Rowley, two items: \fontdimen2 and marks

************************************************************************

>>> responses to DEK Sep 26 package

Date: Mon, 23 Dec 91 13:23:58 +0100
From: Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
Subject: Backenfisch, tex.web

>  [ dek: should i have used `backenfisch' instead? ]

Maybe deleting `compound' on p. 96 would be better since I have found
no word with ck hyphenated k-k *because* it is a compound word.
(Of course there are words containing tt hyphenated tt-t *because*
they are compound words.)

 [ dek:
        point well taken ... but I wasn't serious and i _did_ delete
        `compound' in September as he requested
 ]
 ---

In tex.web, there's a @^system dependencies@> missing for the line
 [ dek:  \S798 ]

if n>max_quarterword then confusion("256 spans"); {this can happen, but won't}
                                     ^^^
                                     This is system-dependent.
 [ dek:                                                         $2.56 ]

Yours,
    Eberhard Mattes (mattes@azu.informatik.uni-stuttgart.de)

<<< end responses to DEK Sep 26 package

************************************************************************

>>> DEK's alpha test, TeX 3.14a

Date: Tue 24 Sep 91 11:22:21-EST
From: bbeeton <BNB@MATH.AMS.COM>
To: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk, 
    tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk, pzf5hz@ruipc1e.Bitnet
Subject: message from dek -- tex alpha version 3.14a

chris, brian, and frank,
you are hereby deputized to follow dek's instructions and test out
the new version.  [ ... ]
i won't forward this information to anyone else [for at least two
weeks], and you probably should be discreet about it too.  thanks.
cheers.                                         -- bb
                        --------------------
Date: Fri, 20 Sep 91 12:50:54 -0700
Subject: note from Don

                [ copy of message from dek ]
 -------
Date: Thu, 26 SEP 91 22:31:01 BST
From: TEX@rmcs.cranfield.ac.uk
Reply-to: Brian {Hamilton Kelly} <TeX@rmcs.cranfield.ac.uk>
Subject: RE: message from dek -- tex alpha version 3.14a

In message <685725741.0.BNB@MATH.AMS.COM> 
of Tue 24 Sep 91 11:22:21-EST, bbeeton <BNB@com.AMS.MATH> wrote:

> chris, brian, and frank,
> you are hereby deputized to follow dek's instructions ...
>  ...  (i will take care of the envelope of "comments and checks"
                                                              ^
                                    (Would I spell this cheques? :-)
> as soon as i can after i get back to providence.)

Well, I've collected the new files (I *love* the README!!), modified my
change file to accommodate the new banner and a few of the
|slow_print|s, and built 3.14a.  It's great!!  Fixes my problem with
hyphenation vs. boundary ligatures perfectly.  And what an elegant
solution: I'd expected the fix to be complicated, but it just requires
one simple global and the odd preservation of context.

> Date: Fri, 20 Sep 91 12:50:54 -0700
> Subject: note from Don
> 
> Meanwhile, there's some more "immediate" news. I've prepared an
> alpha-test version of TeX, called version 3.14a. Before I release
> it officially, I'd like CET1 and Brian Hamilton-Kelly and maybe
> Frank Mittelbach [and anybody else you think best, but I don't really
> want this version to proliferate] to try it. There are two changes,
> one to cure the anomaly Frank noticed about \newlinechar acting
> differently wrt \write and \message [and other similar glitches I
> then noticed myself], the other to fix I hope the problem Brian was
> having with Greek. I'm reluctant to let the version number converge to
> \pi too quickly, so I would at least like to have Brian accumulate
> some experience with his Greek tests before putting this out widely.
> Of course anybody is free to use it at their own risk.
 
Be warned, however, that so far I've only tested it against the input
that caused me problems back in April.  I'll try to do some more
thorough testing in the near future.

 [ dek:
        Certainly hope you did by now -- I need more reassurance than
        a single test
 ]

> The files tex.web and tex82.bug have been moved to labrea.stanford.edu
> where they are accessible via anonymous ftp. After logging in,
> connect to directory alpha (which is for alpha-test software).
> I forgot to copy the trip test files; if they are desperately needed,
> I could bring them in from home.

I haven't TRIPped the new TeX for this reason.  The interesting thing
would be if TRIP were extended to check the new ligature/hyphenation
code: I expect that, with DEK's customary thoroughness, he'll have done
this, so look forward to applying the tests myself when 3.14a emerges as
3.141.

 [ dek:
        Actually my customary thoroughness is becoming less customary
 ]
 
> So, next week you'll get my letter explaining all! Meanwhile, a
> lookahead: I'll be in Sweden during November and December (thanks to
> some good words from Roswitha, I'll getting an honorary degree
> there!), and I plan to make the next official update to TeX sources
> early in January. By then, this version 3.14a should be checked out,
> and I can release it as version 3.141.

Whilst you're talking to DEK, barbara, what response did he give to that
d..d problem of Weave failing to wrap correctly when processing a TeX
comment?  I have a horrible suspicion in my mind that he's already said
something to the effect that he edited it manually!  Or am I imagining
that horror?  My fix works very well and doesn't have any bugs that I
can see, so why doesn't he adopt it?

Brian HK
 -------
Date: Sun, 29 Sep 91 00:56:57 BST
From: Chris Thompson <CET1@phoenix.cambridge.ac.uk>
To: Barbara Beeton <BNB@MATH.AMS.com>
Cc: Brian {Hamilton Kelly} <tex@rmcs.cranfield.ac.uk>,
    Frank Mittelbach <pzf5hz@ruipc1e.bitnet>
Subject: Re: [message from dek -- tex alpha version 3.14a]

Barbara, Brian, Frank,

  I have fetched and compiled TeX 3.14a. Unfortunately, change 397
seems to have bugs. Try the following input:

    % TeX 3.14a test
    \pretolerance=-1
    \ Respectively.\par
    \showboxbreadth=255 \showboxdepth=255 \showlists
    \bye

and compare the log files for 3.14 and 3.14a. That for 3.14a has an
extra kern in between the "-ly" and the ".":

    .\tenrm e
    .\tenrm l
    .\tenrm y
    .\kern-0.83334               \ This kern has been doubled by the
    .\kern-0.83334               / automatic hyphentaion algorithm.
    .\tenrm .
    .\penalty 10000

 [ dek:
        well, this made me feel very sick, but I sure am thankful to
        Chris for finding it.
        $10.24
 ]

I discovered this while checking that 'webman.tex' generated the same
DVI file (except for date stamp), which is part of my standard paranoia
suite. There were two discrepancies of the above type in the very first
paragraph... but the rest of the document produced no more!

 [ dek:
        I think probably the _old_ 3.0 would also produce double kerns
        in cases where kern was specified before right boundary character
        by font designer [e.g. to kern after f at end of word]

        While studying this I found another mistake in my code from
        September.  But I think the basic idea was sound, only the
        execution was faulty.

        Still I guess I should try another alpha test with "3.14b"?
 ]

Brian & Frank: can you confirm this effect?

Chris Thompson
Cambridge University Computing Service
JANET:    cet1@uk.ac.cam.phx
Internet: cet1@phx.cam.ac.uk
 -------
Date: Mon, 30 SEP 91 15:46:17 BST
Reply-to: Brian {Hamilton Kelly} <TeX@rmcs.cranfield.ac.uk>
From: TEX@rmcs.cranfield.ac.uk
Subject: Re: [message from dek -- tex alpha version 3.14a]

In message <A4912BE187A67A40@UK.AC.CAMBRIDGE.PHOENIX>  of Sun, 29 Sep 91
00:56:57 BST, Chris Thompson <CET1@UK.AC.CAMBRIDGE.PHOENIX> wrote:

> Barbara, Brian, Frank,
> 
>   I have fetched and compiled TeX 3.14a. Unfortunately, change 397
> seems to have bugs.  [ ... ]
> 
> and compare the log files for 3.14 and 3.14a. That for 3.14a has an
> extra kern in between the "-ly" and the ".":
> 
>     .\tenrm e
>     .\tenrm l
>     .\tenrm y
>     .\kern-0.83334               \ This kern has been doubled by the
>     .\kern-0.83334               / automatic hyphentaion algorithm.
>     .\tenrm .
>     .\penalty 10000
> 
> [ ... ]
> 
> Brian & Frank: can you confirm this effect?

I have repeated Chris' experiment, and can confirm that 3.14a does
indeed double the kern.  Oh dear...

The odd thing is that I compared the outputs resulting from running
DVItype on the DVI outputs of my Greek test, and saw only the expected
change from medial sigma to terminal sigma (with relevant horizontal
positioning changes).  But I may have missed other horizontal changes
due to this bug: I've thrown the printout away again by now,
unfortunately!

Brian

<<< end DEK's alpha test, TeX 3.14a

************************************************************************

>>> TeXbook errata

Date: Tue, 19 Nov 91 16:05:02 GMT
From: Chris Thompson <CET1@phoenix.cambridge.ac.uk>
Subject: TeXbook p.178 bug report

  Here is another TeXbook bugette report by Robert Hunt. I suppose it is
right in theory, unless it comes under the "deliberate lie" clause. Anyway,
perhaps you would like to have someone else vet it: I am getting to the stage
with Robert's bug reports that I just wish he would shut up! He seems happy
with the latest p.377 fix, by the way.

 -----------------------------------------------------------------------
REH10 15 Nov 1991 16.49
Very minor mistake on p.178 of the TeXbook: it claims that using \phantom{...}
in a maths formula always produces the same spacing (vertical and horizontal)
as just {...}; but of course this isn't true as \phantom can't tell whether the
current maths style is cramped or not, so \phantom{U^2} will produce different
vertical spacing in cramped style compared with what {U^2} would produce. I
don't think this is particularly worth worrying about, but it's always annoyed
me that \mathchoice doesn't distinguish between (say) T and T'.
 -----------------------------------------------------------------------

 [ dek:
        $2.56
        I'm going to put the apology on page 360 because the truth would
        interfere with the exposition on p 178
 ]

Chris Thompson

 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Date: Tue, 3 Dec 91 15:13:01 MST
From: Nelson H. F. Beebe <beebe@math.utah.edu>
Subject: Possible bug in TeXbook, p.270

Last night, while studying to TeXbook to better understand TeX's rules
for when spaces are significant, I found what I believe is a small
error in the TeXbook.  I checked errata files errata.one .. errata.six
without finding this error already logged.

The TeXbook, p.270, gives BNF rules for the grammar of dimensions.
>From this grammar, one concludes from the rules (pulled from
texman.tex)

<optional {\tt true}>\is[true]\alt<empty>

<unit of measure>\is<optional spaces><internal unit>
  \alt<optional {\tt true}><physical unit><one optional space>

<normal dimen>\is<internal dimen>\alt<factor><unit of measure>

<factor>\is<normal integer>\alt<decimal constant>

<decimal constant>\is|.|$_{12}$\alt|,|$_{12}$
  \alt<digit><decimal constant>
  \alt<decimal constant><digit>

that "123 truept" is illegal input, since no space may precede the
word true according to the grammar.

Nevertheless, TeX the program happily accepts such space:

This is TeX, C Version 3.14
**\relax

*\dimen0 = 12345     true    pt

 [ dek:
        see the \P on p 268 that begins `We shall use a special
        convention for keywords'.  _true_ is a keyword
 ]

*\showthe\dimen0
> 12345.0pt.
<*> \showthe\dimen0

?

I believe that TeX the program is correct, and is consistent with its
permitting optional space before non-true dimensions.

This suggests that the TeXbook should have the rule

<unit of measure>\is<optional spaces><internal unit>
  \alt<optional {\tt true}><physical unit><one optional space>

changed to

<unit of measure>\is<optional spaces><internal unit>
  \alt<optional spaces><optional {\tt true}><physical unit><one optional space>

I'm assuming that AB|CDE is to be parsed as (AB)|(CDE) (the
conventional interpretation in BNF grammars), rather than A(B|C)DE;
the latter would not make sense here anyway.

========================================================================
Nelson H.F. Beebe
Center for Scientific Computing
Department of Mathematics
220 South Physics Building
University of Utah
Salt Lake City, UT 84112
USA
 Tel: (801) 581-5254
 FAX: (801) 581-4148
 Internet: beebe@math.utah.edu
========================================================================
 
<<< end TeXbook errata

************************************************************************

>>> inconsistent ligature/kerning behavior

Date: Wed, 25 Sep 91 13:13:55 +0200
From: Bernd Raichle <raichle@azu.informatik.uni-stuttgart.de>
Subject: Bug in TeX's ligature builder?! (No, it's documented.)

In a letter to DEK in November 1989 (i.e., before TeX 3.0; appeared in
TeXhax 90, Issue 5) Frank Mittelbach summarized some requirements of a
new TeX version.  For example, he mentioned manipulations of the
"Ligatures and kerning tables" and the need to "Reconsider paragraphs
after page-breaking".  Other users had and have similar wishes and
requirements.

But nobody mentioned a bug, or better --- because this "bug" is
documented in the TeXbook --- the inconsistent and (for the beginner)
mysterious behaviour when TeX builds ligatures and inserts kerning.

Try the following in plain TeX and look at the output.  I have used
the fl-ligature as an example.  (TeX's behaviour for kerning between
two characters is exactly the same.)

 ------------------------------ CUT ------------------------------
\hsize=5cm            % linebreak for more than three words
\hyphenation{Au-flage}% for demonstration (correct german is Auf-la-ge)

Auflage\par                  % (1) show `fl' ligature
Auf{}lage Auf\relax lage\par % (2) simple way to avoid the ligature

\pretolerance=10000 % no second pass
Auf{}lage
Auf{}lage Auf{}lage Auf{}lage Auf{}lage\par % (3) no ligatures

\pretolerance=-1  % force second pass
Auf{}lage         % no(!) ligature, because there's no preceding glue
Auf{}lage Auf{}lage Auf{}lage Auf{}lage\par % (4) ligatures

Auf{}lage         % (5) no(!) ligature, there's no preceding glue
Auf\kern0pt lage  % no lig, explicit kern
Auf\/lage         % no lig, explicit kern
$\rm Auflage$     % example of ligature in math mode
$\rm Auf{}lage$   % no lig, in math mode
\hbox{Auf{}lage}  % no lig, in packed hbox
Auf{}lage\vrule width0pt\  % no lig, followed by a rule node
Auf{}lage\kern0ptAuf{}lage % 1st ligature, 2nd no ligature
Auf{}lage\par     % ligature
\bye
 ------------------------------ CUT ------------------------------

Example (1) shows the normal fl ligature, in example (2) I suppress
the ligature with an empty group (see TeXbook, exercise 5.1 and
answer) or a \relax (both are non-character tokens).

In example (3) I use empty groups to suppress the ligatures.  The
same(!) input paragraph in example (4) contains ligatures.  The only
and very important difference between (3) and (4) is the value of
\pretolerance.  (Note that the first word in (4) has no fl-ligature!)

Example (5) gives a quick overview of TeX's behaviour, when the same
word (= the same input!) is used in a different context.  You can
think of other examples: hbox the word... and unhbox it.  Try the same
with the ''-ligature (i.e. compare '' with '{}'), etc.


Very short explanation of this behaviour: when TeX is in hmode,
ligatures and kernings are build out of the (current input) token
list.  Non-character tokens (like { or \relax) influence ligatures and
kerning.

When TeX is in math mode or after hyphenation is done in the second
pass of the line_break algorithm, ligatures and kernings are build out
of the node list representing the current paragraph (or math list).
This node list doesn't contain representations for tokens like { or
\relax anymore.  Because not all parts of the node list are tried for
hyphenation, not all of the supressed ligatures are reconstituted.


TeX has a powerful linebreak algorithm, a powerful hyphenation
capability and powerful ligature and kerning tables.
But the connection between them shows IMHO design bugs, if you want to
use them and expect the same output from the same input.

 [ dek:
        This is unfortunate but known and I decided long ago that
        the cure would be worse than the disease.
 ]

Comments, etc. ...??  (... are expected!!)

 -bernd

PS: I have ideas how to make ligatures/kerning more consistent.
    But the result, after the necessary changes (in a few places)
    are applied, is a "TeX" which fails the Trip-Test.

 __________________________________________________________________________
 Bernd Raichle, Student der Universit"at Stuttgart | "Le langage est source
 privat: Stettener Str. 73, D-W-7300 Esslingen     |  de malentendus"
 email:  raichle@azu.informatik.uni-stuttgart.de   |  (A. de Saint-Exupery)

<<< end inconsistent ligature/kerning behavior


########################################################################

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Character code reference
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                       Upper case letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
%                       Lower case letters: abcdefghijklmnopqrstuvwxyz
%                                   Digits: 0123456789
% Square, curly, angle braces, parentheses: [] {} <> ()
%           Backslash, slash, vertical bar: \ / |
%                              Punctuation: . ? ! , : ;
%          Underscore, hyphen, equals sign: _ - =
%                Quotes--right left double: ' ` "
%"at", "number" "dollar", "percent", "and": @ # $ % &
%           "hat", "star", "plus", "tilde": ^ * + ~
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[ end of message 036 ]