summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/cweb
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2024-09-14 13:17:23 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2024-09-14 13:17:23 +0000
commit1fe76274bfcc8376aad6008a978b1f6e5665e5fd (patch)
treec8fd979958096db2909215bfda6da1a3c7675661 /Master/texmf-dist/tex/plain/cweb
parent683a0bfb515a4e9e89848e84a6c05be33976ad18 (diff)
[CWEB] Purge '\9' macro in PDF outlines.
git-svn-id: svn://tug.org/texlive/trunk@72279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/plain/cweb')
-rw-r--r--Master/texmf-dist/tex/plain/cweb/cwebacromac.tex25
-rw-r--r--Master/texmf-dist/tex/plain/cweb/cwebmac.tex13
2 files changed, 18 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/plain/cweb/cwebacromac.tex b/Master/texmf-dist/tex/plain/cweb/cwebacromac.tex
index 3e8baad77c1..1743ddd95d6 100644
--- a/Master/texmf-dist/tex/plain/cweb/cwebacromac.tex
+++ b/Master/texmf-dist/tex/plain/cweb/cwebacromac.tex
@@ -17,6 +17,16 @@
\let\pdfoutput=\outputmode
\fi % end of LuaTeX->pdfTeX redirection macros
+\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
+ attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
+ << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
+ \else {\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
+ \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
+ depth \thedepth << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /URI /URI (#2) >> >>}\box0\relax}\fi
+ \else #1 ({\tt#2})\fi}
+{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
+{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
\def\tocpages{1} % Most programs have one-page Table-of-Contents
\def\startpdf{\def\pagemode{/PageMode /UseOutlines}
\ifnum\contentspagenumber=0 \advance \pageno by -\tocpages
@@ -66,8 +76,7 @@
\fi
\else \addtokens\toksC{\the\toksD}\global\havenumtrue
\fi
- \next
-}
+ \next}
\def\makenote{\addtokens\toksB
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\havenumfalse}
\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
@@ -99,6 +108,7 @@
\afterassignment\makeolproctok\let\nxt= }
\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= }
\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= }
+\def\makeolgobbletokk{\afterassignment\makeolgobbletok\let\nxt= }
\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue}
% now comes a routine to "sanitize" section names, for pdf outlines
\def\makeolproctok{\tokprocessedfalse
@@ -109,8 +119,7 @@
\else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _
\else\ifx\nxt\spacechar \addF\space
\else\if\noexpand\nxt\relax % we have a control sequence; is it one we know?
- \ifx\nxt~\addF\space
- \else\ifx\nxt\onespace\addF\space
+ \ifx\nxt~\addF\space \else\ifx\nxt\onespace\addF\space
\else\the\sanitizer
\iftokprocessed\else\makeolproctokctli
\iftokprocessed\else\makeolproctokctlii
@@ -124,8 +133,7 @@
\else\expandafter\makeolproctokchar\meaning\nxt
\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi \fi\fi\fi
- \next
-}
+ \next}
\def\makeolproctokchar#1 #2 #3{\addF{#3}}
\def\makeolproctokctli{%
\ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/
@@ -133,8 +141,9 @@
\else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/
\else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}%
\else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/
- \else\ifx\nxt\Cee\addF{C}%
+ \else\ifx\nxt\Cee\addF{C}\else\ifx\nxt\dots\addF{...\space}%
\else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...}
+ \else\ifx\nxt\9 \expandafter\nxt\relax \let\next\makeolgobbletokk % \9{#1}
\else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...}
% skip \|
\else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi
@@ -149,7 +158,7 @@
\else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}%
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
- \fi\fi
+ \fi\fi\fi\fi
}
\def\makeolproctokctlii{%
\ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}%
diff --git a/Master/texmf-dist/tex/plain/cweb/cwebmac.tex b/Master/texmf-dist/tex/plain/cweb/cwebmac.tex
index a46dc4b782f..53454300a9a 100644
--- a/Master/texmf-dist/tex/plain/cweb/cwebmac.tex
+++ b/Master/texmf-dist/tex/plain/cweb/cwebmac.tex
@@ -132,16 +132,6 @@
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi
\input cwebacromac % load hypertext macros
-\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
- attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
- << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
- \else {\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
- \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
- depth \thedepth << /Border [0 0 0] /Type /Annot /Subtype /Link /A
- << /S /URI /URI (#2) >> >>}\box0\relax}\fi
- \else #1 ({\tt#2})\fi}
-{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
-{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
\def\lapstar{\rlap{*}}
\def\stsec{\rightskip=0pt % get out of C mode (cf. \B)
@@ -242,9 +232,8 @@
\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
-\newif\ifon \newif\iftitle \newif\ifpagesaved
+\newif\ifon \newif\iftitle \newif\ifpagesaved \newif\ifheader
-\newif\ifheader
\def\lheader{\headertrue\mainfont\the\pageno\eightrm\qquad\grouptitle
\hfill\title\qquad\mainfont\topsecno} % top line on left-hand pages
\def\rheader{\headertrue\mainfont\topsecno\eightrm\qquad\title\hfill