diff options
author | Karl Berry <karl@freefriends.org> | 2024-05-24 20:59:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-05-24 20:59:45 +0000 |
commit | afaa34285d21cc717c5224d034160d1c4eba7c62 (patch) | |
tree | 88d32aed143c9a482f7483773989f98168c7953a /Master/texmf-dist | |
parent | 450183b6d5d3a625ca06bebbc2a493ccc079d2d7 (diff) |
pwebmac (23may24)
git-svn-id: svn://tug.org/texlive/trunk@71345 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/index.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/plain/pwebmac/makeall | 66 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex | 18 |
4 files changed, 61 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/plain/pwebmac/README.md b/Master/texmf-dist/doc/plain/pwebmac/README.md index e85b89cbc43..f2554f6fb9c 100644 --- a/Master/texmf-dist/doc/plain/pwebmac/README.md +++ b/Master/texmf-dist/doc/plain/pwebmac/README.md @@ -38,4 +38,4 @@ file), and `hitex` creates HINT output that can be viewed with the The `pwebmac` package is free software and may be used without constraints. -This is version **4.11** of the `pwebmac` package — 2023-12-02, Andreas Scherer. +This is version **4.12** of the `pwebmac` package — 2024-05-24, Andreas Scherer. diff --git a/Master/texmf-dist/doc/plain/pwebmac/index.md b/Master/texmf-dist/doc/plain/pwebmac/index.md index 90ddc7d1312..711e0c2ba92 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 2023 +title: C/WEB programs in \TeX\ Live colorlinks: true filecolor: blue urlcolor: blue @@ -87,6 +87,7 @@ directly. * `ctie/` \[ [`CTIE`](ctie/ctie.pdf)+[`chg`](ctie/ctie-changes.pdf) \] * `tie/` \[ [`TIE`](tie/tie.pdf)+[`chg`](tie/tie-changes.pdf) \] * `hitex/` \[ [`HiTeX`](hitex/hitex.pdf) \] +* `mp/` \[ [`MetaPost`](mp/mp.pdf) \] ## Errata for “Computers & Typesetting” by Donald E.\ Knuth @@ -108,4 +109,4 @@ directly. ## Happy C/WEB Programming! -2023-12-02 Andreas Scherer +2024-05-20 Andreas Scherer diff --git a/Master/texmf-dist/doc/plain/pwebmac/makeall b/Master/texmf-dist/doc/plain/pwebmac/makeall index b5b53ff72ee..6be5b6e91a2 100644 --- a/Master/texmf-dist/doc/plain/pwebmac/makeall +++ b/Master/texmf-dist/doc/plain/pwebmac/makeall @@ -46,7 +46,7 @@ KNUTHWARE=$(dirname $KNUTHWHERE) FILES="$KNUTHWARE/*.web pdftex.web xetex.web twill" WEBINPUTS=$KNUTHWARE//: -FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie hitex" +FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie hitex mp" CWEBINPUTS=$KNUTHWARE//: KNUTHWHERE=$(locate /glue.web) @@ -92,7 +92,8 @@ HITEX="hitex --compress" PAX="pax -wvzf" PDF=pdf # default extension for 'knuth-pdf' SED_I="sed -i" # non-GNU-sed requires an extra '' argument for '-i' option. -WEAVE="weave" +WEAVE=weave +XETEX=xetex case "$TEX" in hitex ) # HINT format @@ -105,6 +106,10 @@ case "$TEX" in pdftex | luatex ) # actually only necessary for 'pwebmac.tex' VALID=true ;; + tex ) # plain TeX + XETEX="$XETEX --no-pdf" # XeTeX's extended DVI format + VALID=false ;; + * ) VALID=false ;; # plain TeX and XeTeX use different approach esac @@ -126,10 +131,26 @@ for f in $FILES do f=$(basename $f .web) - if $CHANGES && echo $f | grep -v -q -E 'twill|glue|hitex' - # These are changes in and of themselves + case $f in + pdftex ) # Fix several 'Overfull \hbox'es + tie -m $f.web $f.web /opt/github/web/$f.ch ;; + + hitex | mp ) # Beautifications for 'hitex.w' and 'mp.w' + tie -m $f.w $f.w /opt/github/web/$f.ch ;; + + weave | twill ) + cp $KNUTHWARE/weave.web . + if [ "$HITEX" = "$TEX" ] # Fix non-constant factor + then $SED_I -e "s/\\\\the\\\\hsize/460pt/" weave.web + fi ;; + esac + + if $CHANGES then case $f in + # These are changes in and of themselves + ctwill | twill | glue | hitex | mp ) continue ;; + # CWEB programs have individual changefiles common ) $CWEAVE $f comm-w2c ;; ctangle ) $CWEAVE $f ctang-w2c ;; @@ -140,7 +161,7 @@ do # main WEB programs have complex change files tex | mf | pdftex | xetex ) - WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS: \ + WEBINPUTS=.:$KNUTHWARE/../../Work//:$WEBINPUTS: \ $WEAVE $f $f-final # FIX: XeTeX uses '\pdfTeX' from section 114, @@ -168,22 +189,27 @@ do $CTWILL $f # prime the pump $CTWILL $f ;; # get decent answers - c* | refsort | twinx | tie | hitex ) $CWEAVE $f ;; + c* | refsort | twinx | tie ) $CWEAVE $f ;; + + hitex | mp ) CWEBINPUTS=.: $CWEAVE $f ;; twill ) + WEBINPUTS=.:$WEBINPUTS \ tie -m $f.web weave.web weave.ch weav-$f.ch - $WEAVE $f ;; + WEBINPUTS=.: $WEAVE $f ;; + + pdftex | weave ) WEBINPUTS=.: $WEAVE $f ;; * ) $WEAVE $f ;; esac fi # 'pwebmac' is for WEB only; do nothing for CWEB programs - if $NEW && echo $f | grep -v -q -E '^c|refsort|twinx|tie|hitex' + if $NEW && echo $f | grep -v -q -E '^c|refsort|twinx|tie|hitex|mp' then # timestamp on table-of-contents page or the first page case $f in - bibtex | patgen | tangle | weave ) + bibtex | patgen | tangle | weave | twill ) $SED_I -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;; mf | tex | pdftex | xetex ) @@ -259,7 +285,7 @@ FI xetex ) $SED_I -e "/\\\\input xewebmac/d" $f.tex ;; # timestamp on table-of-contents page or the first page - hitex ) $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex ;; + hitex | mp ) $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex ;; esac # shift table-of-contents pages to the front in PDF @@ -269,7 +295,7 @@ FI # only XeTeX can process XETEX.WEB if [ xetex = $f ] - then $f $f # run TeX twice + then $XETEX $f # run XeTeX twice else $TEX $f # run TeX twice fi @@ -280,13 +306,12 @@ FI fi case $f in - xetex ) $f $f ;; # only XeTeX can process XETEX.WEB + xetex ) $XETEX $f ;; # only XeTeX can process XETEX.WEB ctwill ) # gives two different outcomes if [ "$HITEX" = "$TEX" ] # sort mini-indexes then # directly in the TeX file - ctwill-proofsort < $f.tex > $f-sorted.tex - mv $f-sorted.tex $f.tex + ( ctwill-proofsort < $f.tex ) 1<> $f.tex else # in the TeX-created .ref file $TEX $f ctwill-refsort < $f.ref > $f.sref @@ -306,8 +331,7 @@ then then for f in *.$PDF do - case $f in - *-changes.$PDF ) rm -f $f; continue ;; + case $f in *-changes.$PDF ) rm -f $f; continue ;; esac mv $f $(basename $f .$PDF)-changes.$PDF done @@ -375,17 +399,14 @@ then touch pages.tex # let 'manmac' produce output at all for f in tripman trapman webman cwebman - do - $TEX $f + do $TEX $f done $TEX -jobname=errorlog /opt/github/web/Xerrorlog.tex for f in one two three four five six seven eight nine ten \ eleven twelve - do - $TEX errata.$f - mv errata.$PDF errata.$f.$PDF + do $TEX -jobname errata.$f errata.$f done $TEX errata @@ -406,6 +427,7 @@ then $PAX "$OUTDIR/other.tar.gz" -s ,^,other/, \ dvicopy.$PDF patgen.$PDF pktogf.$PDF pktype.$PDF $PAX "$OUTDIR/hitex.tar.gz" -s ,^,hitex/, hitex.$PDF + $PAX "$OUTDIR/mp.tar.gz" -s ,^,mp/, mp.$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 @@ -420,7 +442,7 @@ then # (a) pandoc index.md -o index.pdf # (b) pandoc index.md -o index.tex; # pandoc index.tex -s -o index.html \ - # --metadata title="C/WEB programs in TeX Live 2023"; + # --metadata title="C/WEB programs in TeX Live"; # rm index.tex # (2) Prepare a super-tarball from all the contents of these # individual tarballs (42/53 and 34/54) with either of diff --git a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex index a7bdc717b9e..01bba0e19f3 100644 --- a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex +++ b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex @@ -5,7 +5,7 @@ % 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+PWEBMAC4.11} +\xdef\fmtversion{\fmtversion+PWEBMAC4.12} \parskip 0pt % no stretch between paragraphs \parindent 1em % for paragraphs and for the first line of Pascal text @@ -351,8 +351,16 @@ \def\title{\expandafter\uppercase\expandafter{\jobname}} \def\topofcontents{\centerline{\titlefont\title}\vskip.7in \vfill} % this material will start the table of contents page -\def\startpdf{\ifpdf \ifpdflua\pdfcatalog{/PageMode /UseOutlines} - \else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi} +\def\startpdf{\ifpdf\def\pagemode{/PageMode /UseOutlines} + \ifnum\contentspagenumber=0 \advance \pageno by -1 + \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St 1 >> + \the\pageno << /P(Contents) >> ] >>} + \else \twodigits=\pageno \pageno=\contentspagenumber + \advance \pageno by 1 \advance \twodigits by -\pageno + \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St \the\pageno >> + \the\twodigits << /S/D/St \contentspagenumber >> ] >>} \fi + \ifpdflua\pdfcatalog{\pagemode\space\pagelabels} + \else \special{pdf: docview << \pagemode\space\pagelabels >>}\fi\fi} \def\botofcontents{\vfill \centerline{\covernote}} % this material will end the table of contents page \def\covernote{} @@ -452,12 +460,12 @@ % \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers \rightskip 0pt \hyphenpenalty 50 \tolerance 200 \setpage \output={\normaloutput\page\lheader\rheader} - \titletrue % prepare to output the table of contents + \startpdf \titletrue % prepare to output the table of contents \pageno=\contentspagenumber \def\grouptitle{TABLE OF CONTENTS} \message{Table of contents:} \ifhint\HINThome\fi% Mark the Table of contents as home page - \topofcontents \startpdf + \topofcontents \line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT \let\Z=\contentsline \readcontents\relax % read the contents info |