summaryrefslogtreecommitdiff
path: root/systems/knuth/local/lib/cwebmac.tex
diff options
context:
space:
mode:
Diffstat (limited to 'systems/knuth/local/lib/cwebmac.tex')
-rw-r--r--systems/knuth/local/lib/cwebmac.tex28
1 files changed, 18 insertions, 10 deletions
diff --git a/systems/knuth/local/lib/cwebmac.tex b/systems/knuth/local/lib/cwebmac.tex
index 8890b63b4d..60f86ce5a9 100644
--- a/systems/knuth/local/lib/cwebmac.tex
+++ b/systems/knuth/local/lib/cwebmac.tex
@@ -1,8 +1,8 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 3.67 --- July 2006
+% Version 3.70 --- July 2017
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB3.67}
-\chardef\cwebversion=3 \chardef\cwebrevision=67
+\xdef\fmtversion{\fmtversion+CWEB3.70}
+\chardef\cwebversion=3 \chardef\cwebrevision=70
\newif\ifpdf
\ifx\pdf+\pdftrue\fi
% Uncomment the following line if you want PDF goodies to be the default
@@ -10,7 +10,11 @@
\def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color
\newif\ifpdftex
\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
-\else \pdftextrue \pdfoutput=1 \input pdfcolor \let\setcolor\pdfsetcolor \fi\fi
+%\else \pdftextrue \pdfoutput=1 \input pdfcolor \let\setcolor\pdfsetcolor \fi\fi
+\else \pdftextrue \pdfoutput=1 % changed in 3.69
+ \def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
+ \def\Blue{\pdfliteral{0 0 1 rg 0 0 1 RG}}
+\fi\fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
\let\:=\. % preserve a way to get the dot accent
@@ -136,7 +140,7 @@
\ifpdftex
\ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14
\def\pdflink#1#2{\hbox{\pdfannotlink height\ht\strutbox depth\dp\strutbox
- attr{/Border [0 0 0]} goto num #1 \BlueGreen #1\Black\pdfendlink}}
+ attr{/Border [0 0 0]} goto num #1 \Blue #1\Black\pdfendlink}} % changed 3.69
\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
\special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
depth \thedepth << /Type /Annot /Subtype /Link
@@ -166,7 +170,7 @@
\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
- << /S /URI /URI (#2) >>}\BlueGreen #1\Black \pdfendlink
+ << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
\else \ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
\special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
\space depth \thedepth\space << /Border [0 0 0]
@@ -278,7 +282,8 @@
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
\noindent{\let\*=\lapstar\bf\secstar.\quad}%
\ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
- \let\*=\empty\pdfdest num \secstar fith}}
+% \let\*=\empty\pdfdest num \secstar fith}} % bad space in versions < 3.68
+ \let\*=\empty\pdfdest num \secstar fith}}% changed in version 3.68
\else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
\let\*=\empty\special{%
pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}
@@ -340,7 +345,7 @@
\def\T#1{\leavevmode % octal, hex or decimal constant
\hbox{$\def\?{\kern.2em}%
% \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67
- \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
+ \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
\let\~=\oct \let\^=\hex {#1}$}}
\def\U{\note{This code is used in section}} % xref for use of a section
@@ -407,7 +412,8 @@
\newdimen\pagewidth \pagewidth=6.5in % the width of each page
\newdimen\pageheight \pageheight=8.7in % the height of each page
\newdimen\fullpageheight \fullpageheight=9in % page height including headlines
-\newdimen\pageshift \pageshift=0in % shift righthand pages wrt lefthand ones
+\newdimen\pageshift \pageshift=\hoffset
+ % shift righthand pages wrt lefthand ones (changed in version 3.70)
\def\magnify#1{\mag=#1\pagewidth=6.5truein\pageheight=8.7truein
\fullpageheight=9truein\setpage}
\def\setpage{\hsize\pagewidth\vsize\pageheight} % use after changing page size
@@ -457,6 +463,7 @@
\def\fin{\par\vfill\eject % this is done when we are ending the index
\ifpagesaved\null\vfill\eject\fi % output a null index column
\if L\lr\else\null\vfill\eject\fi % finish the current page
+ \ifpdftex \makebookmarks \fi % added in Version 3.68
\parfillskip 0pt plus 1fil
\def\grouptitle{NAMES OF THE SECTIONS}
\let\topsecno=\nullsec
@@ -470,7 +477,8 @@
\def\Us{\note{Used in sections}} % crossref for uses of a section
\def\I{\par\hangindent 2em}\let\*=*
\ifacro \def\outsecname{Names of the sections} \let\Xpdf\X
- \ifpdftex \makebookmarks \pdfdest name {NOS} fitb
+% \ifpdftex \makebookmarks \pdfdest name {NOS} fitb % in versions < 3.68
+ \ifpdftex \pdfdest name {NOS} fith % changed in version 3.69
\pdfoutline goto name {NOS} count -\secno {\outsecname}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%