summaryrefslogtreecommitdiff
path: root/web/pwebmac/makeall
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-06-27 03:04:10 +0000
committerNorbert Preining <norbert@preining.info>2022-06-27 03:04:10 +0000
commit2f80535c778eacefb7c73b39d2cb4f877f3d3341 (patch)
treea0302e003e8f22f0e9acec58956210d908baafd8 /web/pwebmac/makeall
parent49d5e8cc281cf2335112eb5488cd83afd96eeb04 (diff)
CTAN sync 202206270304
Diffstat (limited to 'web/pwebmac/makeall')
-rwxr-xr-xweb/pwebmac/makeall19
1 files changed, 15 insertions, 4 deletions
diff --git a/web/pwebmac/makeall b/web/pwebmac/makeall
index eeed9c76bc..0f857db24f 100755
--- a/web/pwebmac/makeall
+++ b/web/pwebmac/makeall
@@ -19,13 +19,14 @@ Options are (--long options only with GNU getopt):
-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=[(hi|pdf|xe)]tex
+ -v, --validpdf Use correct number of entries in NOS node
Public domain. Originally written by Andreas Scherer, 2020.
HELP
}
-LONGOPTS=changes,files:,help,new,outdir:,pdftocfront,tex:
-SHRTOPTS=cf:hno:pt:
+LONGOPTS=changes,files:,help,new,outdir:,pdftocfront,tex:,validpdf
+SHRTOPTS=cf:hno:pt:v
CHANGES=false # apply changefile to C/WEB source
FILESELECT=false # user-defined '--files' selection
@@ -33,6 +34,7 @@ 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' or 'hitex'
+VALID=false # give 'pdftex' a chance to produce valid output
# Initial list of C/WEB sources to process, overridable with option '-f':
KNUTHWHERE=$(locate /bibtex.web)
@@ -78,6 +80,7 @@ do
-o | --outdir ) OUTDIR="$2"; shift 2 ;;
-p | --pdftocfront ) PDFTOCFRONT=true; shift ;;
-t | --tex ) TEX=$2; shift 2 ;;
+ -v | --validpdf ) VALID=true; shift ;;
-- ) shift; break ;;
* ) usage; exit 1 ;;
esac
@@ -97,6 +100,13 @@ then
PDF=hnt # default extension for 'knuth-hint'
fi
+# Valid PDF output from 'pdftex': In 'pwebmac.tex' set '\countD' to the actual
+# number of @<named modules@>, not the number of all sections.
+if ( [ pdftex = $TEX ] && $VALID )
+then
+ TEX="$TEX --shell-escape"
+fi
+
# WEB and CWEB programs we want to get formatted
for f in $FILES
do
@@ -185,7 +195,7 @@ do
# active links in PDF outlines/bookmarks
cat > texmf-pdf.patch << FI
- \ifacro{\toksF={}\makeoutlinetoks{[#2] #3}\outlinedone\outlinedone}\fi
+ \ifpdf{\toksF={}\makeoutlinetoks{[#2] #3}\outlinedone\outlinedone}\fi
FI
$SED_I -e "/\\\\outer\\\\def\\\\N/ {
r texmf-pdf.patch
@@ -194,8 +204,9 @@ FI
$SED_I -e "s/{\\\\the\\\\pageno}}}\\\\next/{\\\\the\\\\pageno}{\\\\the\\\\toksE}}}\\\\next/" $f.tex
cat > texmf-pdf.patch << FI
+ \ifpdftex\relax\else
\ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest
- [ @thispage /FitH @ypos ] >>}\fi
+ [ @thispage /FitH @ypos ] >>}\fi\fi
FI
$SED_I -e "/ \\\\edef\\\\next/ {
r texmf-pdf.patch