diff options
Diffstat (limited to 'web/pwebmac/makeall')
-rwxr-xr-x | web/pwebmac/makeall | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/web/pwebmac/makeall b/web/pwebmac/makeall index 0f857db24f..05f8178589 100755 --- a/web/pwebmac/makeall +++ b/web/pwebmac/makeall @@ -33,7 +33,7 @@ FILESELECT=false # user-defined '--files' selection 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' +TEX=tex # or 'pdftex' or 'xetex' or 'hitex' or 'luatex' VALID=false # give 'pdftex' a chance to produce valid output # Initial list of C/WEB sources to process, overridable with option '-f': @@ -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" +FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie hitex" CWEBINPUTS=$KNUTHWARE//: KNUTHWHERE=$(locate /glue.web) @@ -94,15 +94,17 @@ PDF=pdf # default extension for 'knuth-pdf' HITEX="hitex --compress" # HINT format -if [ hitex = $TEX ] +if [ hitex = "$TEX" ] then + CTWILL="$CTWILL +P" TEX="$HITEX" PDF=hnt # default extension for 'knuth-hint' + PDFTOCFRONT=false # use 'hintview -h' to start with TOC page 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 ) +if ( [ pdftex = "$TEX" ] && $VALID ) then TEX="$TEX --shell-escape" fi @@ -115,7 +117,10 @@ do if [ ctwill = $f ] then # apply tons of editorial changes to 'ctwill.w' - ctie -m $f.w cweave.w $f-w2c.ch $f-mini.ch + if [ "$HITEX" = "$TEX" ] + then ctie -m $f.w cweave.w $f-w2c.ch $f-hint.ch + else ctie -m $f.w cweave.w $f-w2c.ch $f-mini.ch + fi cp -an $KNUTHWARE/cwebdir/*.bux . $CTWILL $f # prime the pump $CTWILL $f # get decent answers @@ -129,6 +134,10 @@ do then weave $f # no 'glue.ch' at this time + elif [ hitex = $f ] + then + cweave $f # no 'hitex.ch' at this time + elif $CHANGES then case $f in @@ -148,6 +157,9 @@ do # TWILL is a change in and of itself twill ) ;; + # HiTeX is a stand-alone version of TeX + hitex ) ;; + # all other WEB codes have singular changefiles * ) weave $f $f ;; esac @@ -165,7 +177,7 @@ do $f.tex else case $f in - c* | refsort | twinx | tie ) $CWEAVE $f ;; + c* | refsort | twinx | tie | hitex ) $CWEAVE $f ;; * ) weave $f ;; esac fi @@ -180,6 +192,9 @@ do # do nothing for CWEB programs c* | refsort | twinx | tie ) ;; + hitex ) + $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex ;; + bibtex | patgen | tangle | weave ) $SED_I -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;; @@ -204,7 +219,7 @@ FI $SED_I -e "s/{\\\\the\\\\pageno}}}\\\\next/{\\\\the\\\\pageno}{\\\\the\\\\toksE}}}\\\\next/" $f.tex cat > texmf-pdf.patch << FI - \ifpdftex\relax\else + \ifpdflua\relax\else \ifpdf\special{pdf: outline 0 << /Title (\the\toksE) /Dest [ @thispage /FitH @ypos ] >>}\fi\fi FI @@ -262,7 +277,7 @@ FI esac # shift table-of-contents pages to the front in PDF - if $PDFTOCFRONT && [ ctwill != $f ] + if $PDFTOCFRONT && [ ctwill != $f ] && [ hitex != $f ] then $SED_I -e "0,/\\\\N[1{]/s/\(\\\\N[1{]\)/\\\\input pdfwebtocfront\n\n\1/" \ $f.tex @@ -279,19 +294,20 @@ FI fi fi - # only XeTeX can process XETEX.WEB - if [ xetex = $f ] + if [ xetex = $f ] # only XeTeX can process XETEX.WEB then $f $f - elif [ ctwill = $f ] + elif [ ctwill = $f ] # gives two different outcomes then + # sort mini-indexes if [ "$HITEX" = "$TEX" ] - then CTWILLTEX=pdftex - else CTWILLTEX="$TEX" + then # directly in the TeX file + proofsort $f.tex > $f-sorted.tex + mv $f-sorted.tex $f.tex + else # in the TeX-created .ref file + $TEX $f + ctwill-refsort < $f.ref > $f.sref fi - $CTWILLTEX $f - # sort mini-indexes - ctwill-refsort < $f.ref > $f.sref - $CTWILLTEX $f + $TEX $f elif [ refsort = $f ] then $TEX -interaction nonstopmode $f else $TEX $f @@ -406,13 +422,14 @@ then $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.$PDF $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/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 $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.$PDF $PAX "$OUTDIR/cweb.tar.gz" -s ,^,cweb/, \ cwebman.$PDF common.$PDF ctangle.$PDF cweave.$PDF \ - ctwill.pdf refsort.$PDF twinx.$PDF + ctwill.$PDF refsort.$PDF twinx.$PDF fi # Notes to self: @@ -420,7 +437,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 2022"; + # --metadata title="C/WEB programs in TeX Live 2023"; # rm index.tex # (2) Prepare a super-tarball from all the contents of these # individual tarballs (42/53 and 34/54) with either of |