texlive[55679] Master/texmf-dist: pwebmac (27jun20)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 27 23:06:35 CEST 2020


Revision: 55679
          http://tug.org/svn/texlive?view=revision&revision=55679
Author:   karl
Date:     2020-06-27 23:06:35 +0200 (Sat, 27 Jun 2020)
Log Message:
-----------
pwebmac (27jun20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/plain/pwebmac/README.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	2020-06-27 21:05:21 UTC (rev 55678)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/README.md	2020-06-27 21:06:35 UTC (rev 55679)
@@ -29,4 +29,4 @@
 
 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.
+This is version “4.5.4” of the `pwebmac` package — 2020-06-27, AS.

Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/makeall
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/makeall	2020-06-27 21:05:21 UTC (rev 55678)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/makeall	2020-06-27 21:06:35 UTC (rev 55679)
@@ -57,8 +57,22 @@
 do
 	f=$(basename $f .web)
 
-	if $CHANGES
+	if [ ctwill = $f ]
 	then
+		# amend TeX Live's 'prod-twill.w' for (c)twill'ing
+		if [ ! -e prod-twill.w ]
+		then
+			tie -m prod-twill.w prod-twill.w prod-mini.ch
+		fi
+		# apply tons of editorial changes to 'ctwill.w'
+		CWEBINPUTS=.:$CWEBINPUTS \
+			ctie -m $f.w cweave.w $f-w2c.ch $f-mini.ch
+		cp -an $KNUTHWARE/cwebdir/*.bux .
+		$CTWILL $f
+		$CTWILL $f
+
+	elif $CHANGES
+	then
 		# pdftex.ch and xetex.ch for TeX Live are assembled here
 		WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS:
 
@@ -66,7 +80,6 @@
 			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 ;;
 
@@ -73,57 +86,64 @@
 			* ) weave $f $f ;;
 		esac
 
+		# FIX: XeTeX uses '\pdfTeX' from section 114, which
+		# is not changed and thus 'disappears'
+		if [ xetex = $f ]
+		then
+			sed -i -e "s/\(\\\\let\\\\maybe\)/\\\\def\\\\pdfTeX{pdf\\\\TeX}\n\1/" \
+				$f.tex
+		fi
+
 		# only document changed modules/sections
+		sed -i -e "s/\(\\\\let\\\\maybe=\)\\\\iftrue/\1\\\\iffalse/" \
+			$f.tex
+	else
 		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 ;;
+			c* | tie ) $CWEAVE $f ;;
 
-			# 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
-			common | ctangle | cweave | ctie | tie ) $CWEAVE $f ;;
-			ctwill ) ;; # do nothing for CTWILL
 			* ) weave $f ;;
 		esac
 	fi
 
-	# 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
+		# use extended WEB macros for TeX Live PDF documentation
 		sed -i -e "1 s/\\\\input webmac/\\\\input pwebmac/" $f.tex
 
 		# timestamp on table-of-contents page or the first page
 		case $f in
+			c* | tie ) ;; # do nothing for CWEB programs
+
 			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 ;;
+				sed -i -e "s/\(\\\\def\\\\botofcontents\)/\\\\datethis\n\1/" $f.tex
 
-			c* | tie ) ;; # do nothing for CWEB programs
+				# amend '\N' redefinition for PDF outlines in
+				# Metafont and TeX (also pdfTeX and XeTeX)
+				# 'pwebmac' defines headers differently
+				sed -i -e "s/\(\\\\outer\\\\def\\\\N.*{\)/\1%/" \
+					 -e "s/\\\\def\\\\rhead\(.*}\)/\\\\gtitle=\1\\\\MN#1.\\\\vfill\\\\eject/" \
+					 $f.tex
 
+				# active links in PDF outlines/bookmarks
+				cat > texmf-pdf.patch << FI
+  \ifacro{\toksF={}\makeoutlinetoks{[#2] #3}\outlinedone\outlinedone}\fi
+FI
+				sed -i -e "/\\\\outer\\\\def\\\\N/ {
+					r texmf-pdf.patch
+					}" $f.tex
+
+				cat > texmf-pdf.patch << FI
+  \ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest
+    [ @thispage /FitH @ypos ] >>}\fi
+FI
+				sed -i -e "/  \\\\edef\\\\next/ {
+					r texmf-pdf.patch
+					}" $f.tex
+				rm texmf-pdf.patch ;;
+
 			* ) sed -i -e "s/\(\\\\def\\\\botofcontents\)/%\1/" \
 				-e "s/  \\\\centerline{\(\\\\hsize\)/\\\\def\\\\covernote{\1/" \
 				-e "s/\(Publishing Company.}}\)}/\1\n\\\\datecontentspage/" \
@@ -137,7 +157,7 @@
 	# FIX: most of the WEB codes will be corrected.
 	sed -i -e "s/\\\\def\\\\titlepage{F}/\\\\titlefalse/" $f.tex
 
-	# special treatment for individual WEB programs
+	# special treatment for individual (C)WEB programs
 	case $f in
 		# purge conflict between bibtex.web and webmac.tex
 		# 'E' no longer free to be active character
@@ -153,56 +173,22 @@
 		# FIX: should be fixed upstream.
 		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 ]
-			then
-				# purge obsolete macros from XeTeX
-				sed -i -e "/\\\\input xewebmac/d" $f.tex
-			fi
-			if $NEW
-			then
-				if [ pdftex = $f ]
-				then
-					# pdfTeX has a looong table-of-contents
-					cat > pdftex.patch << FI
-  \advance\vsize by 4\baselineskip
-  \ifacro\advance\pdfpageheight by 4\baselineskip\fi
-FI
-					sed -i -e "/\\\\def\\\\topofcontents.*/ {
-						r pdftex.patch
-						}"  $f.tex
-				fi
-				# active links in PDF outlines/bookmarks
-				cat > texmf-pdf.patch << FI
-  \ifacro{\toksF={}\makeoutlinetoks{[#2] #3}\outlinedone\outlinedone}\fi
-FI
-				sed -i -e "/\\\\outer\\\\def\\\\N.*/ {
-					r texmf-pdf.patch
-					}" $f.tex
-				cat > texmf-pdf.patch << FI
-  \ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest
-    [ @thispage /FitH @ypos ] >>}\fi
-FI
-				sed -i -e "/  \\\\edef\\\\next.*/ {
-					r texmf-pdf.patch
-					}" $f.tex
-				rm texmf-pdf.patch
-			fi ;;
+		# FIX: purge obsolete macros from XeTeX
+		xetex ) sed -i -e "/\\\\input xewebmac/d" $f.tex ;;
 
-		common | ctangle | cweave | ctie | tie )
-			# Use nicer format for C comments and assignment
+		# Use nicer format for C comments and assignment
+		common | ctangle | cweave | ctie | tie ) # sans ctwill
 			sed -i -e "1 s/\(cwebmac\)/\1\n\\\\input Xcwebmac/" \
 				$f.tex ;;
 	esac
 
-	if $PDFTOCFRONT
+	# shift table-of-contents pages to the front in PDF
+	if $PDFTOCFRONT && [ ctwill != $f ]
 	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 "0,/\\\\N[1{]/s/\(\\\\N[1{]\)/\\\\input pdfwebtocfront\n\n\1/" \
+			$f.tex
 
+		# only XeTeX can process XETEX.WEB
 		if [ xetex = $f ]
 		then $f $f # run TeX twice
 		else $TEX $f # run TeX twice
@@ -209,6 +195,7 @@
 		fi
 	fi
 
+	# only XeTeX can process XETEX.WEB
 	if [ xetex = $f ]
 	then $f $f
 	else $TEX $f
@@ -216,6 +203,7 @@
 
 	if [ ctwill = $f ]
 	then
+		# sort mini-indexes
 		ctwill-refsort < $f.ref > $f.sref
 		$TEX $f
 	fi
@@ -280,8 +268,7 @@
 			-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 \
+		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/,

Modified: trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
===================================================================
--- trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex	2020-06-27 21:05:21 UTC (rev 55678)
+++ trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex	2020-06-27 21:06:35 UTC (rev 55679)
@@ -77,6 +77,7 @@
 \def\7{\Y\6} % forced break and a little extra space
 
 \newskip\intersecskip \intersecskip=12pt minus 3pt % space between sections
+\newtoks\gtitle % title of current major group
 \let\yskip=\smallskip
 \def\to{\mathrel{.\,.}} % double dot, used only in math mode
 \def\note#1#2.{\Y\noindent{\hangindent2em\baselineskip10pt%
@@ -202,9 +203,9 @@
 \let\L=\le % less than or equal sign
 \outer\def\M#1.{\MN#1.\ifon\vfil\penalty-100\vfilneg % beginning of section
   \vskip\intersecskip\startsection\ignorespaces}
-\outer\def\N#1.#2.{\MN#1.\vfil\eject % beginning of starred section
+\outer\def\N#1.#2.{% beginning of starred section
   \ifacro{\toksF={}\makeoutlinetoks#2\outlinedone\outlinedone}\fi
-  \def\rhead{\uppercase{\ignorespaces#2}} % define running headline
+  \gtitle={#2}\MN#1.\vfil\eject % define running headline
   \message{*\modno} % progress report
   \edef\next{\write\cont{\Z{#2}{\modno}% write to contents file
    {\noexpand\the\pageno}}}\next % \Z{title}{sec}{page}
@@ -214,7 +215,7 @@
 \def\MN#1.{\par % common code for \M, \N
   {\xdef\modstar{#1}\let\*=\empty\xdef\modno{#1}}% remove \* from section name
   \ifx\modno\modstar \onmaybe \else\ontrue \fi
-  \mark{{{\tensy x}\modno}{\rhead}}}
+  \mark{{{\tensy x}\modno}{\the\gtitle}}}
 % each \mark is {section reference or null}{group title}
 \def\O#1{\hbox{\rm\char'23\kern-.2em\it#1\/\kern.05em}} % octal constant
 \def\P{\rightskip=0pt plus 100pt minus 10pt % go into Pascal mode
@@ -245,10 +246,12 @@
 
 \def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
 \newif\ifon \newif\iftitle \newif\ifpagesaved
-\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead
+\def\lheader{\mainfont\the\pageno\eightrm\qquad\grouptitle
   \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
+  \grouptitle\qquad\mainfont\the\pageno} % top line on right-hand pages
+\def\grouptitle{\let\i=I\let\j=J\uppercase\expandafter{\expandafter
+                          \taketwo\topmark}}
 \def\topsecno{\expandafter\takeone\topmark}
 \def\takeone#1#2{#1}
 \def\taketwo#1#2{#2}
@@ -264,8 +267,8 @@
       \vfill#1}} % parameter #1 is the page itself
   \global\advance\pageno by1}
 
-\def\rhead{\.{WEB} OUTPUT} % this running head is reset by starred sections
-\mark{\noexpand\nullsec{\rhead}}
+\gtitle={\.{WEB} output} % this running head is reset by starred sections
+\mark{\noexpand\nullsec{\the\gtitle}}
 \def\title{\expandafter\uppercase\expandafter{\jobname}}
 \def\topofcontents{\centerline{\titlefont\title}\vskip.7in
   \vfill} % this material will start the table of contents page
@@ -329,7 +332,7 @@
   \if L\lr\else\null\vfill\eject\fi % finish the current page
   \ifpdftex \makebookmarks \fi % added in Version 4.5
   \parfillskip 0pt plus 1fil
-  \def\rhead{NAMES OF THE SECTIONS}
+  \def\grouptitle{NAMES OF THE SECTIONS}
   \let\topsecno=\nullsec
   \message{Section names:}
   \output={\normaloutput\page\lheader\rheader}
@@ -367,7 +370,7 @@
   \setpage \output={\normaloutput\page\lheader\rheader}
   \titletrue % prepare to output the table of contents
   \pageno=\contentspagenumber
-  \def\rhead{TABLE OF CONTENTS}
+  \def\grouptitle{TABLE OF CONTENTS}
   \message{Table of contents:}
   \topofcontents \startpdf
   \line{\hfil Section\hbox to3em{\hss Page}}



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