texlive[60229] Master/texmf-dist: pwebmac (12aug21)
commits+karl at tug.org
commits+karl at tug.org
Thu Aug 12 22:34:13 CEST 2021
Revision: 60229
http://tug.org/svn/texlive?view=revision&revision=60229
Author: karl
Date: 2021-08-12 22:34:12 +0200 (Thu, 12 Aug 2021)
Log Message:
-----------
pwebmac (12aug21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/plain/pwebmac/README.md
trunk/Master/texmf-dist/doc/plain/pwebmac/index.md
trunk/Master/texmf-dist/doc/plain/pwebmac/makeall
trunk/Master/texmf-dist/doc/plain/pwebmac/webman.ch
trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/README.md 2021-08-12 20:33:31 UTC (rev 60228)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/README.md 2021-08-12 20:34:12 UTC (rev 60229)
@@ -3,11 +3,11 @@
The original [WEB](https://ctan.org/pkg/web) system by Donald Knuth has the
macros `webmac.tex` that produce DVI output only; for historic reasons, it
will never be modified (apart from catastrophic errors).
-Hàn Thế Thành has modified these macros in his (outdated?) `pdfwebmac.tex` for
+Hàn Thế Thành has extended these macros in his (outdated?) `pdfwebmac.tex` for
PDF output (only) with [pdfTeX](https://ctan.org/pkg/pdftex).
Jonathan Kew's [XeTeX](https://ctan.org/pkg/xetex) has similar macros
-`xewebmac.tex` by Khaled Hosny that _modify_ `webmac.tex` for PDF output;
-these macros can only be used with a specific “TeX engine” each.
+`xewebmac.tex` by Khaled Hosny that include and _modify_ `webmac.tex` for PDF
+output; all these macros can only be used with a specific “TeX engine” each.
The present `pwebmac` package integrates these three WEB macro files similar
to `cwebmac.tex` in Silvio Levy's and Don Knuth's
@@ -18,8 +18,8 @@
programs for “TeX and friends” as distributed in
[TeX Live](https://www.tug.org/texlive). For this purpose, the shell script
`makeall` was whipped together; it provides various commandline options and
-works around several “quirks” in the WEB sources. The resulting ``PDF
-library'' can be browsed in the `knuth-pdf` package.
+works around several “quirks” in the WEB sources. The resulting collection
+of PDF documents can be browsed in the `knuth-pdf` package.
WEB programmers who want to use `pwebmac.tex` instead of the default
`webmac.tex` in their programs have to change the first line in the TeX file
@@ -30,4 +30,4 @@
The `pwebmac` package is free software and may be used without constraints.
-This is version “4.6.2” of the `pwebmac` package — 2021-03-17, Andreas Scherer.
+This is version “4.6.3” of the `pwebmac` package — 2021-08-12, Andreas Scherer.
Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/index.md
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/index.md 2021-08-12 20:33:31 UTC (rev 60228)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/index.md 2021-08-12 20:34:12 UTC (rev 60229)
@@ -14,9 +14,9 @@
Here you find the documented source code of all major `WEB` and `CWEB` programs
in readable format. The “named” entries represent the unmodified base sources
as written by their respective authors, the attached “`chg`” links point to
-“only the changed sections (or modules)” as applied for release in the “\TeX\
-Live” distribution, so you may want to study these pairs in parallel. Care has
-been taken to keep the section numbers for the main parts intact.
+“only the changed sections (or modules)” as applied for release in the
+“\TeX\ Live” distribution, so you may want to study these pairs in parallel.
+Care has been taken to keep the section numbers for the main parts intact.
Although not all the programs presented here are written or maintained by
Donald Knuth, it is more convenient for everything to be collected in one place
Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/makeall
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/makeall 2021-08-12 20:33:31 UTC (rev 60228)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/makeall 2021-08-12 20:34:12 UTC (rev 60229)
@@ -174,6 +174,8 @@
r texmf-pdf.patch
}" $f.tex
+ $SED_I -e "s/{\\\\the\\\\pageno}}}\\\\next/{\\\\the\\\\pageno}{\\\\the\\\\toksE}}}\\\\next/" $f.tex
+
cat > texmf-pdf.patch << FI
\ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest
[ @thispage /FitH @ypos ] >>}\fi
Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/webman.ch
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/webman.ch 2021-08-12 20:33:31 UTC (rev 60228)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/webman.ch 2021-08-12 20:34:12 UTC (rev 60229)
@@ -121,6 +121,12 @@
\pdfURL{Appendix~D}{weave.pdf}.
@z
+ at x l.1050
+ASCII codes is $c_1c_2\ldots c_m$, its hash value will be
+ at y
+ASCII codes is $c_1c_2\ldots c_n$, its hash value will be
+ at z
+
@x l.1061
\section Appendix B.
This excerpt from \.{WEAVE.TEX} corresponds to Appendix A.
@@ -130,6 +136,18 @@
This excerpt from \.{WEAVE.TEX} corresponds to \Appendix A.
@z
+ at x l.1129
+ASCII codes is $c_1c_2\ldots c_m$, its hash value will be
+ at y
+ASCII codes is $c_1c_2\ldots c_n$, its hash value will be
+ at z
+
+ at x l.1139
+\U section~58.\fi
+ at y
+\U58.\fi
+ at z
+
@x l.1143
\section Appendix C.
@y
@@ -137,6 +155,153 @@
\section Appendix C.
@z
+ at x l.1149
+those lines. There are 1559 lines in all; the notation
+ at y
+those lines. There are 1585 lines in all; the notation
+ at z
+
+ at x l.1158
+{2:}{4:}{$C-,A+,D-}{[$C+,D+]}{:4}
+PROGRAM WEAVE(WEBFILE,CHANGEFILE,TEXFILE);LABEL 9999;CONST{8:}
+MAXBYTES=45000;MAXNAMES=5000;MAXMODULES=2000;HASHSIZE=353;BUFSIZE=100;
+ at y
+{2:}{4:}{$C-,A+,D-}{[$C+,D+]}
+{:4}PROGRAM WEAVE(WEBFILE,CHANGEFILE,TEXFILE);LABEL 9999;
+CONST{8:}MAXBYTES=45000;MAXNAMES=5000;MAXMODULES=2000;HASHSIZE=353;
+ at z
+
+ at x l.1162
+TOKPTR:0..MAXTOKS;{MAXTOKPTR,MAXTXTPTR:0..MAXTOKS;}{:53}{55:}
+IDFIRST:0..LONGBUFSIZE;IDLOC:0..LONGBUFSIZE;
+ at y
+TOKPTR:0..MAXTOKS;{MAXTOKPTR,MAXTXTPTR:0..MAXTOKS;}
+{:53}{55:}IDFIRST:0..LONGBUFSIZE;IDLOC:0..LONGBUFSIZE;
+ at z
+
+ at x l.1166
+PROCEDURE INITIALIZE;VAR{16:}I:0..127;{:16}{40:}WI:0..1;{:40}{56:}
+H:0..HASHSIZE;{:56}{247:}C:ASCIICODE;{:247}BEGIN{10:}HISTORY:=0;{:10}
+ at y
+{:33}PROCEDURE INITIALIZE;VAR{16:}I:0..255;{:16}{40:}WI:0..1;
+{:40}{56:}H:0..HASHSIZE;{:56}{247:}C:ASCIICODE;
+ at z
+
+ at x l.1169
+TOKPTR:=1;TEXTPTR:=1;TOKSTART[0]:=1;TOKSTART[1]:=1;{MAXTOKPTR:=1;
+MAXTXTPTR:=1;}{:54}{57:}FOR H:=0 TO HASHSIZE-1 DO HASH[H]:=0;{:57}{94:}
+SCANNINGHEX:=FALSE;{:94}{102:}MODTEXT[0]:=32;{:102}{124:}OUTPTR:=1;
+ at y
+{MAXTOKPTR:=1;MAXTXTPTR:=1;}
+{:54}{57:}FOR H:=0 TO HASHSIZE-1 DO HASH[H]:=0;
+{:57}{94:}SCANNINGHEX:=FALSE;{:94}{102:}MODTEXT[0]:=32;
+ at z
+
+ at x l.1173
+IF R=0 THEN XREF[P]:=XREFPTR ELSE XMEM[R].XLINKFIELD:=XREFPTR;END;{:51}
+{58:}FUNCTION IDLOOKUP(T:EIGHTBITS):NAMEPOINTER;LABEL 31;
+ at y
+IF R=0 THEN XREF[P]:=XREFPTR ELSE XMEM[R].XLINKFIELD:=XREFPTR;END;
+{:51}{58:}FUNCTION IDLOOKUP(T:EIGHTBITS):NAMEPOINTER;LABEL 31;
+ at z
+
+ at x l.1176
+L:0..LONGBUFSIZE;P:NAMEPOINTER;BEGIN L:=IDLOC-IDFIRST;{59:}
+H:=BUFFER[IDFIRST];I:=IDFIRST+1;
+ at y
+L:0..LONGBUFSIZE;P:NAMEPOINTER;BEGIN L:=IDLOC-IDFIRST;
+{59:}H:=BUFFER[IDFIRST];I:=IDFIRST+1;
+ at z
+
+ at x l.1184
+LINK[P]:=HASH[H];HASH[H]:=P;31:{:60};IF P=NAMEPTR THEN{62:}
+BEGIN W:=NAMEPTR MOD 2;
+ at y
+LINK[P]:=HASH[H];HASH[H]:=P;31:{:60};
+IF P=NAMEPTR THEN{62:}BEGIN W:=NAMEPTR MOD 2;
+ at z
+
+ at x l.1194
+XREF[P]:=0;END{:62};IDLOOKUP:=P;END;{:58}{66:}
+FUNCTION MODLOOKUP(L:SIXTEENBITS):NAMEPOINTER;LABEL 31;VAR C:0..4;
+ at y
+XREF[P]:=0;END{:62};IDLOOKUP:=P;END;
+{:58}{66:}FUNCTION MODLOOKUP(L:SIXTEENBITS):NAMEPOINTER;LABEL 31;
+ at z
+
+ at x l.1208
+\verbatim
+ at y
+\begingroup \def\tt{\ninett} \baselineskip10pt
+\verbatim
+ at z
+
+ at x l.1210
+\xdef\fmtversion{\fmtversion+WEBMAC4.0} % identifies current set of macros
+ at y
+\xdef\fmtversion{\fmtversion+WEBMAC4.2} % identifies current set of macros
+ at z
+
+ at x l.1218
+\font\tentex=cmtex10 % TeX extended character set (used in strings)
+ at y
+\font\tentex=cmtex10 % TeX extended character set (used in strings)
+\fontdimen7\tentex=0pt % no extra space after punctuation
+ at z
+
+ at x l.1294
+ {\xdef\modstar{#1}\let\*=\empty\xdef\modno{#1}}
+ \ifx\modno\modstar \onmaybe \else\ontrue \fi \mark{\modno}}
+ at y
+ {\xdef\modstar{#1}\let\*=\empty\xdef\modno{#1}}% remove \* from section name
+ \ifx\modno\modstar \onmaybe \else\ontrue \fi
+ \mark{{{\tensy x}\modno}{\rhead}}}
+ % each \mark is {section reference or null}{group title}
+ at z
+
+ at x l.1325
+\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead\hfill\title\qquad
+ \tensy x\mainfont\topmark} % top line on left-hand pages
+\def\rheader{\tensy x\mainfont\topmark\eightrm\qquad\title\hfill\rhead
+ \qquad\mainfont\the\pageno} % top line on right-hand pages
+ at y
+\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead
+ \hfill\title\qquad\mainfont\topsecno} % top line on left-hand pages
+\def\rheader{\mainfont\topsecno\eightrm\qquad\title\hfill
+ \rhead\qquad\mainfont\the\pageno} % top line on right-hand pages
+\def\topsecno{\expandafter\takeone\topmark}
+\def\takeone#1#2{#1}
+\def\taketwo#1#2{#2}
+\def\nullsec{\eightrm\kern-2em} % the \kern-2em cancels \qquad in headers
+ at z
+
+ at x l.1336
+\def\rhead{\.{WEB} OUTPUT} % this running head is reset by starred sections
+ at y
+\def\rhead{\.{WEB} OUTPUT} % this running head is reset by starred sections
+\mark{\noexpand\nullsec{\rhead}}
+ at z
+
+ at x l.1392
+ \def\rhead{NAMES OF THE SECTIONS}
+ at y
+ \def\rhead{NAMES OF THE SECTIONS}
+ \let\topsecno=\nullsec
+ at z
+
+ at x l.1395
+ \def\note##1##2.{\hfil\penalty-1\hfilneg\quad{\eightrm##1 ##2.}}
+ at y
+ \def\note##1##2.{\hfil\penalty-1\hfilneg\quad{\eightrm##1~##2.}}
+ at z
+
+ at x l.1414
+?endgroup
+ at y
+?endgroup
+\endgroup
+ at z
+
@x l.1425
in small caps. For example, Appendix~D was produced after saying
@y
@@ -172,6 +337,12 @@
and figure out what changes
@z
+ at x l.1592
+first change files; then you can sure that your compiler will handle
+ at y
+first change files; then you can be sure that your compiler will handle
+ at z
+
@x l.1609
the index to Appendix~D.
@y
Modified: trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
===================================================================
--- trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex 2021-08-12 20:33:31 UTC (rev 60228)
+++ trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex 2021-08-12 20:34:12 UTC (rev 60229)
@@ -160,8 +160,10 @@
\else\if\noexpand\nxt\relax % we have a control sequence; is it one we know?
\ifx\nxt~\addF\space
\else\ifx\nxt\onespace\addF\space
- \else\the\usersanitizer % if not recognised, skip it
- \fi\fi
+ \else\the\usersanitizer
+ \iftokprocessed\else\makeolproctokctl
+ \iftokprocessed\else\makeolproctokmath % if not recognised, skip it
+ \fi\fi\fi\fi
\else % we don't have a control sequence, it's an ordinary char
\ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash
\else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}%
@@ -170,6 +172,34 @@
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%\fi\fi
\next
}
+\def\makeolproctokctl{%
+ \ifx\nxt\PASCAL\addF{Pascal\space}\let\next\makeolgobbletok % \PASCAL/
+ \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/
+ \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/
+ \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}%
+ \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/
+ \else\ifx\nxt\CEE\addF{C}\else\ifx\nxt\Cee\addF{C}%
+ \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...}
+ \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...}
+ % skip \|
+ \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi
+ \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi
+ \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77}
+ \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5}
+ \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77}
+ \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi % \T{77\$L} %$%
+ \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar
+ \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+\def\makeolproctokmath{%
+ \ifx\nxt\alpha\addF{alpha}\else\ifx\nxt\beta\addF{beta}%
+ \else\ifx\nxt\gamma\addF{gamma}\else\ifx\nxt\delta\addF{delta}%
+ \else\ifx\nxt\theta\addF{theta}\else\ifx\nxt\psqrt\addF{root }%
+ \else\ifx\nxt\H\addF{"}\else\ifx\nxt\O\addF{'}%
+ \else\ifx\nxt\v\addF{|}\else\ifx\nxt\S\addF{==}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
\def\makeolproctokchar#1 #2 #3{\addF{#3}}
\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}%
\outlinest\let\outlinedone=\relax}
@@ -184,7 +214,7 @@
\else \special{pdf: dest (\romannumeral\modstar)
[ @thispage /FitH @ypos ]}\fi}}\fi}
\let\startsection=\stsec
-\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format'
+\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format'
\def\A{\note{See also section}} % xref for doubly defined section name
\def\As{\note{See also sections}} % xref for multiply defined section name
\def\B{\mathopen{\.{@\{}}} % begin controlled comment
@@ -207,8 +237,10 @@
\ifacro{\toksF={}\makeoutlinetoks#2\outlinedone\outlinedone}\fi
\gtitle={#2}\MN#1.\vfil\eject % define running headline
\message{*\modno} % progress report
+ \def\stripprefix##1>{}\def\gtitletoks{#2}%
+ \edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
\edef\next{\write\cont{\Z{#2}{\modno}% write to contents file
- {\noexpand\the\pageno}}}\next % \Z{title}{sec}{page}
+ {\noexpand\the\pageno}{\the\toksE}}}\next % \Z{title}{sec}{page}{ss}
\ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest
[ @thispage /FitH @ypos ] >>}\fi
\ifon\startsection{\bf#2.\quad}\ignorespaces}
@@ -361,9 +393,9 @@
\else \csname#1\endcsname \fi} % Petr Olsak's macros from texinfo.tex
\def\advancenumber#1{\countA=\expnumber{#1}\relax \advance\countA by1
\expandafter\xdef\csname#1\endcsname{\the\countA}}
-\def\writebookmarkline#1#2#3{{%
+\def\writebookmarkline#1#2#3#4{{%
\let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
- \pdfoutline goto num #2{#1}}}
+ \pdfoutline goto num #2{#4}}}
\def\con{\par\vfill\eject % finish the section names
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
@@ -377,7 +409,7 @@
\let\Z=\contentsline
\readcontents\relax % read the contents info
\botofcontents \end} % print the contents page(s) and terminate
-\def\contentsline#1#2#3{%
+\def\contentsline#1#2#3#4{%
\line{\ignorespaces#1
\rm\leaders\hbox to .5em{.\hfil}\hfil
\ \ifacro\pdflink{#2}{\romannumeral#2}\else#2\fi\hbox to3em{\hss#3}}}
More information about the tex-live-commits
mailing list.