texlive[71345] Master/texmf-dist: pwebmac (23may24)

commits+karl at tug.org commits+karl at tug.org
Fri May 24 22:59:45 CEST 2024


Revision: 71345
          https://tug.org/svn/texlive?view=revision&revision=71345
Author:   karl
Date:     2024-05-24 22:59:45 +0200 (Fri, 24 May 2024)
Log Message:
-----------
pwebmac (23may24)

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/tex/plain/pwebmac/pwebmac.tex

Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/README.md	2024-05-24 20:59:31 UTC (rev 71344)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/README.md	2024-05-24 20:59:45 UTC (rev 71345)
@@ -38,4 +38,4 @@
 
 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.

Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/index.md
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/index.md	2024-05-24 20:59:31 UTC (rev 71344)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/index.md	2024-05-24 20:59:45 UTC (rev 71345)
@@ -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 @@
 * `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 @@
 
 ## Happy C/WEB Programming!
 
-2023-12-02 Andreas Scherer
+2024-05-20 Andreas Scherer

Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/makeall
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/makeall	2024-05-24 20:59:31 UTC (rev 71344)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/makeall	2024-05-24 20:59:45 UTC (rev 71345)
@@ -46,7 +46,7 @@
 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 @@
 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 @@
 	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 @@
 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 @@
 
 			# 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 @@
 				$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 @@
 		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 @@
 
 		# 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
 
 	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
 		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,8 +399,7 @@
 		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
@@ -383,9 +406,7 @@
 
 		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 @@
 		$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 @@
 	#     (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

Modified: trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
===================================================================
--- trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex	2024-05-24 20:59:31 UTC (rev 71344)
+++ trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex	2024-05-24 20:59:45 UTC (rev 71345)
@@ -5,7 +5,7 @@
 % macro integration \`a la CWEB by Andreas Scherer <andreas_tex at 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



More information about the tex-live-commits mailing list.