LaTeX2e <1996/12/01> cannot compile CWEB


From:     Oliver Pabst
Date: 08 Nov 1997
I used to create a .tex file from a CWEB file. When I do latex file.tex, I get these messages:
$ latex ge_module
This is TeX, Version 3.14159 (C version 6.1)
(ge_module.tex
LaTeX2e <1996/12/01> patch level 1
Babel <v3.6h> and hyphenation patterns for american, german, loaded.
(/usr/lib/texmf/texmf/tex/latex/local/cweb/cwebmac.tex)
(/usr/lib/texmf/texmf/tex/latex/local/cweb/cweb.cls
Document Class: cweb 1995/11/30 v3.6 LaTeX markup for CWEB sources
(/usr/lib/texmf/texmf/tex/latex/local/cweb/keyvald.sty)
(/usr/lib/texmf/texmf/tex/latex/base/article.cls
Document Class: article 1996/10/31 v1.3u Standard LaTeX document class
(/usr/lib/texmf/texmf/tex/latex/base/size10.clo))
(/usr/lib/texmf/texmf/tex/latex/local/cweb/cwebbase.tex)

LaTeX Warning: Command \end  has changed.
               Check if current package is valid.

) (doc/angela.tex (/usr/lib/texmf/texmf/tex/latex/misc/geometry.sty
(/usr/lib/texmf/texmf/tex/latex/graphics/keyval.sty))
(/usr/lib/texmf/texmf/tex/generic/babel/babel.sty
(/usr/lib/texmf/texmf/tex/generic/babel/germanb.ldf
(/usr/lib/texmf/texmf/tex/generic/babel/babel.def))
(/usr/lib/texmf/texmf/tex/generic/babel/english.ldf))

[...]

Overfull \hbox (22.78969pt too wide) in paragraph at lines 40--66
[][]
[2] *2 [3] [4] [5] [6] [7]
Overfull \hbox (43.3812pt too wide) in paragraph at lines 466--471
[][][][]\OML/cmm/m/it/10 :[][][][][][][]:[][][][][]$
)
*
LaTeX returns in command mode without exiting correctly. When I use an old version of LaTeX (1 year older), it works! I presume the reason is the Warning message at the beginning of the LaTeX output. Can someone help me? [You can also answer by email, as I don't visit these groups regularly]


From:     Drew Csillag
Date: 08 Nov 1997
Oliver Pabst writes: I used to create a .tex file from a CWEB file. When I do latex file.tex, I get these messages:

CWEB outputs a TeX file not a LaTeX file so running tex file.tex should do the trick.


From:     Marc van Leeuwen
Date: 09 Nov 1997
Oliver Pabst writes: I used to create a .tex file from a CWEB file. When I do latex file.tex, I get these messages:

Drew Csillag replies: CWEB outputs a TeX file not a LaTeX file so running tex file.tex should do the trick.

Indeed normally CWEB assumes processing by TeX, but the format file cwebmac.tex kindly performs a test at the start to see if LaTeX might be loaded, in which case it refrains from loading the TeX-style macros; this allows for LaTeX style macros to be used instead. Indeed, from the first lines of the log given:

$ latex ge_module
This is TeX, Version 3.14159 (C version 6.1)
(ge_module.tex
LaTeX2e <1996/12/01> patch level 1
Babel <v3.6h> and hyphenation patterns for american, german, loaded.
(/usr/lib/texmf/texmf/tex/latex/local/cweb/cwebmac.tex)
(/usr/lib/texmf/texmf/tex/latex/local/cweb/cweb.cls
Document Class: cweb 1995/11/30 v3.6 LaTeX markup for CWEB sources
It is clear that Oliver is using Joachim Schrod's cweb.cls LaTeX class for controlling the markup. So it should work (as it did with an older LaTeX), and it seems like there is a real problem; unfortunately I cannot provide any solution.


From:     Joachim Schrod
Date: 12 Nov 1997
I have received several mails that there are problems in cweb.cls when it shall be used with LaTeX <1996/12/01>. That's because \end is redefined there and the reference definition is checked; but that LaTeX version changed the \end definition. Denis Roegel was so kind to provide me with a solution that I append to this post. I try to upload a new revision of cweb.cls that will work with old and new versions of LaTeX to CTAN as soon as possible.

Denis Roegel writes: Joachim, I have found the problem with cweb.cls: there has apparently been a change in the definition of \end in LaTeX and a \global has been removed. Therefore, it is necessary to do the following change to cweb.cls:
%%% \sect Let's make sure that the expansion of |\end| is the one that we
%%% expect. Then we can define |\cweb@skip_end| appropriately, we have to
%%% skip 5~tokens.
%% DR: only 4 now

%%% \beginprog
\CheckCommand*\end[1]{%
  \csname end#1\endcsname\@checkend{#1}%
  \expandafter\endgroup\if@endpe\@doendpe\fi
% 1         2      3            4            5
%  \if@ignore\global\@ignorefalse\ignorespaces\fi}
%% DR: \global removed
  \if@ignore\@ignorefalse\ignorespaces\fi}


%\def\cweb@skip_end#1#2#3#4#5{\cweb@check_fi}
% DR: #5 removed
\def\cweb@skip_end#1#2#3#4{\cweb@check_fi}
%%% \endprog
It seems to work with these changes.


From:     Joachim Schrod
Date: 30 Jun 1998
Sorry for this late reply but I recently (re)discovered this newsgroup (and your question). The problem is indeed in the warning, apparently the \end command has been changed since cweb-sty-1.1.1 was released. Below is a simple patch that corrects this problem. [In depth: a \global command was removed from the \end definition so instead of skipping 5 tokens we now need to skip only 4 tokens.]
*** cweb.cls.orig       Tue Jun 30 09:27:54 1998
--- cweb.cls    Tue Jun 30 09:12:37 1998
***************
*** 842,851 ****
  \CheckCommand*\end[1]{%
    \csname end#1\endcsname\@checkend{#1}%
    \expandafter\endgroup\if@endpe\@doendpe\fi
! % 1         2      3            4            5
!   \if@ignore\global\@ignorefalse\ignorespaces\fi}
  
! \def\cweb@skip_end#1#2#3#4#5{\cweb@check_fi}
  %%% \endprog
  
  
--- 842,851 ----
  \CheckCommand*\end[1]{%
    \csname end#1\endcsname\@checkend{#1}%
    \expandafter\endgroup\if@endpe\@doendpe\fi
! % 1         2            3            4
!   \if@ignore\@ignorefalse\ignorespaces\fi}
  
! \def\cweb@skip_end#1#2#3#4{\cweb@check_fi}
  %%% \endprog