summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex')
-rw-r--r--Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex18
1 files changed, 13 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
index a7bdc717b9e..01bba0e19f3 100644
--- a/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
+++ b/Master/texmf-dist/tex/plain/pwebmac/pwebmac.tex
@@ -5,7 +5,7 @@
% macro integration \`a la CWEB by Andreas Scherer <andreas_tex@freenet.de>.
% This file is not copyrighted and can be used freely.
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+PWEBMAC4.11}
+\xdef\fmtversion{\fmtversion+PWEBMAC4.12}
\parskip 0pt % no stretch between paragraphs
\parindent 1em % for paragraphs and for the first line of Pascal text
@@ -351,8 +351,16 @@
\def\title{\expandafter\uppercase\expandafter{\jobname}}
\def\topofcontents{\centerline{\titlefont\title}\vskip.7in
\vfill} % this material will start the table of contents page
-\def\startpdf{\ifpdf \ifpdflua\pdfcatalog{/PageMode /UseOutlines}
- \else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
+\def\startpdf{\ifpdf\def\pagemode{/PageMode /UseOutlines}
+ \ifnum\contentspagenumber=0 \advance \pageno by -1
+ \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St 1 >>
+ \the\pageno << /P(Contents) >> ] >>}
+ \else \twodigits=\pageno \pageno=\contentspagenumber
+ \advance \pageno by 1 \advance \twodigits by -\pageno
+ \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St \the\pageno >>
+ \the\twodigits << /S/D/St \contentspagenumber >> ] >>} \fi
+ \ifpdflua\pdfcatalog{\pagemode\space\pagelabels}
+ \else \special{pdf: docview << \pagemode\space\pagelabels >>}\fi\fi}
\def\botofcontents{\vfill
\centerline{\covernote}} % this material will end the table of contents page
\def\covernote{}
@@ -452,12 +460,12 @@
% \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
+ \startpdf \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\Z=\contentsline
\readcontents\relax % read the contents info