diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2021-12-31 09:18:47 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2021-12-31 09:18:47 +0000 |
commit | c46a6d281af96d35e0b0efa75a7aafac88677a8a (patch) | |
tree | 4c8149ef06286c8f9eef2e6cef60db504145a2a9 /Master/texmf-dist/tex | |
parent | 511895771d1cfb45ec54b8d62bacb16302d73c4a (diff) |
[CWEB] Macros for new release 4.6.
git-svn-id: svn://tug.org/texlive/trunk@61452 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/ctproofmac.tex | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/cttwinxmac.tex | 23 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/ctwimac.tex | 38 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/cwebbin/Xcwebmac.tex | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/cwebbin/pdfctwimac.tex | 83 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/cwebbin/pdfwebtocfront.tex | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/plain/cweb/cwebmac.tex | 32 |
7 files changed, 138 insertions, 75 deletions
diff --git a/Master/texmf-dist/tex/plain/cweb/ctproofmac.tex b/Master/texmf-dist/tex/plain/cweb/ctproofmac.tex index 29533b84b4d..c0b4fa65cf6 100644 --- a/Master/texmf-dist/tex/plain/cweb/ctproofmac.tex +++ b/Master/texmf-dist/tex/plain/cweb/ctproofmac.tex @@ -1,8 +1,8 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 3.6 --- May 2000 +% Version 4.5 --- October 2021 % Modified for proofs in CTWILL \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CWEB3.6+PROOFS} +\xdef\fmtversion{\fmtversion+CWEB4.5+PROOFS} \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) @@ -17,6 +17,7 @@ \def\TEX/{\TeX} \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} \def\Cee{\CEE/} % for backward compatibility +\def\Cpp{\CPLUSPLUS/} % for backward compatibility \def\9#1{} \font\eightrm=cmr8 \let\sc=\eightrm % small caps (NOT a caps-and-small-caps font) @@ -107,6 +108,7 @@ \newskip\intersecskip \intersecskip=12pt minus 3pt % space between sections \let\yskip=\smallskip \def\?{\mathrel?} +\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\Y\noindent{\hangindent2em\baselineskip10pt\eightrm#1~#2.\par}} \def\lapstar{\rlap{*}} \def\stsec{\rightskip=0pt % get out of C mode (cf. \B) @@ -159,15 +161,16 @@ \let\R=\lnot % logical not % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant - \hbox{$\def\?{\kern.2em}% - \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant + \hbox{$\def\?{\kern.2em}%$% + \let\ \, % C++ digit separator becomes a little white space + \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex {#1}$}} + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$% \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or \let\W=\land % logical and -\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name +\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name \XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em#1}$\,\rangle$\XX} \def\Y{\par\yskip} \let\Z=\le @@ -176,11 +179,13 @@ %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style -\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style +\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style +\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule \hbox{\strut\kern2pt\.{#1}\kern2pt}} \hrule}\vrule\kern2pt}} % verbatim string +\def\p#1{\cdot 2^{#1}} % power of two (hex exponent) \def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue \newif\ifon \newif\iftitle \newif\ifpagesaved @@ -339,9 +344,6 @@ \def\printtwodigits{\advance\twodigits100 \expandafter\gobbleone\number\twodigits \advance\twodigits-100 } -\def\TeX{{\ifmmode\it\fi - \leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} -\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\datethis{\def\startsection{\leftline{\sc\today\ at \hours}\bigskip \let\startsection=\stsec\stsec}} % say `\datethis' in limbo, to get your listing timestamped before section 1 diff --git a/Master/texmf-dist/tex/plain/cweb/cttwinxmac.tex b/Master/texmf-dist/tex/plain/cweb/cttwinxmac.tex index 99ae6047ab4..30d44496f13 100644 --- a/Master/texmf-dist/tex/plain/cweb/cttwinxmac.tex +++ b/Master/texmf-dist/tex/plain/cweb/cttwinxmac.tex @@ -2,14 +2,14 @@ \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) -\def\TeX{{\ifmmode\it\fi - \hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} \def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \let\mc=\ninerm % medium caps \def\CEE/{{\mc C\spacefactor1000}} \def\UNIX/{{\mc U\kern-.05emNIX\spacefactor1000}} \def\TEX/{\TeX} \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} +\def\Cee{\CEE/} % for backward compatibility +\def\Cpp{\CPLUSPLUS/} % for backward compatibility \def\9#1{} \newdimen\em \em=10pt % this "em" will not change with font size @@ -121,8 +121,6 @@ \def\eightbig#1{{\hbox{$\textfont0=\ninerm\textfont2=\ninesy \left#1\vbox to6.5pt{}\right.\nulldelimiterspace=0pt$}}} -\def\Cee{{\mc C\spacefactor1000}} -\def\UNIX{{\mc UNIX\spacefactor1000}} \font\titlefont=cmr7 scaled\magstep4 % title on the contents page \font\ttitlefont=cmtt10 scaled\magstep2 % typewriter type in title @@ -196,7 +194,7 @@ \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 \noindent\strut{\bf\modno.\quad}} \let\startsection=\stsec -\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format' +\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format' \def\A{\note{See also section}} % xref for doubly defined section name \def\As{\note{See also sections}} % xref for multiply defined section name \def\B{\iftenpoint\ninepoint\fi @@ -207,7 +205,7 @@ \exhyphenpenalty 10000 \global\ind=2 \1\ \unskip} \def\C#1{\5\5\quad$/\ast\,$#1$\,\ast/$} -\def\D{\defin{\#define}} % macro definition +\def\D{\defin{{\rm\#}define}} % macro definition \let\E=\equiv % equivalence sign \def\ET{ and~} % conjunction between two section numbers \def\ETs{, and~} % conjunction between the last two of several section numbers @@ -224,15 +222,16 @@ \let\R=\lnot % logical not % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant - \hbox{${\def\?{\kern.2em}% - \def\${\ell}% long constant + \hbox{${\def\?{\kern.2em}%$% + \let\ \, % C++ digit separator becomes a little white space + \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex #1}$}} + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$% \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or \let\W=\land % logical and -\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name +\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name \XX$\langle\,${#2\sevenrm\kern.5em#1}$\,\rangle$\XX} \def\Y{\par\yskip} \let\Z=\let % now you can \send the control sequence \Z @@ -240,11 +239,13 @@ %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style -\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style +\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style +\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule \hbox{\strut\kern2pt\.{#1}\kern2pt}} \hrule}\vrule\kern2pt}} % verbatim string +\def\p#1{\cdot 2^{#1}} % power of two (hex exponent) \def\normaloutput#1{\shipout\vbox{ \vbox to 3pc{\ifodd\pageno\rightheadline\else\leftheadline\fi\vfill} diff --git a/Master/texmf-dist/tex/plain/cweb/ctwimac.tex b/Master/texmf-dist/tex/plain/cweb/ctwimac.tex index eddd6af3528..df249009256 100644 --- a/Master/texmf-dist/tex/plain/cweb/ctwimac.tex +++ b/Master/texmf-dist/tex/plain/cweb/ctwimac.tex @@ -1,9 +1,9 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 3.6 --- May 2000 +% Version 4.5 --- October 2021 % modified for pages produced by CTWILL % further modified for page size of the MMIXware book -\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CTWILL3.6+LNCS} +\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros +\xdef\fmtversion{\fmtversion+CTWILL4.5+LNCS} \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) @@ -17,8 +17,8 @@ \newwrite\reffile \ifx\norefs\def\else \openin\sreffile=\jobname.sref - \ifeof\sreffile \immediate\openout\reffile=\jobname.ref \sortedfalse - \message{This is the first pass!} + \ifeof\sreffile \immediate\openout\reffile=\jobname.ref + \sortedfalse \message{This is the first pass!} \else \sortedtrue \message{This is the second pass!} \fi \fi @@ -29,6 +29,7 @@ \def\TEX/{\TeX} \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} \def\Cee{\CEE/} % for backward compatibility +\def\Cpp{\CPLUSPLUS/} % for backward compatibility \def\9#1{} \font\eightrm=cmr8 \font\sixrm=cmr6 @@ -211,13 +212,14 @@ \def\6{\ifmmode\else\par % forced break \hangindent\ind\em\noindent\kern\ind\em\copy\bakk\ignorespaces\fi} \def\7{\Y\6} % forced break and a little extra space -\def\8{\hskip-\ind em\hskip 2\em} % no indentation +\def\8{\hskip-\ind\em\hskip 2\em} % no indentation \newcount\gdepth % depth of current major group, plus one \newtoks\gtitle % title of current major group \newskip\intersecskip \intersecskip=12pt minus 3pt % space between sections \let\yskip=\smallskip \def\?{\mathrel?} +\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\par\penalty5000 \Y\noindent{\hangindent2\em\baselineskip10pt\eightrm#1~#2.\par}} \def\lapstar{\rlap{*}} @@ -227,7 +229,7 @@ \def\startsection{\titletrue \line{\smash{\titlefont\title}\quad\hrulefill}\bigskip \let\startsection=\stsec\stsec} -\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format' +\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format' \def\A{\note{See also section}} % xref for doubly defined section name \def\As{\note{See also sections}} % xref for multiply defined section name \def\B{\iftenpoint\ninepoint\fi @@ -241,7 +243,7 @@ \let\SHC\C % "// short comments" treated like "/* ordinary comments */" %\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$} %\def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}} -\def\D{\defin{\#define}} % macro definition +\def\D{\defin{{\rm\#}define}} % macro definition \let\E=\equiv % equivalence sign \def\ET{ and~} % conjunction between two section numbers \def\ETs{, and~} % conjunction between the last two of several section numbers @@ -258,7 +260,8 @@ \else\ifdim\ht\partialpage<\pageht \leftfalse\else\lefttrue\fi\fi\NNN} \outer\def\NN{\ifvoid\partialpage\leftfalse \else\ifdim\ht\partialpage<\pageht \lefttrue\else\leftfalse\fi\fi\NNN} -\outer\def\NNN#1#2#3.{\gdepth=#1\gtitle={#3}\def\secno{#2}% starred section +\outer\def\NNN#1#2#3.{% beginning of starred section + \gdepth=#1\gtitle={#3}\def\secno{#2} \ifleft \flushout \gdef\rlhead{\let\i=I\uppercase{\ignorespaces#3}} % running left headline \global\let\rrhead=\rlhead % running right headline @@ -275,15 +278,16 @@ \let\R=\lnot % logical not % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant - \hbox{$\def\?{\kern.2em}% - \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant + \hbox{$\def\?{\kern.2em}%$% + \let\ \, % C++ digit separator becomes a little white space + \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex {#1}$}} + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$% \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or \let\W=\land % logical and -\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name +\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name \XX$\langle\,${\let\I=\ne#2\sevenrm\kern.5em#1}$\,\rangle$\XX} \def\Y{\par\yskip} \let\Z=\le @@ -292,15 +296,13 @@ %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style -\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style +\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style +\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule \hbox{\strut\kern2pt\.{#1}\kern2pt}} \hrule}\vrule\kern2pt}} % verbatim string - -\def\TeX{{\ifmmode\it\fi - \leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} -\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} +\def\p#1{\cdot 2^{#1}} % power of two (hex exponent) % now here's the mini-index formatting control \newcount\nrefs % total number of references in partial page diff --git a/Master/texmf-dist/tex/plain/cweb/cwebbin/Xcwebmac.tex b/Master/texmf-dist/tex/plain/cweb/cwebbin/Xcwebmac.tex index c2a8b4115ad..b6467052400 100644 --- a/Master/texmf-dist/tex/plain/cweb/cwebbin/Xcwebmac.tex +++ b/Master/texmf-dist/tex/plain/cweb/cwebbin/Xcwebmac.tex @@ -26,12 +26,11 @@ % Version 3.64 [p21] --- Andreas Scherer, Octobre 2005 % Version 3.64 [2018] --- Andreas Scherer, Octobre 2018 % Version 3.64 [2020] --- Andreas Scherer, May 2020 +% Version 4.3 [2021] --- Andreas Scherer, April 2021 \ifx\undefined\botofcontents\input cwebmac.tex\fi -\xdef\fmtversion{\fmtversion[2020]} - -\def\Cpp{\CPLUSPLUS/} % for backward compatibility +\xdef\fmtversion{\fmtversion[2021]} \font\tenss=cmss10 \let\cmntfont\tenss % comment font diff --git a/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfctwimac.tex b/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfctwimac.tex index 346b24095d9..cb6804e8545 100644 --- a/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfctwimac.tex +++ b/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfctwimac.tex @@ -1,11 +1,11 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.0 --- February 2021 +% Version 4.5 --- October 2021 % modified for pages produced by CTWILL % further modified for page size of the MMIXware book % modified for PDF output with 'tex "\let\pdf+', 'pdftex', and 'xetex' % This file is not copyrighted and can be used freely. \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CTWILL4.0+LNCS+PDF} +\xdef\fmtversion{\fmtversion+CTWILL4.5+LNCS+PDF} \newif\ifpdf \ifx\pdf+\pdftrue\fi @@ -45,6 +45,7 @@ \def\TEX/{\TeX} \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} \def\Cee{\CEE/} % for backward compatibility +\def\Cpp{\CPLUSPLUS/} % for backward compatibility \def\9#1{} \font\eightrm=cmr8 \font\sixrm=cmr6 @@ -234,6 +235,7 @@ \newskip\intersecskip \intersecskip=12pt minus 3pt % space between sections \let\yskip=\smallskip \def\?{\mathrel?} +\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\par\penalty5000 \Y\noindent{\hangindent2\em\baselineskip10pt% \eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}} @@ -343,11 +345,12 @@ \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} + \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi } \def\makeolproctokctlii{% \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% @@ -400,7 +403,7 @@ \def\startsection{\titletrue \line{\smash{\titlefont\title}\quad\hrulefill}\bigskip \let\startsection=\stsec\stsec} -\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format' +\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format' \def\A{\note{See also section}} % xref for doubly defined section name \def\As{\note{See also sections}} % xref for multiply defined section name \def\B{\iftenpoint\ninepoint\fi @@ -415,7 +418,7 @@ %\let\SHC\C % "// short comments" treated like "/* ordinary comments */" \def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$} \def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}} -\def\D{\defin{\#define}} % macro definition +\def\D{\defin{{\rm\#}define}} % macro definition \let\E=\equiv % equivalence sign \def\ET{ and~} % conjunction between two section numbers \def\ETs{, and~} % conjunction between the last two of several section numbers @@ -467,9 +470,10 @@ % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant \hbox{$\def\?{\kern.2em}%$% - \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant + \let\ \, % C++ digit separator becomes a little white space + \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex {#1}$}}%$% + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$% \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or @@ -484,15 +488,13 @@ %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style -\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style +\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style +\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule \hbox{\strut\kern2pt\.{#1}\kern2pt}} \hrule}\vrule\kern2pt}} % verbatim string - -\def\TeX{{\ifmmode\it\fi - \leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} -\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} +\def\p#1{\cdot 2^{#1}} % power of two (hex exponent) % now here's the mini-index formatting control \newcount\nrefs % total number of references in partial page @@ -639,7 +641,26 @@ \hsize=\pagewd \vsize=\maxdimen \output={\twillout} +%\let\page=\pagebody \raggedbottom +% \def\page{\box255 }\normalbottom % faster, but loses plain TeX footnotes +%\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi + %\shipout\vbox{ + %\vbox to\fullpageht{ + %\iftitle\global\titlefalse + %\else\hbox to\pagewd{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi + %\vfill#1}} % parameter #1 is the page itself + %\global\advance\pageno by1} +%\def\topofcontents{\centerline{\titlefont\title}\vskip.7in + %\vfill} % this material will start the table of contents page +%\def\startpdf{\ifpdftex\pdfcatalog{/PageMode /UseOutlines}\else + %\ifpdf{\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi} +%\def\botofcontents{\vfill + %\centerline{\covernote}} % this material will end the table of contents page +%\def\covernote{} \def\contentspagenumber{0} % default page number for table of contents +%\newdimen\pageshift \pageshift=\hoffset + %% shift righthand pages wrt lefthand ones (changed in version 3.70) +%\def\setpage{\hsize\pagewd\vsize\pageht} % use after changing page size \def\contentsfile{\jobname.toc} % file that gets table of contents info \def\readcontents{\input \contentsfile} \def\readsections{\input \jobname.scn} @@ -675,7 +696,43 @@ \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let \pdfoutline goto num #3 count -\expnumber{chunk#2.#3} {#5}}} \let\con=\end % no table of contents -\def\datethis{} \def\datecontentspage{} +%\def\con{\par\vfill\eject % finish the section names +% \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 + %\pageno=\contentspagenumber + %\def\grouptitle{TABLE OF CONTENTS} + %\message{Table of contents:} + %\topofcontents \startpdf + %\line{\hfil Section\hbox to3em{\hss Page}} + %\let\ZZ=\contentsline + %\readcontents\relax % read the contents info + %\botofcontents \end} % print the contents page(s) and terminate +%\def\contentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi + %\line{\consetup{#2}#1 + %\rm\leaders\hbox to .5em{.\hfil}\hfil + %\ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}} +%\def\consetup#1{\ifcase#1 \bf % depth -1 (@**) + %\or % depth 0 (@*) + %\or \hskip2em % depth 1 (@*1) + %\or \hskip4em \or \hskip6em \or \hskip8em \or \hskip10em % depth 2,3,4,5 + %\else \hskip12em \fi} % depth 6 or more +\def\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +\newcount\twodigits +\def\hours{\twodigits=\time \divide\twodigits by 60 \printtwodigits + \multiply\twodigits by-60 \advance\twodigits by\time :\printtwodigits} +\def\gobbleone1{} +\def\printtwodigits{\advance\twodigits100 + \expandafter\gobbleone\number\twodigits + \advance\twodigits-100 } +\def\datethis{\def\startsection{\leftline{\sc\today\ at \hours}\bigskip + \let\startsection=\stsec\stsec}} + % say `\datethis' in limbo, to get your listing timestamped before section 1 +\def\datecontentspage{} % To produce only a subset of pages, put the page numbers on separate % lines in a file called pages.tex diff --git a/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfwebtocfront.tex b/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfwebtocfront.tex index 3fc5f64de2f..62ec61be8a1 100644 --- a/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfwebtocfront.tex +++ b/Master/texmf-dist/tex/plain/cweb/cwebbin/pdfwebtocfront.tex @@ -21,11 +21,11 @@ \let\ORGcon\con \def\con{% % reduce size of PDF pages for more screen space - \pdfpagewidth=\pagewidth \advance\pdfpagewidth by 2cm - \pdfpageheight=\pageheight \advance\pdfpageheight by 3cm - \ifpdftex \pdfhorigin=1cm \pdfvorigin=1cm - \else \advance\pdfpageheight by 1cm \global\pageshift=-1.54cm - \global\hoffset=-1.54cm \global\voffset=-1.54cm \fi + \pdfpagewidth=\pagewidth \advance\pdfpagewidth by 1in + \pdfpageheight=\fullpageheight \advance\pdfpageheight by 1in + \ifpdftex \pdfhorigin=0.5in \pdfvorigin=0.5in + \else \global\pageshift=-0.5in + \global\hoffset=-0.5in \global\voffset=-0.5in \fi \begingroup \let\end\relax \ORGcon diff --git a/Master/texmf-dist/tex/plain/cweb/cwebmac.tex b/Master/texmf-dist/tex/plain/cweb/cwebmac.tex index 8b49cab3c67..586e7bb30f0 100644 --- a/Master/texmf-dist/tex/plain/cweb/cwebmac.tex +++ b/Master/texmf-dist/tex/plain/cweb/cwebmac.tex @@ -1,8 +1,8 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.1 --- February 2021 +% Version 4.6 --- December 2021 \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CWEB4.1} -\chardef\cwebversion=4 \chardef\cwebrevision=1 +\xdef\fmtversion{\fmtversion+CWEB4.6} +\chardef\cwebversion=4 \chardef\cwebrevision=6 \newif\ifpdf \ifx\pdf+\pdftrue\fi % Uncomment the following line if you want PDF goodies to be the default @@ -31,6 +31,7 @@ \def\TEX/{\TeX} \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} \def\Cee{\CEE/} % for backward compatibility +\def\Cpp{\CPLUSPLUS/} % for backward compatibility \def\9#1{} % with this definition of \9 you can say @:sort key}{TeX code@> % to alphabetize an index entry by the sort key but format with the TeX code @@ -124,6 +125,7 @@ \newskip\intersecskip \intersecskip=12pt minus 3pt % space between sections \let\yskip=\smallskip \def\?{\mathrel?} +\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\Y\noindent{\hangindent2em% \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}} @@ -232,11 +234,12 @@ \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} + \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi % \T{77\$L} \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi } \def\makeolproctokctlii{% \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% @@ -287,7 +290,7 @@ \else \special{pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}\fi}}\fi} \let\startsection=\stsec -\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format' +\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format' \def\A{\note{See also section}} % xref for doubly defined section name \def\As{\note{See also sections}} % xref for multiply defined section name \def\B{\rightskip=0pt plus 100pt minus 10pt % go into C mode @@ -300,7 +303,7 @@ \let\SHC\C % "// short comments" treated like "/* ordinary comments */" %\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$} %\def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}} -\def\D{\defin{\#define}} % macro definition +\def\D{\defin{{\rm\#}define}} % macro definition \let\E=\equiv % equivalence sign \def\ET{ and~} % conjunction between two section numbers \def\ETs{, and~} % conjunction between the last two of several section numbers @@ -343,10 +346,11 @@ % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant \hbox{$\def\?{\kern.2em}% + \let\ \, % C++ digit separator becomes a little white space % \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67 \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67 \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex {#1}$}} + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}} \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or @@ -365,11 +369,13 @@ %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style -\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style +\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style +\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule \hbox{\strut\kern2pt\.{#1}\kern2pt}} \hrule}\vrule\kern2pt}} % verbatim string +\def\p#1{\cdot 2^{#1}} % power of two (hex exponent) \def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue \newif\ifon \newif\iftitle \newif\ifpagesaved @@ -439,7 +445,7 @@ \write\cont{\catcode `\noexpand\@=12\relax} % \makeatother \closeout\cont % the contents information has been fully gathered \output{\ifpagesaved\normaloutput{\box\sbox}\lheader\rheader\fi - \global\setbox\sbox=\page \global\pagesavedtrue} + \global\setbox\sbox=\page \global\pagesavedtrue \mark{\topmark}} \pagesavedfalse \eject % eject the page-so-far and predecessors \setbox\sbox\vbox{\unvbox\sbox} % take it out of its box \vsize=\pageheight \advance\vsize by -\ht\sbox % the remaining height @@ -482,14 +488,13 @@ \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.% {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}% \pdfoutline goto num \the\toksA \expandafter{\the\toksE}} - \else\ifpdf - \special{pdf: outline -1 << /Title (\outsecname) + \else \special{pdf: outline -1 << /Title (\outsecname) /Dest [ @thispage /FitH @ypos ] >>} \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.% {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}% \special{pdf: outline 0 << /Title (\the\toksE) /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}} - \fi\fi\fi + \fi\fi \readsections} \def\makebookmarks{\let\ZZ=\writebookmarkline \readcontents\relax} \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% @@ -536,9 +541,6 @@ \def\printtwodigits{\advance\twodigits100 \expandafter\gobbleone\number\twodigits \advance\twodigits-100 } -\def\TeX{{\ifmmode\it\fi - \leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} -\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\datethis{\def\startsection{\leftline{\sc\today\ at \hours}\bigskip \let\startsection=\stsec\stsec}} % say `\datethis' in limbo, to get your listing timestamped before section 1 |