diff options
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/README.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/index.md | 75 | ||||
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/makeall | 239 |
3 files changed, 253 insertions, 66 deletions
diff --git a/Master/texmf-dist/doc/plain/pwebmac/README.md b/Master/texmf-dist/doc/plain/pwebmac/README.md index 924b1d11d4e..538a39c5577 100644 --- a/Master/texmf-dist/doc/plain/pwebmac/README.md +++ b/Master/texmf-dist/doc/plain/pwebmac/README.md @@ -27,5 +27,6 @@ created by `weave`. From there, all depends on the “TeX engine” you use: `tex "\let\pdf+\input…"`, `pdftex`, and `xetex` create PDF output with clickable links and bookmarks (depending on your PDF viewer). -The `pwebmac` package is free software and may be used without restraints. -This is version “4.5.2” of the `pwebmac` package — 2020-06-01, AS. +The `pwebmac` package is free software and may be used without constraints. + +This is version “4.5.3” of the `pwebmac` package — 2020-06-17, AS. diff --git a/Master/texmf-dist/doc/plain/pwebmac/index.md b/Master/texmf-dist/doc/plain/pwebmac/index.md new file mode 100644 index 00000000000..b8edf09a548 --- /dev/null +++ b/Master/texmf-dist/doc/plain/pwebmac/index.md @@ -0,0 +1,75 @@ +--- +title: WEB programs in “TeX Live 2021” +colorlinks: true +--- + +## Introduction + +Welcome to “All Things `WEB`” in “TeX Live.” + +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, +the attached `[chg]` links point to “only the changed sections (or modules),” +so you may want to study these pairs in parallel. Care has been taken to keep +the section numbers for the main parts intact. + +Note that all `WEB` programs are mogrified from Pascal code to C code before +compilation, so further modifications and amendments will occur “for the real +thing,” i.e., the production of the executable `WEB` programs. (The `CWEB` +programs do not require these extra modifications, they get linked directly to +the external runtime environment.) + +If you believe to have found anything that remains technically, historically, +typographically, or politically incorrect, please notify the maintainers at +[the tex-k mailing list](mailto:tex-k@tug.org). + +## Canonical Knuthian WEB programs + +* `errata/` +* `etc/` \[ + [`VFtoVP`](etc/vftovp.pdf)<sub>[chg](etc/vftovp-changes.pdf)</sub> \| + [`VPtoVF`](etc/vptovf.pdf)<sub>[chg](etc/vptovf-changes.pdf)</sub> \] +* `mf/` \[ + [`Metafont`](mf/mf.pdf)<sub>[chg](mf/mf-changes.pdf)</sub> \| + [`TRAPMAN`](mf/trapman.pdf) \] +* `mfware/` \[ + [`GFtype`](mfware/gftype.pdf)<sub>[chg](mfware/gftype-changes.pdf)</sub> \| + [`GFtoPK`](mfware/gftopk.pdf)<sub>[chg](mfware/gftopk-changes.pdf)</sub> \| + [`GFtoDVI`](mfware/gftodvi.pdf)<sub>[chg](mfware/gftodvi-changes.pdf)</sub> \| + [`MFT`](mfware/mft.pdf)<sub>[chg](mfware/mft-changes.pdf)</sub> \] +* `tex/` \[ + [`TeX`](tex/tex.pdf)<sub>[chg](tex/tex-changes.pdf)</sub> \| + [`TRIPMAN`](tex/tripman.pdf) \] +* `texware/` \[ + [`POOLtype`](texware/pooltype.pdf)<sub>[chg](texware/pooltype-changes.pdf)</sub> \| + [`TFtoPL`](texware/tftopl.pdf)<sub>[chg](texware/tftopl-changes.pdf)</sub> \| + [`PLtoTF`](texware/pltotf.pdf)<sub>[chg](texware/pltotf-changes.pdf)</sub> \| + [`DVItype`](texware/dvitype.pdf)<sub>[chg](texware/dvitype-changes.pdf)</sub> \] +* `web/` \[ + [`WEBMAN`](web/webman.pdf) \| + [`WEAVE`](web/weave.pdf)<sub>[chg](web/weave-changes.pdf)</sub> \| + [`TANGLE`](web/tangle.pdf)<sub>[chg](web/tangle-changes.pdf)</sub> \] + +## Complementary WEB programs + +* `other/` \[ + [`DVIcopy`](other/dvicopy.pdf)<sub>[chg](other/dvicopy-changes.pdf)</sub> \| + [`PatGen`](other/patgen.pdf)<sub>[chg](other/patgen-changes.pdf)</sub> \| + [`PKtoGF`](other/pktogf.pdf)<sub>[chg](other/pktogf-changes.pdf)</sub> \| + [`PKtype`](other/pktype.pdf)<sub>[chg](other/pktype-changes.pdf)</sub> \] +* `bibtex/` \[ [`BibTeX`](bibtex/bibtex.pdf)<sub>[chg](bibtex/bibtex-changes.pdf)</sub> \] +* `pdftex/` \[ [`pdfTeX`](pdftex/pdftex.pdf)<sub>[chg](pdftex/pdftex-changes.pdf)</sub> \] +* `xetex/` \[ [`XeTeX`](xetex/xetex.pdf)<sub>[chg](xetex/xetex-changes.pdf)</sub> \] + +## CWEB programs + +* `cweb/` \[ + [`CWEBMAN`](cweb/cwebman.pdf) \| + [`COMMON`](cweb/common.pdf)<sub>[chg](cweb/common-changes.pdf)</sub> \| + [`CTANGLE`](cweb/ctangle.pdf)<sub>[chg](cweb/ctangle-changes.pdf)</sub> \| + [`CWEAVE`](cweb/cweave.pdf)<sub>[chg](cweb/cweave-changes.pdf)</sub> \| + [`CTWILL`](cweb/ctwill.pdf) \] +* `ctie/` \[ [`CTIE`](ctie/ctie.pdf)<sub>[chg](ctie/ctie-changes.pdf)</sub> \] +* `tie/` \[ [`TIE`](tie/tie.pdf)<sub>[chg](tie/tie-changes.pdf)</sub> \] + +## Happy C/WEB Programming! diff --git a/Master/texmf-dist/doc/plain/pwebmac/makeall b/Master/texmf-dist/doc/plain/pwebmac/makeall index 6f0762a8d92..a97508f4169 100644 --- a/Master/texmf-dist/doc/plain/pwebmac/makeall +++ b/Master/texmf-dist/doc/plain/pwebmac/makeall @@ -21,7 +21,7 @@ else OPTS=$(getopt $SHRTOPTS $*) fi if [ $? -eq 0 ] # Check return code from getopt -then eval set -- "$OPTS" +then eval set -- $OPTS else echo "Failed to parse options." >&2; exit 1 fi @@ -32,7 +32,7 @@ do -n | --new ) NEW=true; shift ;; -o | --outdir ) OUTDIR="$2"; shift 2 ;; -p | --pdftocfront ) PDFTOCFRONT=true; shift ;; - -t | --tex ) TEX="$2"; shift 2 ;; + -t | --tex ) TEX=$2; shift 2 ;; -- ) shift; break ;; * ) break ;; esac @@ -44,48 +44,92 @@ KNUTHWARE=$(dirname $KNUTHWHERE) export CWEBINPUTS=$KNUTHWARE//: export WEBINPUTS=$KNUTHWARE//: -# WEB and CWEB programs we want to get formatted; 'xetex.web' must be last, -# because it switches the TEX engine! +if [ xetex = $TEX ] +then CWEAVE="cweave -f -lp+" +else CWEAVE="cweave -f" +fi +CTWILL="ctwill -f +lpdf" + +# WEB and CWEB programs we want to get formatted for f in \ - $KNUTHWARE/*.web \ - common ctangle cweave ctwill ctie tie \ - pdftex.web xetex.web + $KNUTHWARE/*.web pdftex.web xetex.web \ + common ctangle cweave ctwill ctie tie do + f=$(basename $f .web) + if $CHANGES then - c=$(basename $f .web).ch - - # pdftex.ch and xetex.ch for TeX Live are here + # pdftex.ch and xetex.ch for TeX Live are assembled here WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS: case $f in - *.web ) weave $f $c ;; - "common" ) cweave -f $f comm-w2c ;; - "ctangle" ) cweave -f $f ctang-w2c ;; - "cweave" ) cweave -f $f cweav-w2c ;; - "ctwill" ) cweave -f cweave $f-w2c $f ;; - "ctie" ) cweave -f $f $f-k ;; - "tie" ) cweave -f $f $f-w2c ;; + common ) $CWEAVE $f comm-w2c ;; + ctangle ) $CWEAVE $f ctang-w2c ;; + cweave ) $CWEAVE $f cweav-w2c ;; + ctwill ) ;; # do nothing for CTWILL + ctie ) $CWEAVE $f $f-k ;; + tie ) $CWEAVE $f $f-w2c ;; + + * ) weave $f $f ;; esac - # make full documentation with changes applied - sed -i -e "s/\(\\\\let\\\\maybe=\)\\\\iffalse/\1\\\\iftrue/" \ - $(basename $f .web).tex + # only document changed modules/sections + case $f in + # pdfTeX and XeTeX have overlong tables-of-contents + pdftex ) sed -i -e "s/\(\\\\let\\\\maybe=\)\\\\iftrue/\1\\\\iffalse/" \ + -e "s/\(\\\\pageno=3\)/\1\n\\\\def\\\\contentspagenumber{1}/" \ + $f.tex ;; + + # XeTeX uses '\pdfTeX' from section 114, which + # is not changed and thus 'disappears' + xetex ) sed -i -e "s/\(\\\\let\\\\maybe=\)\\\\iftrue/\1\\\\iffalse\n\\\\def\\\\pdfTeX{pdf\\\\TeX}/" \ + -e "s/\(\\\\pageno=3\)/\1\n\\\\def\\\\contentspagenumber{1}/" \ + $f.tex ;; + + ctwill ) ;; # do nothing for CTWILL + + * ) sed -i -e "s/\(\\\\let\\\\maybe=\)\\\\iftrue/\1\\\\iffalse/" \ + $f.tex ;; + esac else case $f in - *.web ) weave $f ;; - "common"|"ctangle"|"cweave"|"ctie"|"tie" ) - cweave -f $f ;; - "ctwill" ) cweave -f cweave $f-w2c $f ;; + common | ctangle | cweave | ctie | tie ) $CWEAVE $f ;; + ctwill ) ;; # do nothing for CTWILL + * ) weave $f ;; esac fi - f=$(basename $f .web) + # Format CTWILL in its own format + if [ ctwill = $f ] + then + WEBINPUTS=/opt/github/cwebbin:$WEBINPUTS \ + tie -m $f.w cweave.w $f-w2c.ch $f-mini.ch + cp -an /opt/github/cwebbin/*.bux . + $CTWILL $f + $CTWILL $f + fi # use extended macros for TeX Live PDF documentation if $NEW then sed -i -e "1 s/\\\\input webmac/\\\\input pwebmac/" $f.tex + + # timestamp on table-of-contents page or the first page + case $f in + bibtex | patgen | tangle | weave ) + sed -i -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;; + + mf | tex | pdftex | xetex ) + sed -i -e "s/\(\\\\def\\\\botofcontents\)/\\\\datethis\n\1/" $f.tex ;; + + c* | tie ) ;; # do nothing for CWEB programs + + * ) sed -i -e "s/\(\\\\def\\\\botofcontents\)/%\1/" \ + -e "s/ \\\\centerline{\(\\\\hsize\)/\\\\def\\\\covernote{\1/" \ + -e "s/\(Publishing Company.}}\)}/\1\n\\\\datecontentspage/" \ + -e "s/\(trademark of the American Mathematical Society.}}\)}/\1\n\\\\datecontentspage/" \ + $f.tex ;; + esac fi # replace former convention to indicate "not a title page" @@ -99,27 +143,28 @@ do # 'E' no longer free to be active character # fix table-of-contents page for bibtex # FIX: don't wait for Oren Patashnik. - "bibtex" ) sed -i -e "s/titlefalse/titletrue/" \ - -e "70,77d" $f.tex ;; + bibtex ) sed -i -e "s/titlefalse/titletrue/" $f.tex + if ! $CHANGES + then + sed -i -e "71,78d" $f.tex + fi ;; # make room for new material in weave.web # FIX: should be fixed upstream. - "tangle" ) sed -i -e "s/number{123}/number{125}/" $f.tex ;; + tangle ) sed -i -e "s/number{123}/number{125}/" $f.tex ;; # amend '\N' redefinition for PDF outlines in mf.tex and # tex.tex (also pdftex.web and xetex.web); depends on the # extended 'pwebmac.tex' macros - "mf"|"tex"|"pdftex"|"xetex" ) - if [ "xetex" = $f ] + mf | tex | pdftex | xetex ) + if [ xetex = $f ] then # purge obsolete macros from XeTeX sed -i -e "/\\\\input xewebmac/d" $f.tex - # only XeTeX can process XeTeX - TEX=xetex fi if $NEW then - if [ "pdftex" = $f ] + if [ pdftex = $f ] then # pdfTeX has a looong table-of-contents cat > pdftex.patch << FI @@ -147,51 +192,117 @@ FI rm texmf-pdf.patch fi ;; - "common"|"ctangle"|"cweave"|"ctwill"|"ctie"|"tie" ) + common | ctangle | cweave | ctie | tie ) # Use nicer format for C comments and assignment - sed -i -e "1 s/\(\\\\input cwebmac\)/\1\n\\\\input Xcwebmac/" \ - $f.tex - - # 'cwebmac.tex' needs a little push for 'xetex' - # FIX: should be fixed upstream in 'cwebmac.tex'. - if [ "xetex" = $TEX ] - then - sed -i -e "1 s/\(\\\\input cwebmac\)/\\\\let\\\\pdf+\n\1\n/" \ - $f.tex - fi ;; + sed -i -e "1 s/\(cwebmac\)/\1\n\\\\input Xcwebmac/" \ + $f.tex ;; esac if $PDFTOCFRONT then # shift table-of-contents pages to the front in PDF sed -i -e "1 s/\(webmac\)/\1\n\\\\input pdfwebtocfront/" $f.tex - sed -i -e "2 s/\(cwebmac\)/\1\n\\\\input pdfwebtocfront/" $f.tex - $TEX $f # run TeX twice + + if [ xetex = $f ] + then $f $f # run TeX twice + else $TEX $f # run TeX twice + fi fi - $TEX $f + if [ xetex = $f ] + then $f $f + else $TEX $f + fi + + if [ ctwill = $f ] + then + ctwill-refsort < $f.ref > $f.sref + $TEX $f + fi done +# Finally, build the remaining documents +# * TeX and Metafont test routines +# * WEB and CWEB manuals +if ! $CHANGES +then + export TEXINPUTS=./:$(kpsewhich --var-value=TEXMFDIST)//:$KNUTHWARE// + + # FIX: Prepare 'trapman' for automatic processing; several input + # files are renamed in TeX Live (in fact, there are additional + # files for MetaPost). + rm -f trapman.tex cwebman.tex + + f=$(kpsewhich -engine tex trapman) + tie -m $(basename $f) $f /opt/github/web/$(basename $f .tex).ch + + # Prepare 'cwebman' with footnotes describing the extended CWEB. + f=$(kpsewhich -engine tex cwebman) + tie -m $(basename $f) $f $(basename $f .tex)-w2c.ch + + for f in trip trap web cweb + do + $TEX ${f}man + done +fi + if $PDFTOCFRONT then # create tarballs for publication - pax vftovp.pdf vptovf.pdf -wvzf $OUTDIR/etc.tar.gz -s ,^,etc/, - pax mf.pdf -wvzf $OUTDIR/mf.tar.gz -s ,^,mf/, - pax gftodvi.pdf gftopk.pdf gftype.pdf mft.pdf \ - -wvzf $OUTDIR/mfware.tar.gz -s ,^,mfware/, - pax tex.pdf -wvzf $OUTDIR/tex.tar.gz -s ,^,tex/, - pax dvitype.pdf pltotf.pdf pooltype.pdf tftopl.pdf \ - -wvzf $OUTDIR/texware.tar.gz -s ,^,texware/, - pax tangle.pdf weave.pdf -wvzf $OUTDIR/web.tar.gz -s ,^,web/, - pax bibtex.pdf -wvzf $OUTDIR/bibtex.tar.gz -s ,^,bibtex/, - pax dvicopy.pdf patgen.pdf pktogf.pdf pktype.pdf \ - -wvzf $OUTDIR/other.tar.gz -s ,^,other/, - pax pdftex.pdf -wvzf $OUTDIR/pdftex.tar.gz -s ,^,pdftex/, - pax xetex.pdf -wvzf $OUTDIR/xetex.tar.gz -s ,^,xetex/, - pax ctie.pdf -wvzf $OUTDIR/ctie.tar.gz -s ,^,ctie/, - pax tie.pdf -wvzf $OUTDIR/tie.tar.gz -s ,^,tie/, - pax common.pdf ctangle.pdf cweave.pdf ctwill.pdf \ - -wvzf $OUTDIR/cweb.tar.gz -s ,^,cweb/, + if $CHANGES + then + for f in *.pdf + do + mv $f $(basename $f .pdf)-changes.pdf + done + pax vftovp-changes.pdf vptovf-changes.pdf \ + -wvzf "$OUTDIR/etc-changes.tar.gz" -s ,^,etc/, + pax mf-changes.pdf -wvzf "$OUTDIR/mf-changes.tar.gz" -s ,^,mf/, + pax gftodvi-changes.pdf gftopk-changes.pdf \ + gftype-changes.pdf mft-changes.pdf \ + -wvzf "$OUTDIR/mfware-changes.tar.gz" -s ,^,mfware/, + pax tex-changes.pdf -wvzf "$OUTDIR/tex-changes.tar.gz" -s ,^,tex/, + pax dvitype-changes.pdf pltotf-changes.pdf \ + pooltype-changes.pdf tftopl-changes.pdf \ + -wvzf "$OUTDIR/texware-changes.tar.gz" -s ,^,texware/, + pax tangle-changes.pdf weave-changes.pdf \ + -wvzf "$OUTDIR/web-changes.tar.gz" -s ,^,web/, + pax bibtex-changes.pdf \ + -wvzf "$OUTDIR/bibtex-changes.tar.gz" -s ,^,bibtex/, + pax dvicopy-changes.pdf patgen-changes.pdf \ + pktogf-changes.pdf pktype-changes.pdf \ + -wvzf "$OUTDIR/other-changes.tar.gz" -s ,^,other/, + pax pdftex-changes.pdf \ + -wvzf "$OUTDIR/pdftex-changes.tar.gz" -s ,^,pdftex/, + pax xetex-changes.pdf \ + -wvzf "$OUTDIR/xetex-changes.tar.gz" -s ,^,xetex/, + pax ctie-changes.pdf \ + -wvzf "$OUTDIR/ctie-changes.tar.gz" -s ,^,ctie/, + pax tie-changes.pdf \ + -wvzf "$OUTDIR/tie-changes.tar.gz" -s ,^,tie/, + pax common-changes.pdf ctangle-changes.pdf \ + cweave-changes.pdf \ + -wvzf "$OUTDIR/cweb-changes.tar.gz" -s ,^,cweb/, + else + pax vftovp.pdf vptovf.pdf -wvzf "$OUTDIR/etc.tar.gz" -s ,^,etc/, + pax mf.pdf trapman.pdf -wvzf "$OUTDIR/mf.tar.gz" -s ,^,mf/, + pax gftodvi.pdf gftopk.pdf gftype.pdf mft.pdf \ + -wvzf "$OUTDIR/mfware.tar.gz" -s ,^,mfware/, + pax tex.pdf tripman.pdf -wvzf "$OUTDIR/tex.tar.gz" -s ,^,tex/, + pax dvitype.pdf pltotf.pdf pooltype.pdf tftopl.pdf \ + -wvzf "$OUTDIR/texware.tar.gz" -s ,^,texware/, + pax webman.pdf tangle.pdf weave.pdf \ + -wvzf "$OUTDIR/web.tar.gz" -s ,^,web/, + pax bibtex.pdf -wvzf "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, + pax dvicopy.pdf patgen.pdf pktogf.pdf pktype.pdf \ + -wvzf "$OUTDIR/other.tar.gz" -s ,^,other/, + pax pdftex.pdf -wvzf "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, + pax xetex.pdf -wvzf "$OUTDIR/xetex.tar.gz" -s ,^,xetex/, + pax ctie.pdf -wvzf "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, + pax tie.pdf -wvzf "$OUTDIR/tie.tar.gz" -s ,^,tie/, + pax cwebman.pdf common.pdf ctangle.pdf cweave.pdf ctwill.pdf \ + -wvzf "$OUTDIR/cweb.tar.gz" -s ,^,cweb/, + fi fi exit 0 |