texlive[55124] Build/source/texk/web2c/cwebdir/texinputs: [CWEB]
commits+ascherer at tug.org
commits+ascherer at tug.org
Wed May 13 11:11:20 CEST 2020
Revision: 55124
http://tug.org/svn/texlive?view=revision&revision=55124
Author: ascherer
Date: 2020-05-13 11:11:20 +0200 (Wed, 13 May 2020)
Log Message:
-----------
[CWEB] Separation of powers.
The new 'pdfwebtocfront.tex' works well with both CWEB and WEB. Simply
'\input' it in limbo of your (C)WEB code and run 'pdftex' or 'xetex'
twice (!) to move the table-of-contents page up front.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex
Added Paths:
-----------
trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
Modified: trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex 2020-05-12 21:23:12 UTC (rev 55123)
+++ trunk/Build/source/texk/web2c/cwebdir/texinputs/Xcwebmac.tex 2020-05-13 09:11:20 UTC (rev 55124)
@@ -39,62 +39,4 @@
%\let\K=\leftarrow % "honest" alternative to standard assignment operator
-% Move contents page to the front
-%
-% Code from knuth.drv in https://github.com/oberdiek/latex-tds
-% Works with pdftex (with active links) and xetex (with active
-% links only for '\let\pdf+').
-%
-\ifx\detokenize\undefined\endinput\fi
-\newread\testread
-\openin\testread=\contentsfile\relax
-\ifeof\testread % First run
-\else % Second run
- \let\ORGcon\con
- \def\con{%
- \ifnum\pageno=1 \global\titletrue\fi
- \begingroup
- \let\end\relax
- \ORGcon
- \endgroup
- \let\con\end
- }%
- \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
- }%
- \begingroup
- \def\num{0}%
- \edef\x{\jobname}%
- \edef\y{\detokenize{tex}}%
- \ifx\x\y
- \def\num{1}%
- \else
- \edef\y{\detokenize{mf}}%
- \ifx\x\y
- \def\num{1}%
- \fi
- \fi
- \expandafter\endgroup\ifnum\num=1 %
- \def\contentspagenumber{2}%
- \let\ORGpageno\pageno
- \def\pageno{%
- \let\pageno\ORGpageno
- \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
- }%
- \pageno
- }%
- \fi
-\fi
+\input pdfwebtocfront
Added: trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex (rev 0)
+++ trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex 2020-05-13 09:11:20 UTC (rev 55124)
@@ -0,0 +1,59 @@
+%
+% Move contents page to the front
+%
+% Code from knuth.drv in https://github.com/oberdiek/latex-tds
+% Works with pdftex and xetex.
+%
+\ifx\detokenize\undefined\endinput\fi
+\newread\testread
+\openin\testread=\contentsfile\relax
+\ifeof\testread % First run
+\else % Second run
+ \let\ORGcon\con
+ \def\con{%
+ \ifnum\pageno=1 \global\titletrue\fi
+ \begingroup
+ \let\end\relax
+ \ORGcon
+ \endgroup
+ \let\con\end
+ }%
+ \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
+ }%
+ \begingroup
+ \def\num{0}%
+ \edef\x{\jobname}%
+ \edef\y{\detokenize{tex}}%
+ \ifx\x\y
+ \def\num{1}%
+ \else
+ \edef\y{\detokenize{mf}}%
+ \ifx\x\y
+ \def\num{1}%
+ \fi
+ \fi
+ \expandafter\endgroup\ifnum\num=1 %
+ \def\contentspagenumber{2}%
+ \let\ORGpageno\pageno
+ \def\pageno{%
+ \let\pageno\ORGpageno
+ \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
+ }%
+ \pageno
+ }%
+ \fi
+\fi
Property changes on: trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
More information about the tex-live-commits
mailing list.