summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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