Debian Codegraph @

texmf-dist/tex/plain/cweb/cwebbin/dcwebmac.tex

raw
1 % standard macros for CWEB listings (in addition to plain.tex)
2 % modified for use with "tex2pdf" --- March 1997
3 % Version 2.0 --- Don Knuth, July 1990
4 % Version 2.0 [german] --- Carsten Steger, October 1991
5 % Version 2.0 [german] --- Andreas Scherer, February 1993
6 % Version 2.7 --- Don Knuth, July 1992
7 % Version 2.7 [p6c] --- Andreas Scherer, September 1993
8 % Version 2.8 --- Don Knuth, September 1992
9 % Version 2.8 [german] --- Carsten Steger, 1993
10 % Version 2.8 [p7] --- Andreas Scherer, October 1993
11 % Version 3.0 --- Don Knuth, June 1993
12 % Version 3.0 [p8e] --- Andreas Scherer, November 1993
13 % Version 3.1 [p9b] --- Andreas Scherer, January 1994
14 % Version 3.1 [p9c] --- Andreas Scherer, March 1994
15 % Version 3.1 [p9d] --- Andreas Scherer, July 1994
16 % Version 3.2 [p10] --- Andreas Scherer, August 1994
17 % Version 3.2 [p10b] --- Andreas Scherer, October 1994
18 % Version 3.3 [p11a] --- Andreas Scherer, December 1994
19 % Version 3.3 [p11b] --- Andreas Scherer, March 1995
20 % Version 3.4 [p13] --- Andreas Scherer, August 1995
21 % Version 3.4 [p14] --- Andreas Scherer, March 1997
22 % Version 3.42 [p15] --- Andreas Scherer, August 1998
23 % Version 3.43 [p16] --- Andreas Scherer, October 1998
24 % Version 3.5 [p17] --- Andreas Scherer, December 1999
25 % Version 3.61 [p18] --- Andreas Scherer, July 2000
26 % Version 3.63 [p19] --- Andreas Scherer, January 2001
27 % Version 3.64 [p20] --- Andreas Scherer, March 2002
28 % Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
29 % Version 3.64 [p22] --- Andreas Scherer, March 2016
30 % Version 4.9 --- Andreas Scherer, June 2022
31 % Version 4.12 --- Andreas Scherer, August 2024
32 % Version 4.12.2 --- Andreas Scherer, January 2026
33
34 \ifx\undefined\botofcontents\input cwebmac.tex\fi
35
36 \input dcwebstrings.tex % German translations for some tags and strings
37
38 \def\.#1{\leavevmode\hbox{\tentex % typewriter type for strings
39 \ifx\Cstringchars\undefined\else\Cstringchars\fi % special string characters
40 \let\\=\BS % backslash in a string
41 \let\{=\LB % left brace in a string
42 \let\}=\RB % right brace in a string
43 \let\~=\TL % tilde in a string
44 \let\ =\SP % space in a string
45 \let\_=\UL % underline in a string
46 \let\&=\AM % ampersand in a string
47 \let\^=\CF % circumflex in a string
48 \ifx\originalTeX\undefined\else\originalTeX\fi#1\kern.05em}}
49
50 \def\postATL#1 #2 {\bf Buchstabe \\{\uppercase{\char"#1}}
51 wird getangled als \tentex "#2"\egroup\par}
52
53 \gtitle={\.{CWEB} Ausgabe} % this running head is reset by starred sections
54 \mark{\noexpand\nullsec0{\the\gtitle}}
55
56 \def\fin{\par\vfill\eject % this is done when we are ending the index
57 \ifpagesaved\null\vfill\eject\fi % output a null index column
58 \if L\lr\else\null\vfill\eject\fi % finish the current page
59 \ifpdf \ifpdflua \makebookmarks % added in Version 3.68
60 \countsections \fi\fi % and in Version 4.9
61 \parfillskip 0pt plus 1fil
62 \let\topsecno=\nullsec
63 \redeffin
64 \output={\normaloutput\page\lheader\rheader}
65 \setpage
66 \def\note##1##2.{\quad{\eightrm##1~\ifacrohint{\pdfnote##2.}\else{##2}\fi.}}
67 \def\I{\par\hangindent 2em}\let\*=*
68 \ifacro \let\Xpdf\X
69 \ifpdflua \pdfdest name {NOS} fith
70 \pdfoutline goto name {NOS} count -\the\countNOS {\outsecname}
71 \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
72 {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
73 \pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
74 \else \special{pdf: outline -1 << /Title (\outsecname)
75 /Dest [ @thispage /FitH @ypos ] >>}
76 \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
77 {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
78 \special{pdf: outline 0 << /Title (\the\toksE)
79 /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
80 \fi\fi
81 \readsections}
82 \def\con{\par\vfill\eject % finish the section names
83 % \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
84 \rightskip 0pt \hyphenpenalty 50 \tolerance 200
85 \setpage \output={\normaloutput\page\lheader\rheader}
86 \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
87 \pageno=\contentspagenumber
88 \redefcon
89 \ifhint\HINThome\fi% Mark the Table of contents as home page
90 \topofcontents
91 \line{\headerline}
92 \let\ZZ=\contentsline
93 \readcontents\relax % read the contents info
94 \botofcontents \end} % print the contents page(s) and terminate
95 \def\today{\number\day.~\ifcase\month\or
96 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
97 Juli\or August\or September\or Oktober\or November\or Dezember\fi
98 \space\number\year}
99 \def\hours{\twodigits=\time \divide\twodigits by60 \printtwodigits
100 \null\space\sc Uhr\space % distinguish between time and year
101 \multiply\twodigits by-60 \advance\twodigits by\time \printtwodigits}
102 \def\datethis{\def\startsection{\leftline{\sc\today\ um \hours}\bigskip
103 \let\startsection=\stsec\stsec}}
104 % say `\datethis' in limbo, to get your listing timestamped before section 1
105 \def\datecontentspage{% changed in version 3.66
106 \def\botofcontents{\vfill
107 \centerline{\covernote}
108 \bigskip
109 \leftline{\sc\today\ um \hours}}} % timestamps the contents page