# tex using the wrong macro

Out of curiosity I tried to weave the bibtex.web source code and compile the resulting bibtex.tex with tex. I got some errors which led me to investigate; I'm sure my confusion stems from incorrect assumptions on my part.

The errors were of the missing $kind, but point to the use of a wrong macro. Weaved tex-files use the webmac.sty style file. In it are macros such as \A, \As, \E , \ET and \ETs. The \E macro should be used in a math environment. An example of an error is: ! Missing$ inserted.
<inserted text>
\$
<to be read again>
\cdot
\E->\cdot
10^
<argument> 39, 58, 60\E
Ts61
\note ...ndent 2em\baselineskip 10pt\eightrm #1~#2
.\par }
l.1135 \As39, 58, 60\ETs61.


What this shows is that the \ETs macro is only being read as far as the \E part. Why does this happen, and why doesn't it happen with similarly named and used \As macros?

Edit: I should add that the behaviour remains the same when adding spaces after the offending macro.

• looks like you have changed the catcode of T not to be 11 (letter) what does \showthe\catcode\T produce? – David Carlisle Aug 16 '13 at 13:57
• @DavidCarlisle, yes too slow :) Catcode was correct. – contr.error Aug 16 '13 at 14:52
• It was the catcode of E not T that had changed (to 13) as egreg's answer shows, but it had to be catcode somewhere:-) – David Carlisle Aug 16 '13 at 14:59

After the initial lines about recent changes, the bibtex.ch file has

% [0] Let bibtex.tex work with latest webmac (which defines \ET, hence
% making E active loses).
@x
\catcodeE=13 \uppercase{\def E{e}}
\def\\#1{\hbox{\let E=\drop\it#1\/\kern.05em}} % italic type for identifiers
@y
\let\maybe = \iffalse % process only changed sections
@z


So you need to have both bibtex.web and bibtex.ch (I downloaded them from http://tug.org/svn/texlive/trunk/Build/source/texk/web2c/) and call

weave bibtex.web bibtex.ch


Then, running pdftex or tex on the generated bibtex.tex file will produce a correct output without errors.

• Interesting. I read the note about *.ch files, but thought they would be used by packagers/distributers. – contr.error Aug 16 '13 at 14:42
• Are changes from the .ch file periodically "backported" to the .web file (with new releases of the .web file)? The latest version of the .web file is from 2010, while it seems the .ch file has been accreting changes since '84 (although I understand the rationale of keeping a released version stable for a while and updating it in a patch-file like manner)... The stars next to the module numbers make the 'changed' tex output a bit less elegant too, IMO! Thanks for your answer. – contr.error Aug 16 '13 at 14:51
• @contr.error Theoretically, a .web file is platform independent; change files are not for fixing bugs in the .web source, but for adding platform dependent support. – egreg Aug 16 '13 at 14:55
• @contr.error: This is bibTeX, which I consider unmaintained. – Martin Schröder Aug 18 '13 at 0:29
• @MartinSchröder Indeed! BibTeX has been ported to web from an original C program, IIRC. And, while a version 1 has been announced years ago, it never saw the light. – egreg Aug 18 '13 at 8:39