texlive[63501] Master/texmf-dist: pwebmac (6jun22)
commits+karl at tug.org
commits+karl at tug.org
Mon Jun 6 22:30:44 CEST 2022
Revision: 63501
http://tug.org/svn/texlive?view=revision&revision=63501
Author: karl
Date: 2022-06-06 22:30:44 +0200 (Mon, 06 Jun 2022)
Log Message:
-----------
pwebmac (6jun22)
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 2022-06-06 20:30:23 UTC (rev 63500)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/README.md 2022-06-06 20:30:44 UTC (rev 63501)
@@ -21,7 +21,7 @@
[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 amd the collection
+of PDF documents can be browsed in the `knuth-pdf` package and the collection
of HINT documents are available in the `knuth-hint` package.
WEB programmers who want to use `pwebmac.tex` instead of the default
@@ -34,4 +34,4 @@
The `pwebmac` package is free software and may be used without constraints.
-This is version “4.7” of the `pwebmac` package — 2022-02-05, Andreas Scherer.
+This is version “4.8” of the `pwebmac` package — 2022-06-05, Andreas Scherer.
Modified: trunk/Master/texmf-dist/doc/plain/pwebmac/makeall
===================================================================
--- trunk/Master/texmf-dist/doc/plain/pwebmac/makeall 2022-06-06 20:30:23 UTC (rev 63500)
+++ trunk/Master/texmf-dist/doc/plain/pwebmac/makeall 2022-06-06 20:30:44 UTC (rev 63501)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
PROG=$(basename $0)
@@ -18,7 +18,7 @@
-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,{hi,pdf,xe}tex}
+ -t, --tex ARG Use TeX variant ARG=[(hi|pdf|xe)]tex
Public domain. Originally written by Andreas Scherer, 2020.
HELP
@@ -87,14 +87,14 @@
CTWILL="ctwill -f +lpdf"
PAX="pax -wvzf"
SED_I="sed -i" # non-GNU-sed requires an extra '' argument for '-i' option.
-PDF=pdf
+PDF=pdf # default extension for 'knuth-pdf'
+HITEX="hitex --compress"
# HINT format
if [ hitex = $TEX ]
then
- $TEX -ini -jobname=hitex tex.ini
- TEX="hitex --compress"
- PDF=hnt
+ TEX="$HITEX"
+ PDF=hnt # default extension for 'knuth-hint'
fi
# WEB and CWEB programs we want to get formatted
@@ -231,12 +231,21 @@
# FIX: pdfTeX uses '\pdfTeX' in section names; these should
# appear correctly in the bookmarks, too.
pdftex )
- if $NEW && [ tex != "$TEX" ] && [[ ! $TEX =~ hitex ]]
+ if $NEW && [ tex != "$TEX" ] && [ "$HITEX" != "$TEX" ]
then
$SED_I -e "s/\(\\\\def\\\\pdfTeX{pdf\\\\TeX}\)/\1 \\\\sanitizecommand\\\\pdfTeX{pdfTeX}\\\\sanitizecommand\\\\eTeX{e-TeX}/" \
$f.tex
fi ;;
+ # FIX: weave uses '\max' in name of module 173; this should
+ # appear correctly in the bookmarks, too.
+ weave )
+ if $NEW && [ tex != "$TEX" ] && [ "$HITEX" != "$TEX" ]
+ then
+ $SED_I -e "s/\(\\\\def\\\\({}\)/\\\\sanitizecommand\\\\max{max}\n\1/" \
+ $f.tex
+ fi ;;
+
# FIX: purge obsolete macros from XeTeX.
xetex ) $SED_I -e "/\\\\input xewebmac/d" $f.tex ;;
esac
@@ -264,11 +273,9 @@
then $f $f
elif [ ctwill = $f ]
then
- if [[ $TEX =~ hitex ]]
- then
- CTWILLTEX=pdftex
- else
- CTWILLTEX="$TEX"
+ if [ "$HITEX" = "$TEX" ]
+ then CTWILLTEX=pdftex
+ else CTWILLTEX="$TEX"
fi
$CTWILLTEX $f
# sort mini-indexes
@@ -280,7 +287,7 @@
fi
done
-if ( $PDFTOCFRONT || [[ $TEX =~ hitex ]] ) && ! $FILESELECT
+if ( $PDFTOCFRONT || [ "$HITEX" = "$TEX" ] ) && ! $FILESELECT
then
# create tarballs w/o changes for publication
if $CHANGES
@@ -292,7 +299,7 @@
esac
mv $f $(basename $f .$PDF)-changes.$PDF
done
- if [[ $TEX =~ hitex ]]
+ if [ "$HITEX" = "$TEX" ]
then
rm -f xetex-changes.pdf
mv xetex.pdf xetex-changes.pdf
@@ -349,6 +356,11 @@
# Prepare 'cwebman' with footnotes describing the extended CWEB.
f=$(kpsewhich -engine tex cwebman)
tie -m $(basename $f) $f $(basename $f .tex)-w2c.ch
+ if [ "$HITEX" = "$TEX" ]
+ then
+ $SED_I -e "s/\(\\\\input cwebmac\)/\1\n\\\\input hiplainpage/" \
+ cwebman.tex
+ fi
touch pages.tex # let 'manmac' produce output at all
Modified: trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
===================================================================
--- trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex 2022-06-06 20:30:23 UTC (rev 63500)
+++ trunk/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex 2022-06-06 20:30:44 UTC (rev 63501)
@@ -18,10 +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\ifhint
+\ifx\HINTversion\undefined \hintfalse \else \hinttrue \fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
-\newif\ifacroHINT \ifacro\acroHINTtrue\fi \ifHINT\acroHINTtrue\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
@@ -85,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~\ifacroHINT{\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
@@ -175,7 +175,7 @@
\outlinest\let\outlinedone=\relax}
\fi % End of pdf macros
-\ifHINT
+\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
@@ -191,14 +191,14 @@
\let\pdflink=\HINTlink
\fi % End of HINT macros
-% Common macros for \ifacro and \ifHINT
-\ifacroHINT
+% 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
+\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|%
@@ -233,7 +233,7 @@
\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
+ \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%
@@ -291,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
- \ifacroHINT{\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
@@ -371,7 +371,7 @@
\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
+ \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
@@ -382,7 +382,7 @@
\message{Index:}
\parskip 0pt plus .5pt
\outer\def\:##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
- \ifacroHINT\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
@@ -397,7 +397,7 @@
\message{Section names:}
\output={\normaloutput\page\lheader\rheader}
\setpage
- \def\note##1##2.{\quad{\eightrm##1~\ifacroHINT{\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
@@ -432,9 +432,9 @@
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
- \ifHINT\HINThome\fi% Mark the Table of contents as home page
+ \ifhint\HINThome\fi% Mark the Table of contents as home page
\topofcontents \startpdf
- \line{\hfil Section\ifHINT\else\hbox to3em{\hss Page}\fi}% No Page in HINT
+ \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
@@ -441,7 +441,7 @@
\def\contentsline#1#2#3#4{%
\line{\ignorespaces#1
\rm\leaders\hbox to .5em{.\hfil}\hfil
- \ \ifHINT
+ \ \ifhint
\HINTlink{#2}{\romannumeral#2}% No page numbers in HINT
\HINTcontents{#1}{#2}{#3}%
\else\ifacro\pdflink{#2}{\romannumeral#2}\else#2\fi
More information about the tex-live-commits
mailing list.