summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-06 21:14:40 +0000
committerKarl Berry <karl@freefriends.org>2022-02-06 21:14:40 +0000
commit990346f56be4fe0e07dfbf2cb75b4da2457d1bc7 (patch)
tree32ac547a6c8d7bce9faba68f1cdc0a00ecd90f21
parent7695ccfb5113467f042a902767065f311a976cd0 (diff)
pwebmac (6feb22)
git-svn-id: svn://tug.org/texlive/trunk@61922 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/plain/pwebmac/README.md16
-rw-r--r--Master/texmf-dist/doc/plain/pwebmac/index.md79
-rw-r--r--Master/texmf-dist/doc/plain/pwebmac/makeall136
-rw-r--r--Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex117
4 files changed, 208 insertions, 140 deletions
diff --git a/Master/texmf-dist/doc/plain/pwebmac/README.md b/Master/texmf-dist/doc/plain/pwebmac/README.md
index a876aaf212a..1fec3c29a58 100644
--- a/Master/texmf-dist/doc/plain/pwebmac/README.md
+++ b/Master/texmf-dist/doc/plain/pwebmac/README.md
@@ -12,22 +12,26 @@ 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
[CWEB](https://ctan.org/pkg/cweb) system, so `pwebmac.tex` can be used with
-“plain TeX,” “pdfTeX,” and “XeTeX” alike.
+“plain TeX,” “pdfTeX,” and “XeTeX” alike. And it adds full support for Martin
+Ruckert's “[HiTeX](https://ctan.org/pkg/hitex)” engine and its `HINT` output
+format.
-Its initial application is the production of PDF files for all major WEB
-programs for “TeX and friends” as distributed in
+Its initial application is the production of PDF and HINT files for all major
+WEB 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 collection
-of PDF documents can be browsed in the `knuth-pdf` package.
+of PDF documents can be browsed in the `knuth-pdf` package amd the collection
+of HINT documents are available in the `knuth-hint` 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
created by `weave`. From there, all depends on the “TeX engine” you use:
“plain TeX” by default creates DVI output, “plain TeX” with the invocation
`tex "\let\pdf+\input…"`, `pdftex`, and `xetex` create PDF output with
-clickable links and bookmarks (depending on your PDF viewer).
+clickable links and bookmarks (depending on your PDF viewer), and `hitex`
+creates HINT output that can be viewed with the `hintview` program.
The `pwebmac` package is free software and may be used without constraints.
-This is version “4.6.4” of the `pwebmac` package — 2021-11-06, Andreas Scherer.
+This is version “4.7” of the `pwebmac` package — 2022-02-05, Andreas Scherer.
diff --git a/Master/texmf-dist/doc/plain/pwebmac/index.md b/Master/texmf-dist/doc/plain/pwebmac/index.md
index 0c9accb73ef..59f6663e267 100644
--- a/Master/texmf-dist/doc/plain/pwebmac/index.md
+++ b/Master/texmf-dist/doc/plain/pwebmac/index.md
@@ -1,5 +1,5 @@
---
-title: C/WEB programs in “\TeX\ Live 2021”
+title: C/WEB programs in \TeX\ Live 2022
colorlinks: true
filecolor: blue
urlcolor: blue
@@ -9,14 +9,14 @@ urlcolor: blue
## Introduction
-Welcome to “All Things `WEB`” in “\TeX\ Live.”
+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
-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.
+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 numbering 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
@@ -24,67 +24,68 @@ for reading and searching. And they all stem from the system that Knuth
created.
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`
+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 in any of these files, please feel
free to [report bugs in \TeX\ and friends](https://tug.org/texmfbug/) or
-[contact the maintainer of this library](mailto:andreas_github@freenet.de)
+[contact the maintainer of this collection](mailto:andreas_github@freenet.de)
directly.
## Canonical Knuthian WEB programs
* `etc/` \[
- [`VFtoVP`](etc/vftovp.pdf)\ ~[`chg`](etc/vftovp-changes.pdf)~ \|
- [`VPtoVF`](etc/vptovf.pdf)\ ~[`chg`](etc/vptovf-changes.pdf)~ \]
+ [`VFtoVP`](etc/vftovp.pdf)+[`chg`](etc/vftovp-changes.pdf) \|
+ [`VPtoVF`](etc/vptovf.pdf)+[`chg`](etc/vptovf-changes.pdf) \]
* `mf/` \[
- [`Metafont`](mf/mf.pdf)\ ~[`chg`](mf/mf-changes.pdf)~ \|
+ [`Metafont`](mf/mf.pdf)+[`chg`](mf/mf-changes.pdf) \|
[`TRAPMAN`](mf/trapman.pdf) \]
* `mfware/` \[
- [`GFtype`](mfware/gftype.pdf)\ ~[`chg`](mfware/gftype-changes.pdf)~ \|
- [`GFtoPK`](mfware/gftopk.pdf)\ ~[`chg`](mfware/gftopk-changes.pdf)~ \|
- [`GFtoDVI`](mfware/gftodvi.pdf)\ ~[`chg`](mfware/gftodvi-changes.pdf)~ \|
- [`MFT`](mfware/mft.pdf)\ ~[`chg`](mfware/mft-changes.pdf)~ \]
+ [`GFtype`](mfware/gftype.pdf)+[`chg`](mfware/gftype-changes.pdf) \|
+ [`GFtoPK`](mfware/gftopk.pdf)+[`chg`](mfware/gftopk-changes.pdf) \|
+ [`GFtoDVI`](mfware/gftodvi.pdf)+[`chg`](mfware/gftodvi-changes.pdf) \|
+ [`MFT`](mfware/mft.pdf)+[`chg`](mfware/mft-changes.pdf) \]
* `tex/` \[
[`GLUE`](tex/glue.pdf) \|
- [`TeX`](tex/tex.pdf)\ ~[`chg`](tex/tex-changes.pdf)~ \|
+ [`TeX`](tex/tex.pdf)+[`chg`](tex/tex-changes.pdf) \|
[`TRIPMAN`](tex/tripman.pdf) \]
* `texware/` \[
- [`POOLtype`](texware/pooltype.pdf)\ ~[`chg`](texware/pooltype-changes.pdf)~ \|
- [`TFtoPL`](texware/tftopl.pdf)\ ~[`chg`](texware/tftopl-changes.pdf)~ \|
- [`PLtoTF`](texware/pltotf.pdf)\ ~[`chg`](texware/pltotf-changes.pdf)~ \|
- [`DVItype`](texware/dvitype.pdf)\ ~[`chg`](texware/dvitype-changes.pdf)~ \]
+ [`POOLtype`](texware/pooltype.pdf)+[`chg`](texware/pooltype-changes.pdf) \|
+ [`TFtoPL`](texware/tftopl.pdf)+[`chg`](texware/tftopl-changes.pdf) \|
+ [`PLtoTF`](texware/pltotf.pdf)+[`chg`](texware/pltotf-changes.pdf) \|
+ [`DVItype`](texware/dvitype.pdf)+[`chg`](texware/dvitype-changes.pdf) \]
* `web/` \[
[`WEBMAN`](web/webman.pdf) \|
- [`WEAVE`](web/weave.pdf)\ ~[`chg`](web/weave-changes.pdf)~ \|
- [`TANGLE`](web/tangle.pdf)\ ~[`chg`](web/tangle-changes.pdf)~ \]
+ [`WEAVE`](web/weave.pdf)+[`chg`](web/weave-changes.pdf) \|
+ [`TANGLE`](web/tangle.pdf)+[`chg`](web/tangle-changes.pdf) \|
+ [`TWILL`](web/twill.pdf) \]
## Complementary WEB programs by other authors
* `other/` \[
- [`DVIcopy`](other/dvicopy.pdf)\ ~[`chg`](other/dvicopy-changes.pdf)~ \|
- [`PatGen`](other/patgen.pdf)\ ~[`chg`](other/patgen-changes.pdf)~ \|
- [`PKtoGF`](other/pktogf.pdf)\ ~[`chg`](other/pktogf-changes.pdf)~ \|
- [`PKtype`](other/pktype.pdf)\ ~[`chg`](other/pktype-changes.pdf)~ \]
-* `bibtex/` \[ [`BibTeX`](bibtex/bibtex.pdf)\ ~[`chg`](bibtex/bibtex-changes.pdf)~ \]
-* `pdftex/` \[ [`pdfTeX`](pdftex/pdftex.pdf)\ ~[`chg`](pdftex/pdftex-changes.pdf)~ \]
-* `xetex/` \[ [`XeTeX`](xetex/xetex.pdf)\ ~[`chg`](xetex/xetex-changes.pdf)~ \]
+ [`DVIcopy`](other/dvicopy.pdf)+[`chg`](other/dvicopy-changes.pdf) \|
+ [`PatGen`](other/patgen.pdf)+[`chg`](other/patgen-changes.pdf) \|
+ [`PKtoGF`](other/pktogf.pdf)+[`chg`](other/pktogf-changes.pdf) \|
+ [`PKtype`](other/pktype.pdf)+[`chg`](other/pktype-changes.pdf) \]
+* `bibtex/` \[ [`BibTeX`](bibtex/bibtex.pdf)+[`chg`](bibtex/bibtex-changes.pdf) \]
+* `pdftex/` \[ [`pdfTeX`](pdftex/pdftex.pdf)+[`chg`](pdftex/pdftex-changes.pdf) \]
+* `xetex/` \[ [`XeTeX`](xetex/xetex.pdf)+[`chg`](xetex/xetex-changes.pdf) \]
## CWEB programs by Knuth _et\ al._
* `cweb/` \[
[`CWEBMAN`](cweb/cwebman.pdf) \|
- [`COMMON`](cweb/common.pdf)\ ~[`chg`](cweb/common-changes.pdf)~ \|
- [`CTANGLE`](cweb/ctangle.pdf)\ ~[`chg`](cweb/ctangle-changes.pdf)~ \|
- [`CWEAVE`](cweb/cweave.pdf)\ ~[`chg`](cweb/cweave-changes.pdf)~ \|\
+ [`COMMON`](cweb/common.pdf)+[`chg`](cweb/common-changes.pdf) \|
+ [`CTANGLE`](cweb/ctangle.pdf)+[`chg`](cweb/ctangle-changes.pdf) \|
+ [`CWEAVE`](cweb/cweave.pdf)+[`chg`](cweb/cweave-changes.pdf) \|\
[`CTWILL`](cweb/ctwill.pdf) \|
- [`REFSORT`](cweb/refsort.pdf)\ ~[`chg`](cweb/refsort-changes.pdf)~ \|
- [`TWINX`](cweb/twinx.pdf)\ ~[`chg`](cweb/twinx-changes.pdf)~ \]
-* `ctie/` \[ [`CTIE`](ctie/ctie.pdf)\ ~[`chg`](ctie/ctie-changes.pdf)~ \]
-* `tie/` \[ [`TIE`](tie/tie.pdf)\ ~[`chg`](tie/tie-changes.pdf)~ \]
+ [`REFSORT`](cweb/refsort.pdf)+[`chg`](cweb/refsort-changes.pdf) \|
+ [`TWINX`](cweb/twinx.pdf)+[`chg`](cweb/twinx-changes.pdf) \]
+* `ctie/` \[ [`CTIE`](ctie/ctie.pdf)+[`chg`](ctie/ctie-changes.pdf) \]
+* `tie/` \[ [`TIE`](tie/tie.pdf)+[`chg`](tie/tie-changes.pdf) \]
## Errata for “Computers & Typesetting” by Donald E.\ Knuth
@@ -106,4 +107,4 @@ directly.
## Happy C/WEB Programming!
-2021-03-17 Andreas Scherer
+2022-02-02 Andreas Scherer
diff --git a/Master/texmf-dist/doc/plain/pwebmac/makeall b/Master/texmf-dist/doc/plain/pwebmac/makeall
index 879ec912d43..2a058c5c6f4 100644
--- a/Master/texmf-dist/doc/plain/pwebmac/makeall
+++ b/Master/texmf-dist/doc/plain/pwebmac/makeall
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
PROG=$(basename $0)
@@ -8,8 +8,8 @@ usage ()
Usage: $PROG [options]
Test driver for 'pwebmac.tex' in combination with various TeX engines.
-Produce TeX output in DVI or PDF from a set of C/WEB programs included
-in the 'TeX Live' source tree.
+Produce TeX output in DVI, PDF or HINT format from a set of C/WEB programs
+included in the 'TeX Live' source tree.
Options are (--long options only with GNU getopt):
-c, --changes Apply change file to C/WEB source
@@ -18,7 +18,7 @@ Options are (--long options only with GNU getopt):
-n, --new Use 'pwebmac' instead of 'webmac'
-o, --outdir ARG Create tarballs in path ARG
-p, --pdftocfront Place TOC page at the front (PDF only)
- -t, --tex ARG Use TeX variant ARG={tex,pdftex,xetex}
+ -t, --tex ARG Use TeX variant ARG={tex,{hi,pdf,xe}tex}
Public domain. Originally written by Andreas Scherer, 2020.
HELP
@@ -32,7 +32,7 @@ FILESELECT=false # user-defined '--files' selection
NEW=false # '\input pwebmac' instead of '\input webmac' for PDF et al.
OUTDIR=. # path where the resulting tarballs are placed
PDFTOCFRONT=false # push table-of-contents to front of PDF output
-TEX=tex # or 'pdftex' or 'xetex'
+TEX=tex # or 'pdftex' or 'xetex' or 'hitex'
# Initial list of C/WEB sources to process, overridable with option '-f':
KNUTHWHERE=$(locate /bibtex.web)
@@ -41,7 +41,7 @@ then echo "$PROG: Can't locate the TeX Live source tree!" >&2; exit 1
fi
KNUTHWARE=$(dirname $KNUTHWHERE)
-FILES="$KNUTHWARE/*.web pdftex.web xetex.web"
+FILES="$KNUTHWARE/*.web pdftex.web xetex.web twill"
WEBINPUTS=$KNUTHWARE//:
FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie"
@@ -87,6 +87,15 @@ CWEAVE="cweave -f +lX"
CTWILL="ctwill -f +lpdf"
PAX="pax -wvzf"
SED_I="sed -i" # non-GNU-sed requires an extra '' argument for '-i' option.
+PDF=pdf
+
+# HINT format
+if [ hitex = $TEX ]
+then
+ $TEX -ini -jobname=hitex tex.ini
+ TEX="hitex --compress"
+ PDF=hnt
+fi
# WEB and CWEB programs we want to get formatted
for f in $FILES
@@ -101,6 +110,11 @@ do
$CTWILL $f # prime the pump
$CTWILL $f # get decent answers
+ elif [ twill = $f ]
+ then
+ tie -m $f.web weave.web weave.ch weav-$f.ch
+ weave $f
+
elif [ glue = $f ]
then
weave $f # no 'glue.ch' at this time
@@ -121,6 +135,9 @@ do
WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS: \
weave $f $f-final ;;
+ # TWILL is a change in and of itself
+ twill ) ;;
+
# all other WEB codes have singular changefiles
* ) weave $f $f ;;
esac
@@ -157,7 +174,7 @@ do
$SED_I -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;;
mf | tex | pdftex | xetex )
- $SED_I -e "s/\(\\\\def\\\\botofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\1/" $f.tex
+ $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex
# amend '\N' redefinition for PDF outlines in
# Metafont and TeX (also pdfTeX and XeTeX)
@@ -214,7 +231,7 @@ FI
# FIX: pdfTeX uses '\pdfTeX' in section names; these should
# appear correctly in the bookmarks, too.
pdftex )
- if $NEW && [ tex != $TEX ]
+ if $NEW && [ tex != "$TEX" ] && [[ ! $TEX =~ hitex ]]
then
$SED_I -e "s/\(\\\\def\\\\pdfTeX{pdf\\\\TeX}\)/\1 \\\\sanitizecommand\\\\pdfTeX{pdfTeX}\\\\sanitizecommand\\\\eTeX{e-TeX}/" \
$f.tex
@@ -245,62 +262,72 @@ FI
# only XeTeX can process XETEX.WEB
if [ xetex = $f ]
then $f $f
- elif [ refsort = $f ]
- then $TEX -interaction nonstopmode $f
- else $TEX $f
- fi
-
- if [ ctwill = $f ]
+ elif [ ctwill = $f ]
then
+ if [[ $TEX =~ hitex ]]
+ then
+ CTWILLTEX=pdftex
+ else
+ CTWILLTEX="$TEX"
+ fi
+ $CTWILLTEX $f
# sort mini-indexes
ctwill-refsort < $f.ref > $f.sref
- $TEX $f
+ $CTWILLTEX $f
+ elif [ refsort = $f ]
+ then $TEX -interaction nonstopmode $f
+ else $TEX $f
fi
done
-if $PDFTOCFRONT && ! $FILESELECT
+if ( $PDFTOCFRONT || [[ $TEX =~ hitex ]] ) && ! $FILESELECT
then
# create tarballs w/o changes for publication
if $CHANGES
then
- for f in *.pdf
+ for f in *.$PDF
do
case $f in
- *-changes.pdf ) rm -f $f; continue ;;
+ *-changes.$PDF ) rm -f $f; continue ;;
esac
- mv $f $(basename $f .pdf)-changes.pdf
+ mv $f $(basename $f .$PDF)-changes.$PDF
done
+ if [[ $TEX =~ hitex ]]
+ then
+ rm -f xetex-changes.pdf
+ mv xetex.pdf xetex-changes.pdf
+ fi
$PAX "$OUTDIR/etc-changes.tar.gz" -s ,^,etc/, \
- vftovp-changes.pdf vptovf-changes.pdf
+ vftovp-changes.$PDF vptovf-changes.$PDF
$PAX "$OUTDIR/mf-changes.tar.gz" -s ,^,mf/, \
- mf-changes.pdf
+ mf-changes.$PDF
$PAX "$OUTDIR/mfware-changes.tar.gz" -s ,^,mfware/, \
- gftodvi-changes.pdf gftopk-changes.pdf \
- gftype-changes.pdf mft-changes.pdf
+ gftodvi-changes.$PDF gftopk-changes.$PDF \
+ gftype-changes.$PDF mft-changes.$PDF
$PAX "$OUTDIR/tex-changes.tar.gz" -s ,^,tex/, \
- tex-changes.pdf
+ tex-changes.$PDF
$PAX "$OUTDIR/texware-changes.tar.gz" -s ,^,texware/, \
- dvitype-changes.pdf pltotf-changes.pdf \
- pooltype-changes.pdf tftopl-changes.pdf
+ dvitype-changes.$PDF pltotf-changes.$PDF \
+ pooltype-changes.$PDF tftopl-changes.$PDF
$PAX "$OUTDIR/web-changes.tar.gz" -s ,^,web/, \
- tangle-changes.pdf weave-changes.pdf
+ tangle-changes.$PDF weave-changes.$PDF
$PAX "$OUTDIR/bibtex-changes.tar.gz" -s ,^,bibtex/, \
- bibtex-changes.pdf
+ bibtex-changes.$PDF
$PAX "$OUTDIR/other-changes.tar.gz" -s ,^,other/, \
- dvicopy-changes.pdf patgen-changes.pdf \
- pktogf-changes.pdf pktype-changes.pdf
+ dvicopy-changes.$PDF patgen-changes.$PDF \
+ pktogf-changes.$PDF pktype-changes.$PDF
$PAX "$OUTDIR/pdftex-changes.tar.gz" -s ,^,pdftex/, \
- pdftex-changes.pdf
+ pdftex-changes.$PDF
$PAX "$OUTDIR/xetex-changes.tar.gz" -s ,^,xetex/, \
xetex-changes.pdf
$PAX "$OUTDIR/ctie-changes.tar.gz" -s ,^,ctie/, \
- ctie-changes.pdf
+ ctie-changes.$PDF
$PAX "$OUTDIR/tie-changes.tar.gz" -s ,^,tie/, \
- tie-changes.pdf
+ tie-changes.$PDF
$PAX "$OUTDIR/cweb-changes.tar.gz" -s ,^,cweb/, \
- common-changes.pdf ctangle-changes.pdf \
- cweave-changes.pdf refsort-changes.pdf \
- twinx-changes.pdf
+ common-changes.$PDF ctangle-changes.$PDF \
+ cweave-changes.$PDF refsort-changes.$PDF \
+ twinx-changes.$PDF
else
# Finally, build the remaining documents
# * TeX and Metafont test routines
@@ -336,45 +363,48 @@ then
eleven twelve
do
$TEX errata.$f
- mv errata.pdf errata.$f.pdf
+ mv errata.$PDF errata.$f.$PDF
done
$TEX errata
$PAX "$OUTDIR/errata.tar.gz" -s ,^,errata/, \
- errorlog.pdf errata.*.pdf errata.pdf
- $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.pdf vptovf.pdf
- $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.pdf trapman.pdf
+ errorlog.$PDF errata.*.$PDF errata.$PDF
+ $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.$PDF vptovf.$PDF
+ $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.$PDF trapman.$PDF
$PAX "$OUTDIR/mfware.tar.gz" -s ,^,mfware/, \
- gftodvi.pdf gftopk.pdf gftype.pdf mft.pdf
+ gftodvi.$PDF gftopk.$PDF gftype.$PDF mft.$PDF
$PAX "$OUTDIR/tex.tar.gz" -s ,^,tex/, \
- glue.pdf tex.pdf tripman.pdf
+ glue.$PDF tex.$PDF tripman.$PDF
$PAX "$OUTDIR/texware.tar.gz" -s ,^,texware/, \
- dvitype.pdf pltotf.pdf pooltype.pdf tftopl.pdf
+ dvitype.$PDF pltotf.$PDF pooltype.$PDF tftopl.$PDF
$PAX "$OUTDIR/web.tar.gz" -s ,^,web/, \
- webman.pdf tangle.pdf weave.pdf
- $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.pdf
+ webman.$PDF tangle.$PDF weave.$PDF twill.$PDF
+ $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.$PDF
$PAX "$OUTDIR/other.tar.gz" -s ,^,other/, \
- dvicopy.pdf patgen.pdf pktogf.pdf pktype.pdf
- $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.pdf
+ dvicopy.$PDF patgen.$PDF pktogf.$PDF pktype.$PDF
+ $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.$PDF
$PAX "$OUTDIR/xetex.tar.gz" -s ,^,xetex/, xetex.pdf
- $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.pdf
- $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.pdf
+ $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.$PDF
+ $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.$PDF
$PAX "$OUTDIR/cweb.tar.gz" -s ,^,cweb/, \
- cwebman.pdf common.pdf ctangle.pdf cweave.pdf \
- ctwill.pdf refsort.pdf twinx.pdf
+ cwebman.$PDF common.$PDF ctangle.$PDF cweave.$PDF \
+ ctwill.pdf refsort.$PDF twinx.$PDF
fi
# Notes to self:
# (1) Create a user-friendly central entrypoint with
# (a) pandoc index.md -o index.pdf
# (b) pandoc index.md -o index.tex;
- # pandoc index.tex -s -o index.html;
+ # pandoc index.tex -s -o index.html \
+ # --metadata title="C/WEB programs in TeX Live 2022";
# rm index.tex
# (2) Prepare a super-tarball from all the contents of these
- # individual tarballs (27/31) with either of
+ # individual tarballs (42/53 and 34/54) with either of
# (a) pax -wzf knuth-pdf.tar.gz knuth-pdf
+ # (a') pax -wzf knuth-hint.tar.gz knuth-hint
# (b) zip -r knuth-pdf.zip knuth-pdf
+ # (b') zip -r knuth-hint.zip knuth-hint
fi
exit 0
diff --git a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
index 3dac11f4bc4..3f4bd335e61 100644
--- a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
+++ b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
@@ -1,10 +1,11 @@
% standard macros for WEB listings (in addition to PLAIN.TEX)
% pdfTeX adjustments provided by Han The Thanh <thanh@pdftex.org>.
% XeTeX adjustments provided by Khaled Hosny <khaledhosny@eglug.org>.
+% HiTeX adjustments provided by Martin Ruckert <ruckert@cs.hm.edu>.
% macro integration \`a la CWEB by Andreas Scherer <andreas_tex@freenet.de>.
% This file is not copyrighted and can be used freely.
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+WEBMAC4.6}
+\xdef\fmtversion{\fmtversion+WEBMAC4.7}
\newif\ifpdf
\ifx\pdf+\pdftrue\fi
% Uncomment the following line if you want PDF goodies to be the default
@@ -17,7 +18,10 @@
\def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
\def\PDFlinkcolor{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi\fi
+\newif\ifHINT
+\ifx\HINTversion\undefined \HINTfalse \else \HINTtrue \fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
+\newif\ifacroHINT \ifacro\acroHINTtrue\fi \ifHINT\acroHINTtrue\fi
\parskip 0pt % no stretch between paragraphs
\parindent 1em % for paragraphs and for the first line of Pascal text
@@ -81,7 +85,7 @@
\let\yskip=\smallskip
\def\to{\mathrel{.\,.}} % double dot, used only in math mode
\def\note#1#2.{\Y\noindent{\hangindent2em\baselineskip10pt%
- \eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}
+ \eightrm#1~\ifacroHINT{\pdfnote#2.}\else#2\fi.\par}}
\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD
\newtoks\toksE \newtoks\toksF \newtoks\usersanitizer
@@ -102,43 +106,9 @@
\special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
depth \thedepth << /Type /Annot /Subtype /Link
/Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi
-\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA}
-\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}%
- \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={}
- \toksC={}\let\space\empty}\makenote}\maketoks}}
-\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
-\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}%
- \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}}
-\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|%
- \ifnum\countB>`9 \countB=0 \fi
- \ifnum\countB<`0
- \ifnum0=\countC\else\makenote\fi
- \ifx\first.\let\next=\maketoksdone\else
- \let\next=\maketoks
- \addtokens\toksB{\the\toksD}
- \ifx\first,\addtokens\toksB{\space}\fi
- \fi
- \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks
- \fi
- \next
-}
-\def\makenote{\addtokens\toksB
- {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0}
-\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
-\def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
- attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
- << /S /URI /URI (#2) >> }\PDFlinkcolor #1\Black \pdfendlink
- \else\ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
- \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
- \space depth \thedepth\space << /Border [0 0 0]
- /Type /Action /Subtype /Link /A << /S /URI /URI (#2) >> >>}\box0\relax}%
- \else #1 ({\tt#2})\fi\fi}
-{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
-{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
\def\sanitizecommand#1#2{\addtokens\usersanitizer
{\noexpand\dosanitizecommand\noexpand#1{#2}}}
\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi}
-\sanitizecommand\to{..} % a trivial example
\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12
\def\lbchar[{] \def\rbchar[}]
@@ -187,7 +157,7 @@
\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\$\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
@@ -205,9 +175,65 @@
\outlinest\let\outlinedone=\relax}
\fi % End of pdf macros
+\ifHINT
+% The following uses HINT primitives to implement:
+% \HINThome to mark the position of the home page
+% \HINTlabel to attach a label to the top of a section
+% \HINTlink to link a section number to the section label
+% \HINTcontents to produce an 'outline' item
+% These are the top level HINT macros that are used in this file
+% No HINT primitives are used directly.
+\def\HINThome{\HINTdest name {HINT.home}%
+ \HINToutline goto name {HINT.home} depth 1 {Table of Contents}}
+\def\HINTlabel{{\let\*=\empty\HINTdest num \modstar top}}
+\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ???
+\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}}
+\let\pdflink=\HINTlink
+\fi % End of HINT macros
+
+% Common macros for \ifacro and \ifHINT
+\ifacroHINT
+\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA}
+\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}%
+ \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={}
+ \toksC={}\let\space\empty}\makenote}\maketoks}}
+\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+\ifHINT\else\sanitizecommand\to{..}\fi % a trivial example; requires \addtokens
+\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}%
+ \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}}
+\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|%
+ \ifnum\countB>`9 \countB=0 \fi
+ \ifnum\countB<`0
+ \ifnum0=\countC\else\makenote\fi
+ \ifx\first.\let\next=\maketoksdone\else
+ \let\next=\maketoks
+ \addtokens\toksB{\the\toksD}
+ \ifx\first,\addtokens\toksB{\space}\fi
+ \fi
+ \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks
+ \fi
+ \next
+}
+\def\makenote{\addtokens\toksB
+ {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0}
+\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % End of common macros
+
+\def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
+ attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
+ << /S /URI /URI (#2) >> }\PDFlinkcolor #1\Black \pdfendlink
+ \else\ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
+ \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
+ \space depth \thedepth\space << /Border [0 0 0]
+ /Type /Action /Subtype /Link /A << /S /URI /URI (#2) >> >>}\box0\relax}%
+ \else #1 ({\tt#2})\fi\fi}
+{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
+{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
+
\def\lapstar{\rlap{*}}
\def\stsec{\rightskip=0pt % get out of Pascal mode (cf. \P)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
+ \ifHINT\HINTlabel\fi% Start page before section
\noindent{\let\*=\lapstar\bf\modstar.\quad}%
\ifacro \smash{\raise\baselineskip\hbox to0pt{\let\*=\empty
\ifpdftex \pdfdest num \modstar fith%
@@ -265,7 +291,7 @@
\let\W=\land % logical and
\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name
\XX$\langle\,$#2{\eightrm\kern.5em
- \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
+ \ifacroHINT{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
\def\Y{\par\yskip}
\let\Z=\let % now you can \send the control sequence \Z
\def\){\hbox{\.{@\$}}} % sign for string pool check sum
@@ -345,7 +371,9 @@
\vsize=\pageheight \advance\vsize by -\ht\sbox % the remaining height
\hsize=.5\pagewidth \advance\hsize by -10pt
% column width for the index (20pt between cols)
+ \ifHINT\else
\parfillskip 0pt plus .6\hsize % try to avoid almost empty lines
+ \fi
\def\lr{L} % this tells whether the left or right column is next
\output{\if L\lr\global\setbox\lbox=\page \gdef\lr{R}
\else\normaloutput{\vbox to\pageheight{\box\sbox\vss
@@ -354,7 +382,7 @@
\message{Index:}
\parskip 0pt plus .5pt
\outer\def\:##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
- \ifacro\pdfnote##2.\else##2\fi.} % index entry
+ \ifacroHINT\pdfnote##2.\else##2\fi.} % index entry
\let\ttentry=\. \def\.##1{\ttentry{##1\kern.2em}} % give \tt a little room
\def\[##1]{$\underline{##1}$} % underlined index item
\rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar
@@ -369,7 +397,7 @@
\message{Section names:}
\output={\normaloutput\page\lheader\rheader}
\setpage
- \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
+ \def\note##1##2.{\quad{\eightrm##1~\ifacroHINT{\pdfnote##2.}\else{##2}\fi.}}
\linepenalty=10 % try to conserve lines
\def\U{\note{Used in section}} % crossref for use of a section
\def\Us{\note{Used in sections}} % crossref for uses of a section
@@ -404,15 +432,20 @@
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
+ \ifHINT\HINThome\fi% Mark the Table of contents as home page
\topofcontents \startpdf
- \line{\hfil Section\hbox to3em{\hss Page}}
+ \line{\hfil Section\ifHINT\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\Z=\contentsline
\readcontents\relax % read the contents info
\botofcontents \end} % print the contents page(s) and terminate
\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}}}
+ \ \ifHINT
+ \HINTlink{#2}{\romannumeral#2}% No page numbers in HINT
+ \HINTcontents{#1}{#2}{#3}%
+ \else\ifacro\pdflink{#2}{\romannumeral#2}\else#2\fi
+ \hbox to3em{\hss#3}\fi}}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi