summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2020-06-20 23:01:35 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2020-06-20 23:01:35 +0000
commite0b812693cc563a5195091354bc1bd5fbc79d6b2 (patch)
treebd0c52e176cc09ebd34d215d0c273a97a10d9469 /Build/source/texk/web2c/cwebdir
parentbf456af993056773fa22c4d58d910f85d15d2900 (diff)
[CWEB] Fix running headers and toc.
Many WEB programs override '\def\rheader'; we must restore the original definition. pdfTeX has a looong table-of-contents by itself (with the TL it's getting worse, also for XeTeX). git-svn-id: svn://tug.org/texlive/trunk@55611 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir')
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex29
1 files changed, 15 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
index ac2daac790c..9ecb33ee0bc 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
@@ -13,6 +13,7 @@
\ifx\detokenize\undefined\endinput\fi
\def\contentsfile{\jobname.toc} % file that gets table of contents info
\newif\iftexmf\texmffalse % special toc treatment for TeX, Metafont, etc.
+\newif\ifpdfxe\pdfxefalse % superspecial toc treatment for pdfTeX, XeTeX.
\newread\testread
\openin\testread=\contentsfile\relax
\ifeof\testread % First run
@@ -36,18 +37,17 @@
% They all define a peculiar version of '\N' in their preamble.
% And they put their tables-of-contents on a sparse 'page 2' and
% start the main body on page '3'.
- \begingroup
- \edef\x{\jobname}%
- \edef\y{\detokenize{tex}}%
- \ifx\x\y \texmftrue\else
- \edef\y{\detokenize{mf}}%
- \ifx\x\y \texmftrue\else
- \edef\y{\detokenize{pdftex}}%
- \ifx\x\y \texmftrue\else
- \edef\y{\detokenize{xetex}}%
- \ifx\x\y \texmftrue\fi\fi\fi\fi
- \expandafter\endgroup\iftexmf %
- \def\contentspagenumber{2}%
+ \edef\x{\jobname}%
+ \edef\y{\detokenize{tex}}%
+ \ifx\x\y \texmftrue\else
+ \edef\y{\detokenize{mf}}%
+ \ifx\x\y \texmftrue\else
+ \edef\y{\detokenize{pdftex}}%
+ \ifx\x\y \texmftrue \pdfxetrue\else
+ \edef\y{\detokenize{xetex}}%
+ \ifx\x\y \texmftrue\fi\fi\fi\fi
+ \iftexmf
+ \ifpdfxe \def\contentspagenumber{1} \else \def\contentspagenumber{2} \fi
\expandafter\let\csname ORGN\expandafter\endcsname
\csname N\endcsname
\expandafter\outer\expandafter\def\csname N\endcsname{%
@@ -60,7 +60,7 @@
% In fact, '\con' will be invoked _inside_ the first '\N' right _after_
% '\MN', but _before_ '\eject'. And '\topofcontents' gets in the twist
% as well.
- \let\ORGtopofcontents\topofcontents
+ \let\ORGtopofcontents\topofcontents \let\ORGrheader\rheader
\def\topofcontents{%
\def\:{\par\hangindent 2em} % Fix for 'bibtex.web'; from '\def\fin'.
\ORGtopofcontents
@@ -80,7 +80,8 @@
\csname ORGvfil\endcsname
\expandafter\let\csname eject\expandafter\endcsname
\csname ORGeject\endcsname
- \vfil
+ \vfil\eject
+ \let\rheader\ORGrheader
}%
\fi
\fi