| 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 |
|
| 23 |
\ifx\undefined\documentclass\else\endinput\fi % LaTeX will use other macros |
| 24 |
|
| 25 |
\input pdfXcwebmac.tex |
| 26 |
|
| 27 |
% In case `german.sty' has been loaded, we have to redefine the `\3' |
| 28 |
% macro for an optional break within a statement. This should be the |
| 29 |
% first command after `\input german.sty' in your CWEB source. |
| 30 |
\def\originalthree{\def\3##1{\hfil\penalty##10\hfilneg}} |
| 31 |
|
| 32 |
\def\.#1{\leavevmode\hbox{\tentex % typewriter type for strings |
| 33 |
\ifx\Cstringchars\undefined\else\Cstringchars\fi % special string characters |
| 34 |
\let\\=\BS % backslash in a string |
| 35 |
\let\{=\LB % left brace in a string |
| 36 |
\let\}=\RB % right brace in a string |
| 37 |
\let\~=\TL % tilde in a string |
| 38 |
\let\ =\SP % space in a string |
| 39 |
\let\_=\UL % underline in a string |
| 40 |
\let\&=\AM % ampersand in a string |
| 41 |
\let\^=\CF % circumflex in a string |
| 42 |
\ifx\originalTeX\undefined\else\originalTeX\fi#1\kern.05em}} |
| 43 |
|
| 44 |
\def\postATL#1 #2 {\bf Buchstabe \\{\uppercase{\char"#1}} |
| 45 |
wird getangled als \tentex "#2"\egroup\par} |
| 46 |
\def\ATH{\X\kern-.5em:Pr\"aprozessor Definitionen\X} |
| 47 |
|
| 48 |
\def\A{\note{Siehe auch Abschnitt}} % xref for doubly defined section name |
| 49 |
\def\As{\note{Siehe auch die Abschnitte}} % xref for multiply defined section name |
| 50 |
|
| 51 |
\def\ET{ und~} % conjunction between two section numbers |
| 52 |
\def\ETs{ und~} % conjunction between the last two of several section numbers |
| 53 |
|
| 54 |
\def\Q{\note{Dieser Programmteil wird zitiert in Abschnitt}} % xref for mention of a section |
| 55 |
\def\Qs{\note{Dieser Programmteil wird zitiert in den Abschnitten}} % xref for mentions of a section |
| 56 |
|
| 57 |
\def\U{\note{Dieser Programmteil wird verwendet in Abschnitt}} % xref for use of a section |
| 58 |
\def\Us{\note{Dieser Programmteil wird verwendet in den Abschnitten}} % xref for uses of a section |
| 59 |
|
| 60 |
\gtitle={\.{CWEB} Ausgabe} % this running head is reset by starred sections |
| 61 |
\mark{\noexpand\nullsec0{\the\gtitle}} |
| 62 |
|
| 63 |
\def\ch{\note{Die folgenden Abschnitte sind vom Change-File ver\"andert worden:} |
| 64 |
\let\*=\relax} |
| 65 |
|
| 66 |
\def\fin{\par\vfill\eject % this is done when we are ending the index |
| 67 |
\ifpagesaved\null\vfill\eject\fi % output a null index column |
| 68 |
\if L\lr\else\null\vfill\eject\fi % finish the current page |
| 69 |
\parfillskip 0pt plus 1fil |
| 70 |
\def\grouptitle{ABSCHNITTSNAMEN} |
| 71 |
\let\topsecno=\nullsec |
| 72 |
\message{Abschnittsnamen:} |
| 73 |
\output={\normaloutput\page\lheader\rheader} |
| 74 |
\setpage |
| 75 |
% |
| 76 |
% Change for PDFTeX |
| 77 |
% \def\note##1##2.{\quad{\eightrm##1~##2.}} |
| 78 |
\def\note##1##2.{\quad{\eightrm##1~\pdfnote##2..}} |
| 79 |
% End of PDFTeX change |
| 80 |
% |
| 81 |
\def\Q{\note{Zitiert in Abschnitt}} % crossref for mention of a section |
| 82 |
\def\Qs{\note{Zitiert in den Abschnitten}} % crossref for mentions of a section |
| 83 |
\def\U{\note{Verwendet in Abschnitt}} % crossref for use of a section |
| 84 |
\def\Us{\note{Verwendet in den Abschnitten}} % crossref for uses of a section |
| 85 |
\def\I{\par\hangindent 2em}\let\*=* |
| 86 |
\readsections} |
| 87 |
\def\con{\par\vfill\eject % finish the section names |
| 88 |
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers |
| 89 |
\rightskip 0pt \hyphenpenalty 50 \tolerance 200 |
| 90 |
\setpage \output={\normaloutput\page\lheader\rheader} |
| 91 |
\titletrue % prepare to output the table of contents |
| 92 |
\pageno=\contentspagenumber |
| 93 |
\def\grouptitle{INHALTSVERZEICHNIS:} |
| 94 |
\message{Inhaltsverzeichnis:} |
| 95 |
\topofcontents |
| 96 |
\line{\hfil Abschnitt\hbox to3em{\hss Seite}} |
| 97 |
\let\ZZ=\contentsline |
| 98 |
\readcontents\relax % read the contents info |
| 99 |
\botofcontents \end} % print the contents page(s) and terminate |
| 100 |
\def\today{\number\day.~\ifcase\month\or |
| 101 |
Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or |
| 102 |
Juli\or August\or September\or Oktober\or November\or Dezember\fi |
| 103 |
\space\number\year} |
| 104 |
\newcount\twodigits |
| 105 |
\def\hours{\twodigits=\time \divide\twodigits by60 \printtwodigits |
| 106 |
\null\space\sc Uhr\space % distinguish between time and year |
| 107 |
\multiply\twodigits by-60 \advance\twodigits by\time \printtwodigits} |
| 108 |
\def\datethis{\def\startsection{\leftline{\sc\today\ um \hours}\bigskip |
| 109 |
\let\startsection=\stsec\stsec}} |
| 110 |
% say `\datethis' in limbo, to get your listing timestamped before section 1 |
| 111 |
\def\datecontentspage{% |
| 112 |
\def\topofcontents{\leftline{\sc\today\ um \hours}\bigskip |
| 113 |
\centerline{\titlefont\title}\vfill}} % timestamps the contents page |