texlive[55236] Build/source/texk/web2c/cwebdir: [CWEB] Amend macros
commits+ascherer at tug.org
commits+ascherer at tug.org
Fri May 22 12:26:22 CEST 2020
Revision: 55236
http://tug.org/svn/texlive?view=revision&revision=55236
Author: ascherer
Date: 2020-05-22 12:26:22 +0200 (Fri, 22 May 2020)
Log Message:
-----------
[CWEB] Amend macros for PDF production.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex
trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2020-05-21 22:08:13 UTC (rev 55235)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2020-05-22 10:26:22 UTC (rev 55236)
@@ -1,3 +1,8 @@
+2020-05-22 Andreas Scherer <https://ascherer.github.io>
+
+ * texinputs/Xcwebmac.tex: Activate alternative assignment operator.
+ * texinputs/pdfwebtocfront.tex: Add comments to the macro code.
+
2020-05-07 Andreas Scherer <https://ascherer.github.io>
* texinputs/Xcwebmac.tex: Amend macros from knuth.drv (n
Modified: trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex 2020-05-21 22:08:13 UTC (rev 55235)
+++ trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex 2020-05-22 10:26:22 UTC (rev 55236)
@@ -25,10 +25,11 @@
% Version 3.64 [p20] --- Andreas Scherer, March 2002
% Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
% Version 3.64 [2018] --- Andreas Scherer, Octobre 2018
+% Version 3.64 [2020] --- Andreas Scherer, May 2020
\ifx\undefined\botofcontents\input cwebmac.tex\fi
-\xdef\fmtversion{\fmtversion[2018]}
+\xdef\fmtversion{\fmtversion[2020]}
\def\Cpp{\CPLUSPLUS/} % for backward compatibility
@@ -37,4 +38,4 @@
\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$}
\def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}}
-%\let\K=\leftarrow % "honest" alternative to standard assignment operator
+\let\K=\leftarrow % "honest" alternative to standard assignment operator
Modified: trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex 2020-05-21 22:08:13 UTC (rev 55235)
+++ trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex 2020-05-22 10:26:22 UTC (rev 55236)
@@ -1,8 +1,14 @@
+% pdfwebtofront.tex
+% Code from knuth.drv in https://github.com/oberdiek/latex-tds
+% 2020/05/21 v1.0 by Andreas Scherer.
%
-% Move contents page to the front
+% This file is part of project https://github.com/ascherer/cwebbin
+% and may be distributed under the MIT License or the LaTeX Project
+% Public License.
%
-% Code from knuth.drv in https://github.com/oberdiek/latex-tds
-% Works with pdftex and xetex.
+% Move table-of-contents page to the front in PDF output.
+% Works with pdftex and xetex in connection with either 'webmac.tex'
+% for Pascal/WEB programs or 'cwebmac.tex' for C/CWEB programs.
%
\ifx\detokenize\undefined\endinput\fi
\newread\testread
@@ -9,24 +15,30 @@
\openin\testread=\contentsfile\relax
\ifeof\testread % First run
\else % Second run
- \let\ORGcon\con
+ \let\ORGcon\con \let\ORGtoc\topofcontents
+ \ifx\undefined\grouptitle \mark{1} % WEB: let's start with section '1'.
+ \else\def\topofcontents{\ORGtoc\gtitle={\the\grouptitle}}\fi % CWEB
+ % Redefine '\con' to be invoked before the first '\N' (starred section).
\def\con{%
- \ifnum\pageno=1 \global\titletrue\fi
+ \def\:{\par\hangindent 2em} % Fix for 'bibtex.web'.
\begingroup
\let\end\relax
- \ORGcon
+ \ORGcon\eject
\endgroup
\let\con\end
}%
+ % Redefine '\N’ to invoke redefined '\con' before switching back
+ % to original '\N'.
\expandafter\let\csname ORGN\expandafter\endcsname
\csname N\endcsname
\expandafter\outer\expandafter\def\csname N\endcsname{%
\con
- \advance\pageno by -1\relax
\expandafter\let\csname N\expandafter\endcsname
\csname ORGN\endcsname
\csname N\endcsname
}%
+ % Special variant of the above for 'mf.web' and 'tex.web'. They put
+ % their tables-of-contents on a sparce 'page 2' and start on page '3'.
\begingroup
\def\num{0}%
\edef\x{\jobname}%
@@ -48,7 +60,6 @@
\csname N\endcsname
\expandafter\outer\expandafter\def\csname N\endcsname{%
\con
- \advance\pageno by -1\relax
\expandafter\let\csname N\expandafter\endcsname
\csname ORGN\endcsname
\csname N\endcsname
More information about the tex-live-commits
mailing list.