| 1 |
\tracingpages=1 % TEMPORARY! |
| 2 |
% Macros for `Concrete Mathematics' |
| 3 |
\ifx\gkpmac\fmtversion\endinput\else\let\gkpmac=\fmtversion\fi |
| 4 |
|
| 5 |
% Fonts for regular text |
| 6 |
|
| 7 |
\font\textrm=ccr10 % roman |
| 8 |
\font\textit=ccti10 % italic (emphasis) |
| 9 |
\font\textsl=ccsl10 % slanted (titles) |
| 10 |
\font\textbf=cmbx10 % bold |
| 11 |
\font\textcsc=cccsc10 % caps and small caps |
| 12 |
\font\oldsty=ccmi10 % equation numbers |
| 13 |
\font\twelvett=cmtt12 |
| 14 |
|
| 15 |
% Fonts for regular math |
| 16 |
% I'm setting \fontdimen2 to zero because AMS forgot to do it; |
| 17 |
% they may have fixed the problem in the meantime, but no harm is done |
| 18 |
|
| 19 |
\font\mathtext=ccr10 |
| 20 |
\font\mathsubtext=ccr7 |
| 21 |
\font\mathsubsubtext=ccr5 |
| 22 |
\font\mathlet=eurm10 \fontdimen2\mathlet=0pt |
| 23 |
\font\mathsublet=eurm7 \fontdimen2\mathsublet=0pt |
| 24 |
\font\mathsubsublet=eurm5 \fontdimen2\mathsubsublet=0pt |
| 25 |
\skewchar\mathlet='177 \skewchar\mathsublet='177 \skewchar\mathsubsublet='177 |
| 26 |
\font\mathsym=cmsy10 |
| 27 |
\font\mathsubsym=cmsy7 |
| 28 |
\font\mathsubsubsym=cmsy5 |
| 29 |
\skewchar\mathsym='60 \skewchar\mathsubsym='60 \skewchar\mathsubsubsym='60 |
| 30 |
\font\mathext=cmex10 |
| 31 |
\font\mathsubext=cmex10 |
| 32 |
\font\mathsubsubext=cmex10 |
| 33 |
\font\mathscr=euxm10\fontdimen2\mathscr=0pt |
| 34 |
\font\mathsubscr=euxm7 \fontdimen2\mathsubscr=0pt |
| 35 |
\font\mathsubsubscr=euxm5 \fontdimen2\mathsubsubscr=0pt |
| 36 |
\skewchar\mathscr='60 \skewchar\mathsubscr='60 \skewchar\mathsubsubscr='60 |
| 37 |
\font\mathfr=eufm10\fontdimen2\mathfr=0pt |
| 38 |
\font\mathsubfr=eufm7 \fontdimen2\mathsubfr=0pt |
| 39 |
\font\mathsubsubfr=eufm5 \fontdimen2\mathsubsubfr=0pt |
| 40 |
\font\matheuex=euex10\fontdimen2\matheuex=0pt |
| 41 |
|
| 42 |
\font\eulerbf=eurb10 \fontdimen2\eulerbf=0pt % not hooked in to these macros |
| 43 |
|
| 44 |
% Fonts for graffiti |
| 45 |
|
| 46 |
\font\gtext=ccslc9 |
| 47 |
\font\goldstyle=ccmic9 |
| 48 |
\fontdimen3\gtext=0pt \fontdimen4\gtext=0pt % no stretch or shrink |
| 49 |
\font\gmathtext=ccr9 |
| 50 |
\font\gmathsubtext=ccr6 |
| 51 |
\font\gmathsubsubtext=ccr5 |
| 52 |
\font\gmathlet=eurm10 scaled 900 \fontdimen2\gmathlet=0pt |
| 53 |
\font\gmathsublet=eurm7 scaled 857 \fontdimen2\gmathsublet=0pt |
| 54 |
\font\gmathsubsublet=eurm5 \fontdimen2\gmathsubsublet=0pt |
| 55 |
\skewchar\gmathlet='177 \skewchar\gmathsublet='177 |
| 56 |
\skewchar\gmathsubsublet='177 |
| 57 |
\font\gmathsym=cmsy9 |
| 58 |
\font\gmathsubsym=cmsy6 |
| 59 |
\font\gmathsubsubsym=cmsy5 |
| 60 |
\skewchar\gmathsym='60 \skewchar\gmathsubsym='60 \skewchar\gmathsubsubsym='60 |
| 61 |
\font\gmathext=cmex9 |
| 62 |
\font\gmathsubext=cmex9 |
| 63 |
\font\gmathsubsubext=cmex9 |
| 64 |
\font\gmathscr=euxm10 scaled 900 \fontdimen2\gmathscr=0pt |
| 65 |
\font\gmathsubscr=euxm7 scaled 857 \fontdimen2\gmathsubscr=0pt |
| 66 |
\font\gmathsubsubscr=euxm5 \fontdimen2\gmathsubsubscr=0pt |
| 67 |
\skewchar\gmathscr='60 \skewchar\gmathsubscr='60 \skewchar\gmathsubsubscr='60 |
| 68 |
\font\gmathfr=eufm10 scaled 900 \fontdimen2\gmathfr=0pt |
| 69 |
\font\gmathsubfr=eufm7 scaled 857 \fontdimen2\gmathsubfr=0pt |
| 70 |
\font\gmathsubsubfr=eufm5 \fontdimen2\gmathsubsubfr=0pt |
| 71 |
\font\gmatheuex=euex9 \fontdimen2\gmatheuex=0pt |
| 72 |
|
| 73 |
% Fonts for headings, etc. |
| 74 |
|
| 75 |
\font\chapfont=cmbxcd10 scaled 8000 |
| 76 |
\font\title=cmbx10 scaled \magstep5 |
| 77 |
\font\subtitle=cmbx10 scaled 1315 % that's magstep 1.5 |
| 78 |
\font\subsubtitle=cmbxsl10 |
| 79 |
\font\runhead=cmbx9 |
| 80 |
\font\foliofont=cmr9 |
| 81 |
\font\gtfont=cmmi9 % for the \t accent |
| 82 |
\font\ninesl=ccsl9 % used in the index only |
| 83 |
|
| 84 |
% Normal text conventions |
| 85 |
|
| 86 |
\catcode`@=11 % borrow the private macros of PLAIN (with care) |
| 87 |
\def\wlog#1{} % don't put allocation info into the log |
| 88 |
|
| 89 |
\hsize=28pc |
| 90 |
\vsize=45.25pc |
| 91 |
\parindent=20pt |
| 92 |
\baselineskip=13pt |
| 93 |
|
| 94 |
\let\sc=\textcsc |
| 95 |
\let\bf=\textbf |
| 96 |
\def\textindent#1{\noindent\hbox to\parindent{\bf#1\hfil}\ignorespaces} |
| 97 |
\def\exitem{\hangindent2\parindent \textindent} |
| 98 |
|
| 99 |
\textfont0=\mathtext |
| 100 |
\scriptfont0=\mathsubtext |
| 101 |
\scriptscriptfont0=\mathsubsubtext |
| 102 |
\textfont1=\mathlet \let\tfont=\teni |
| 103 |
\scriptfont1=\mathsublet |
| 104 |
\scriptscriptfont1=\mathsubsublet |
| 105 |
\textfont2=\mathsym |
| 106 |
\scriptfont2=\mathsubsym |
| 107 |
\scriptscriptfont2=\mathsubsubsym |
| 108 |
\textfont3=\mathext |
| 109 |
\scriptfont3=\mathsubext |
| 110 |
\scriptscriptfont3=\mathsubsubext |
| 111 |
\def\rm{\fam\z@\textrm} |
| 112 |
\def\it{\fam\itfam\textit} % \it is family 4, defined in PLAIN |
| 113 |
\def\sl{\textsl} |
| 114 |
\textfont\itfam=\textit |
| 115 |
\newfam\scrfam \ifnum\scrfam=8\relax\else\error\fi % family 8, script |
| 116 |
\textfont\scrfam=\mathscr |
| 117 |
\scriptfont\scrfam=\mathsubscr |
| 118 |
\scriptscriptfont\scrfam=\mathsubsubscr |
| 119 |
\def\scr{\fam8 } |
| 120 |
\mathcode`0="7130 |
| 121 |
\mathcode`1="7131 |
| 122 |
\mathcode`2="7132 |
| 123 |
\mathcode`3="7133 |
| 124 |
\mathcode`4="7134 |
| 125 |
\mathcode`5="7135 |
| 126 |
\mathcode`6="7136 |
| 127 |
\mathcode`7="7137 |
| 128 |
\mathcode`8="7138 |
| 129 |
\mathcode`9="7139 |
| 130 |
\newfam\frfam % family 9, fraktur |
| 131 |
\textfont\frfam=\mathfr |
| 132 |
\scriptfont\frfam=\mathsubfr |
| 133 |
\scriptscriptfont\frfam=\mathsubsubfr |
| 134 |
\def\frak{\fam9 } |
| 135 |
\newfam\euexfam % family 10, substitions for euler symbols |
| 136 |
\newfam\eqfam % family 11, cmr equal signs for Relbar (!) |
| 137 |
\font\teneq=cmr10 \textfont\eqfam=\teneq |
| 138 |
\font\nineeq=cmr9 |
| 139 |
% I'm not using Relbar except in 9&10pt, so this family is very incomplete... |
| 140 |
|
| 141 |
\mathchardef\intop="1A52 |
| 142 |
\mathchardef\ointop="1A48 |
| 143 |
\mathchardef\coprod="1A60 |
| 144 |
\mathchardef\prod="1A51 |
| 145 |
\mathchardef\sum="1A50 |
| 146 |
\mathchardef\braceld="A7A \mathchardef\bracerd="A7B |
| 147 |
\mathchardef\bracelu="A7C \mathchardef\braceru="A7D |
| 148 |
\mathchardef\infty="0A31 |
| 149 |
|
| 150 |
\mathchardef\nearrow="3A25 |
| 151 |
\mathchardef\searrow="3A26 |
| 152 |
\mathchardef\nwarrow="3A2D |
| 153 |
\mathchardef\swarrow="3A2E |
| 154 |
\mathchardef\Leftrightarrow="3A2C |
| 155 |
\mathchardef\Leftarrow="3A28 |
| 156 |
\mathchardef\Rightarrow="3A29 |
| 157 |
\mathchardef\leftrightarrow="3A24 \mathcode`\^^W="3A24 |
| 158 |
\mathchardef\leftarrow="3A20 \let\gets=\leftarrow \mathcode`\^^X="3A20 |
| 159 |
\mathchardef\rightarrow="3A21 \let\to=\rightarrow \mathcode`\^^Y="3A21 |
| 160 |
\def\uparrow{\delimiter"3A22378 } \mathcode`\^^K="3A22 |
| 161 |
\def\downarrow{\delimiter"3A23379 } \mathcode`\^^A="3A23 |
| 162 |
\def\updownarrow{\delimiter"3A6C33F } |
| 163 |
\def\Uparrow{\delimiter"3A2A37E } |
| 164 |
\def\Downarrow{\delimiter"3A2B37F } |
| 165 |
\def\Updownarrow{\delimiter"3A6D377 } |
| 166 |
\mathchardef\leftharpoonup="3A18 |
| 167 |
\mathchardef\leftharpoondown="3A19 |
| 168 |
\mathchardef\rightharpoonup="3A1A |
| 169 |
\mathchardef\rightharpoondown="3A1B |
| 170 |
|
| 171 |
\textfont\euexfam=\matheuex |
| 172 |
\scriptfont\euexfam=\mathsubsym % this is OK since I don't use all characters |
| 173 |
% of euex in subscripts/superscripts; otherwise I'd have to make euex7 and euex6 |
| 174 |
\scriptscriptfont\euexfam=\mathsubsym % only for \mathchoice, not really chosen |
| 175 |
\mathcode`+="292B |
| 176 |
\mathcode`-="292D |
| 177 |
\mathcode`!="0921 |
| 178 |
\mathcode`(="4928 \delcode`(="928300 |
| 179 |
\mathcode`)="5929 \delcode`)="929301 |
| 180 |
\mathcode`[="495B \delcode`[="95B302 |
| 181 |
\mathcode`]="595D \delcode`]="95D303 |
| 182 |
\mathcode`=="393D |
| 183 |
\mathchardef\Relbar="3B3D % we need the old = to match \Arrows |
| 184 |
\mathchardef\Gamma="7100 |
| 185 |
\mathchardef\Delta="7101 |
| 186 |
\mathchardef\Theta="7102 |
| 187 |
\mathchardef\Lambda="7103 |
| 188 |
\mathchardef\Xi="7104 |
| 189 |
\mathchardef\Pi="7105 |
| 190 |
\mathchardef\Sigma="7106 |
| 191 |
\mathchardef\Upsilon="7107 |
| 192 |
\mathchardef\Phi="7108 |
| 193 |
\mathchardef\Psi="7109 |
| 194 |
\mathchardef\Omega="710A |
| 195 |
\let\varsigma=\sigma \let\varrho=\rho % Euler doesn't have these |
| 196 |
\mathchardef\aleph="0840 |
| 197 |
\def\rbrace{\delimiter"5867A09 } \let\}=\rbrace |
| 198 |
\def\lbrace{\delimiter"4866A08 } \let\{=\lbrace |
| 199 |
%\mathchardef\equiv="3811 \let\cong=\equiv % lowres bars weren't spaced right |
| 200 |
\mathchardef\leq="3814 \let\le=\leq |
| 201 |
\mathchardef\geq="3815 \let\ge=\geq |
| 202 |
\mathchardef\Re="083C |
| 203 |
\mathchardef\Im="083D |
| 204 |
\def\vert{\delimiter"86A30C } |
| 205 |
\def\backslash{\delimiter"86E30F } |
| 206 |
|
| 207 |
\setbox\strutbox=\hbox{\vrule height9pt depth4pt width\z@}% |
| 208 |
\newbox\bigstrutbox \newbox\biggstrutbox |
| 209 |
\setbox\bigstrutbox=\hbox{\vrule height11pt depth4pt width\z@}% |
| 210 |
\def\bigstrut{\relax\ifmmode\copy\bigstrutbox\else\unhcopy\bigstrutbox\fi} |
| 211 |
\setbox\biggstrutbox=\hbox{\vrule height17pt depth10pt width\z@}% |
| 212 |
\def\biggstrut{\relax\ifmmode\copy\biggstrutbox\else\unhcopy\biggstrutbox\fi} |
| 213 |
\rm |
| 214 |
|
| 215 |
\newmuskip\normalthick \normalthick=5mu plus 5mu |
| 216 |
\newmuskip\normalmedmu \normalmedmu=\medmuskip |
| 217 |
\newmuskip\displaythick \displaythick=10mu minus 3mu |
| 218 |
\everymath{\thickmuskip=\normalthick} |
| 219 |
|
| 220 |
\abovedisplayskip=8pt plus 3pt minus 2pt % there's 2pt more (opened up) |
| 221 |
\belowdisplayskip=10pt plus 3pt minus 2pt |
| 222 |
|
| 223 |
% displays not centered; all have capability of \eqalign |
| 224 |
\outer\def\begindisplay{\obeylines\startdisplay} |
| 225 |
{\obeylines\gdef\startdisplay#1 |
| 226 |
{\catcode`\^^M=5$$% |
| 227 |
\advance\displayindent\parindent\advance\displaywidth-\parindent% |
| 228 |
\openup2pt #1\halign\bgroup\span\preamble\cr}} |
| 229 |
\outer\def\enddisplay{\crcr\egroup$$} |
| 230 |
\jot=\z@ % we do our own opening up |
| 231 |
|
| 232 |
\def\displaymath{$\thickmuskip=\displaythick\displaystyle} |
| 233 |
\def\preamble{\hfil\displaymath{##}$&&\displaymath{{}##}$\hfil} |
| 234 |
\def\tablepreamble{\bigstrut\hfil$##$\hfil\ &\vrule##&&\quad\hfil$##$\hfil} |
| 235 |
\def\xbox{\qquad\hbox} % for third column of explanation |
| 236 |
|
| 237 |
\newcount\eqcount |
| 238 |
\def\equ(#1.#2){{\rm({\oldsty#1}.{\oldsty#2})}} |
| 239 |
\def\eq(#1){\equ(\chapno.#1)} |
| 240 |
\def\thiseq{\xdef\next{(\chapno.\number\eqcount)}\expandafter\equ\next} |
| 241 |
\def\eqno{\global\advance\eqcount 1 \global\everycr{\makeeqno\thiseq}} |
| 242 |
\newdimen\backup |
| 243 |
\def\makeeqno#1{\noalign{\global\everycr{}% |
| 244 |
\advance\displaywidth\displayindent |
| 245 |
\setbox0=\hbox to\displaywidth{\hfil#1}% |
| 246 |
\backup=\prevdepth \advance\backup\ht0 |
| 247 |
\setbox0=\vbox{\kern-\backup\box0}\ht0=\z@ \dp0=\z@ |
| 248 |
\setbox0=\vbox{\box0}\unvbox0}} % that puts equation number on prev line! |
| 249 |
|
| 250 |
\newif\iftitle |
| 251 |
\newskip\chaptopspace \chaptopspace=1in minus 5pt |
| 252 |
\def\beginchapter#1 #2 \par{ % we should be at top of a page |
| 253 |
\titletrue \eqcount=0 |
| 254 |
\ifodd\pageno |
| 255 |
\rightline{\chapfont#1\kern-.05em} |
| 256 |
\vskip\chaptopspace |
| 257 |
\rightline{\title#2} |
| 258 |
\moveleft7pc % this applies to the \vbox after the \fi |
| 259 |
\else % left-hand page |
| 260 |
\leftline{\kern-.05em\chapfont#1} |
| 261 |
\vskip\chaptopspace |
| 262 |
\leftline{\title#2} \fi |
| 263 |
\vbox{\hrule width 35pc} |
| 264 |
\def\chapno{#1} \edef\chaptitle{#2} |
| 265 |
\mark{#1\enspace #2} |
| 266 |
\smallskip\noindent} |
| 267 |
|
| 268 |
\def\beginsection#1 #2 \par{ % should not be first in the chapter |
| 269 |
\backup=\lastskip % but should come on first or second page of chapter |
| 270 |
\mark{#1\enspace #2} % because the mark gives running head on right page |
| 271 |
\nobreak\vskip-\backup\penalty-200 |
| 272 |
{\subtitle\baselineskip=34pt |
| 273 |
\noindent\hbox to2\parindent{#1\hfil}\uppercase{\kern-.05em#2}\par} |
| 274 |
\nobreak\vskip5pt\noindent\hbox to2\parindent{}} |
| 275 |
|
| 276 |
\newcount\excount |
| 277 |
\def\beginexercises{\backup=\lastskip \excount=0 |
| 278 |
\mark{\chapno\enspace Exercises} |
| 279 |
\nobreak\vskip-\backup\penalty-200 |
| 280 |
{\subtitle\baselineskip=34pt\noindent Exercises\par}\nobreak} |
| 281 |
|
| 282 |
{\catcode`\|=\active |
| 283 |
\gdef\table#1\tabref|#2|{\hrule height1pt width\hsize \kern2pt |
| 284 |
\noindent\strut{\bf Table |#2|\enspace}#1\par |
| 285 |
\hrule height.5pt width\hsize\tabref|#2|}} |
| 286 |
|
| 287 |
\def\medbr{\ifnum\lastpenalty>9999 \medskip \else\medbreak\fi} |
| 288 |
\def\subhead#1\par{\medbr |
| 289 |
{\subsubtitle\noindent#1\par}\nobreak} |
| 290 |
\def\ex:{\par{\advance\medskipamount-1pt\medbr}% |
| 291 |
\advance\excount 1 \item{\number\excount}} |
| 292 |
|
| 293 |
\def\dash---{\thinspace---\hskip.16667em\relax} |
| 294 |
\def\qback{\kern-.15em} % between , or . and '' |
| 295 |
\def\undertext#1{$\underline{\smash{\hbox{#1}}}$} |
| 296 |
\def\newline{\hfil\break} |
| 297 |
\def\Hint:{{\it Hint:\/}} |
| 298 |
\let\macron=\= % we will use \= for congruence relation |
| 299 |
\def\t#1{{\edef\next{\the\font}\tfont\accent"7F\next#1}} |
| 300 |
|
| 301 |
% Here's a definition that was corrected in plain.tex version 3.14159; |
| 302 |
% I'm keeping the old version here, because I had already been compensating |
| 303 |
% for its deficiencies in script and scriptscript styles; without this |
| 304 |
% buggy version, it would be hard for me to match the old pages precisely |
| 305 |
\def\bmod{\mskip-\medmuskip\mkern5mu |
| 306 |
\mathbin{\rm mod}\penalty900\mkern5mu\mskip-\medmuskip} |
| 307 |
|
| 308 |
% Graffiti macros |
| 309 |
\chardef\other=12 |
| 310 |
\newread\grfi \openin\grfi=\jobname.grf |
| 311 |
%\newwrite\grfo \immediate\openout\grfo=\jobname.grf % let's hope no conflict |
| 312 |
%% Hmmm...; that doesn't work on Unix. |
| 313 |
%% Here's my first solution, a kludge where I alternated between .grf and .gr |
| 314 |
%\newif\ifgrf \newwrite\grfo \newwrite\grfempty |
| 315 |
%\ifeof\grfi \grffalse |
| 316 |
%\else\read\grfi to\grfitest \ifeof\grfi \grffalse \else \grftrue \fi\fi |
| 317 |
%\ifgrf\else \openin\grfi=\jobname.gr |
| 318 |
% \ifeof\grfi\else\read\grfi to\grfitest \fi\fi |
| 319 |
%\immediate\openout\grfo=\jobname.gr\ifgrf\else f\fi |
| 320 |
%\immediate\write\grfo{} % an empty line will start a nonempty file (Unix only) |
| 321 |
%% and then at the end I said |
| 322 |
% \immediate\openout\grfempty=\jobname.gr\ifgrf f\fi % clear the input file |
| 323 |
%% That solution worked with the following original macros |
| 324 |
%\def\testnextgrf{{\def\do##1{\catcode`##1=\other}\dospecials |
| 325 |
% \global\read\grfi to\next}\expandafter\testgrf\meaning\next\testgrf} |
| 326 |
%\expandafter\def\expandafter\testgrf\meaning\empty#1 #2\testgrf{% |
| 327 |
% \setup#2!!!!!$\ifx\thisone\thatone\if#1R\Rtrue\else\Rfalse\fi\else\Rguess\fi} |
| 328 |
%% Anyway, here's my second approach to Unix: (order n^2 algorithm) |
| 329 |
\def\\{{\def\do##1{\catcode`##1=\other}\dospecials \endlinechar=-1 \let\eol=0 |
| 330 |
\gdef\grfmem{} |
| 331 |
\expandafter\def\expandafter\gbbl\meaning\empty{} |
| 332 |
\def\appgrf{\read\grfi to\g |
| 333 |
\ifx\g\empty\else\xdef\grfmem{\grfmem\expandafter\gbbl\meaning\g\eol}\fi} |
| 334 |
\def\next{\ifeof\grfi\let\next\relax\else\appgrf\fi\next}\next}} |
| 335 |
\\ % now \grfmem is "L aaaaa\eol R bbbbb\eol ... R zzzzz\eol". |
| 336 |
\def\testnextgrf#1 #2\eol#3\\{\gdef\grfmem{#3}\setup#2!!!!!$% |
| 337 |
\ifx\thisone\thatone\if#1R\Rtrue\else\Rfalse\fi\else\Rguess\fi} |
| 338 |
\newwrite\grfo \immediate\openout\grfo=\jobname.grf % no conflict now |
| 339 |
|
| 340 |
\def\graffiti{% set up graffiti style |
| 341 |
\hsize=6pc |
| 342 |
\baselineskip=10pt \lineskip=0pt \lineskiplimit=0pt |
| 343 |
\parindent=0pt |
| 344 |
\mathsurround=1pt |
| 345 |
\textfont0=\gmathtext |
| 346 |
\scriptfont0=\gmathsubtext |
| 347 |
\scriptscriptfont0=\gmathsubsubtext |
| 348 |
\textfont1=\gmathlet \let\tfont=\gtfont |
| 349 |
\scriptfont1=\gmathsublet |
| 350 |
\scriptscriptfont1=\gmathsubsublet |
| 351 |
\textfont2=\gmathsym |
| 352 |
\scriptfont2=\gmathsubsym |
| 353 |
\scriptscriptfont2=\gmathsubsubsym |
| 354 |
\textfont3=\gmathext |
| 355 |
\scriptfont3=\gmathsubext |
| 356 |
\scriptscriptfont3=\gmathsubsubext |
| 357 |
\textfont\scrfam=\gmathscr |
| 358 |
\scriptfont\scrfam=\gmathsubscr |
| 359 |
\scriptscriptfont\scrfam=\gmathsubsubscr |
| 360 |
\textfont\frfam=\gmathfr |
| 361 |
\scriptfont\frfam=\gmathsubfr |
| 362 |
\scriptscriptfont\frfam=\gmathsubsubfr |
| 363 |
\textfont\euexfam=\gmatheuex |
| 364 |
\scriptfont\euexfam=\gmathsubsym % OK since I don't use all chars in this size |
| 365 |
\textfont\eqfam=\nineeq |
| 366 |
\def\rm{\fam\z@\gtext}% |
| 367 |
\let\oldsty=\goldstyle |
| 368 |
\let\big=\ninebig |
| 369 |
\setbox\strutbox=\hbox{\vrule height7.25pt depth2.75pt width\z@}% |
| 370 |
\gtext |
| 371 |
\rightskip=\z@ plus2em % ragged right |
| 372 |
\tolerance=2000 |
| 373 |
\hyphenpenalty=300 |
| 374 |
\exhyphenpenalty=300 |
| 375 |
\doublehyphendemerits=100000 |
| 376 |
\finalhyphendemerits=\doublehyphendemerits |
| 377 |
} |
| 378 |
\def\ninebig#1{{\hbox{$\textfont0=\tenrm\textfont2=\tensy |
| 379 |
\left#1\vbox to7.25pt{}\right.\n@space$}}} |
| 380 |
\def\grafctr{\hbox to4.5pc{\hfil##\hfil}} |
| 381 |
|
| 382 |
\newif\ifR % does this entry go on a right-hand page? |
| 383 |
\def\Rguess{\def\ifR{\ifodd\pageno}} |
| 384 |
\long\def\g#1\g{\def\next{#1!!!!!}\expandafter\writegrf\meaning\next$% |
| 385 |
\ifx\grfmem\empty\Rguess\else\expandafter\testnextgrf\grfmem\\\fi |
| 386 |
% pre-Unix, that line was \ifeof\grfi\Rguess\else\testnextgrf\fi |
| 387 |
\setbox0=\vtop{\graffiti#1% |
| 388 |
\write\m@ne\ifR{\Rcheck}\else{\Lcheck}\fi}% log file records successes |
| 389 |
\ifvmode\kern-\prevdepth\kern-\ht0\dp0=\z@\nointerlineskip\bgroup |
| 390 |
\else\dp0=\dp\strutbox\strut\vadjust{\kern-\dp\strutbox\kern-\ht0\fi |
| 391 |
\ifR\moveleft7\else\moveright29\fi pc\box0}} |
| 392 |
\expandafter\def\expandafter\writegrf\meaning\empty#1#2#3#4#5#6${% |
| 393 |
\write\grfo{\LorR #1#2#3#4#5}\def\thisone{#1#2#3#4#5}} |
| 394 |
\def\setup#1#2#3#4#5#6${\def\thatone{#1#2#3#4#5}} |
| 395 |
\def\LorR{\ifodd\pageno R \else L \fi} |
| 396 |
\def\Lcheck{\ifodd\pageno Bad guess!\fi} |
| 397 |
\def\Rcheck{\ifodd\pageno\else Bad guess!\fi} |
| 398 |
|
| 399 |
% Page layout |
| 400 |
\newif\ifpreprint \preprinttrue % should be false when making the final copy |
| 401 |
\newdimen\pageheight \pageheight=\vsize |
| 402 |
\newdimen\totheight \totheight=49.5pc |
| 403 |
\newdimen\folioht \setbox0=\hbox{\foliofont0} \folioht=\ht0 |
| 404 |
\def\leftheadline{\hbox to35pc{\vbox to 10pt{}% strut to position the baseline |
| 405 |
\llap{\kern-2pc\iftitle\leftcorner\else\foliofont\folio\fi\hfil}% |
| 406 |
\iftitle\hfil\copyrite\else\runhead\uppercase\expandafter{\chaptitle}\hfil\fi}} |
| 407 |
\def\rightheadline{\hbox to35pc{\iftitle\copyrite\fi\hfil |
| 408 |
\vbox to 10pt{}% strut to position the baseline |
| 409 |
\iftitle\else\runhead\uppercase\expandafter{\topmark}\fi |
| 410 |
\rlap{\hfil\iftitle\rightcorner\else\foliofont\folio\fi\kern-2pc}}} |
| 411 |
\def\leftcorner{\iffinal\else\vrule\vbox to\folioht{\hrule width9pt\vfil}\fi} |
| 412 |
\def\rightcorner{\iffinal\else\vbox to\folioht{\hrule width9pt\vfil}\vrule\fi} |
| 413 |
\def\copyrite{\ifpreprint{\textfont2=\sevensy\sevenrm\copyright\ 1988 |
| 414 |
Addison-Wesley Publishing Company; all rights reserved}\fi} |
| 415 |
|
| 416 |
\newdimen\htrimsize \htrimsize=7.375in |
| 417 |
\newdimen\vtrimsize \vtrimsize=9.25in |
| 418 |
\newdimen\outermargin \outermargin=23mm |
| 419 |
\newdimen\topmargin \topmargin=10mm % plus height of the headline box |
| 420 |
\newbox\htrim \newbox\vtrim \newbox\trimmarks |
| 421 |
\setbox\htrim=\hbox to\htrimsize{\kern-.65in |
| 422 |
\vrule height .2pt depth .2pt width .4in\hfil\vrule width.4in\kern-.65in} |
| 423 |
\wd\htrim=0pt |
| 424 |
\setbox\vtrim=\vbox to\vtrimsize{\kern-.65in |
| 425 |
\moveleft.2pt\hbox{\vrule height .4in}\vfil |
| 426 |
\moveleft.2pt\hbox{\vrule height .4in}\kern-.65in} |
| 427 |
\wd\vtrim=0pt |
| 428 |
\setbox\trimmarks=\hbox to0pt{\raise\vtrimsize\copy\htrim \copy\htrim |
| 429 |
\copy\vtrim \kern\htrimsize \copy\vtrim\hss} |
| 430 |
\ht\trimmarks=0pt \dp\trimmarks=0pt |
| 431 |
|
| 432 |
\newif\iffinal % are we making the final copy? (pages.tex says "999") |
| 433 |
\def\onepageout#1{\escapechar=-1 % for writing \tabrefs |
| 434 |
\shipout % here we define one page of output |
| 435 |
\iffinal % add the trim marks |
| 436 |
\hbox to\htrimsize{\copy\trimmarks |
| 437 |
\ifodd\pageno\hss\else \hskip\outermargin\fi |
| 438 |
\vbox to\vtrimsize{\kern\topmargin\fi |
| 439 |
\vbox to\totheight{ |
| 440 |
\offinterlineskip % butt the boxes together |
| 441 |
\vskip2.5pt % adjustment at the top (10 Jan 2011) |
| 442 |
\vbox to 2pc{ % this part goes on top of the regular pages |
| 443 |
\ifodd\pageno \rightheadline\else\leftheadline\fi |
| 444 |
\vfill} % this completes the \vbox to 2pc |
| 445 |
\ifodd\pageno\moveright7pc\fi #1 |
| 446 |
\vfill |
| 447 |
\iftitle \global\titlefalse % reset the titlepage switch |
| 448 |
\ifodd\pageno \hbox to35pc{\hfil\foliofont\folio} |
| 449 |
\else\hbox{\foliofont\folio}\fi\fi |
| 450 |
\ifpreprint\ifinxmode\makeinxfooter\fi\fi |
| 451 |
\iffinal % finish the trimmed page |
| 452 |
}\vfill}\ifodd\pageno\hskip\outermargin\else\hss\fi |
| 453 |
\rlap{\smash{\lower30pt\hbox to.35in{\hss\twelvett\number\pageno}}}\fi |
| 454 |
} |
| 455 |
\advancepageno} |
| 456 |
|
| 457 |
\output{\onepageout{\pagebody}} |
| 458 |
|
| 459 |
\newbox\inxfootbanner |
| 460 |
\def\hours{\count0=\time \divide\count0 by60 % find the o'clock |
| 461 |
\multiply\count0 by40 \advance\count0\time % convert to hhmm |
| 462 |
\advance\count0 10000 \expandafter\gobbleone\number\count0\relax} |
| 463 |
\def\gobbleone1{} |
| 464 |
\setbox\inxfootbanner=\rlap{\hbox to 6.5in{\hrulefill\sevenrm\quad |
| 465 |
Author's page proof produced by \TeX\ at |
| 466 |
\hours\space on \ifcase\month\or |
| 467 |
January\or February\or March\or April\or May\or June\or |
| 468 |
July\or August\or September\or October\or November\or December\fi |
| 469 |
\space\number\day}} |
| 470 |
\def\makeinxfooter{\vbox to0pt{\kern10pt\copy\inxfootbanner\kern4pt |
| 471 |
\rlap{\vbadness=\maxdimen \inxcolumns}\vss}} |
| 472 |
\def\inxcolumns{\ifvoid\inxbox\let\next\relax\else\let\next\contribcol\fi\next} |
| 473 |
\def\contribcol{\setbox0=\vsplit\inxbox to54pt |
| 474 |
\vtop{\unvbox0}\kern20pt \inxcolumns} |
| 475 |
\def\inxstyle{\vrule height6pt depth2pt width\z@ \sevenrm} |
| 476 |
\splittopskip=6pt |
| 477 |
|
| 478 |
% Cross references |
| 479 |
|
| 480 |
% \ref{value}|name| gives value to |name| |
| 481 |
% \eqref|name| gives \eqcount to |name| |
| 482 |
% \exref|name| gives \excount to |name| |
| 483 |
% \tabref|name| gives appropriate page number to |name| |
| 484 |
% \refin foo inputs references from job foo (other than this job) |
| 485 |
% \showmissestrue if you want to see missing references |
| 486 |
|
| 487 |
\newif\ifshowmisses |
| 488 |
\def\vertical{|} |
| 489 |
\def\inref#1 #{\expandafter\def\csname\vertical#1\endcsname} |
| 490 |
|
| 491 |
\catcode`\|=\active |
| 492 |
\expandafter\def\expandafter\dospecials\expandafter{\dospecials\do\|} |
| 493 |
\newcount\defcount % number of old definitions not yet repeated |
| 494 |
\newcount\changecount % number of new definitions that are changed |
| 495 |
\newcount\miscount % number of unknown references |
| 496 |
|
| 497 |
\newread\tempin |
| 498 |
\def\refin#1 {\openin\tempin=#1.ref |
| 499 |
\ifeof\tempin\closein\tempin |
| 500 |
\else\closein\tempin \let|\inref \input#1.ref \let|\crossref \fi} |
| 501 |
|
| 502 |
{\let\|=\jobname |
| 503 |
\def\def{\global\advance\defcount1 \gdef}\expandafter\refin\| } |
| 504 |
\newwrite\refo \immediate\openout\refo=\jobname.ref |
| 505 |
|
| 506 |
\def\ref#1|#2|{\xdef\temp{#1}\expandafter\dordef\csname\vertical#2\endcsname} |
| 507 |
\def\dordef#1{\ifx#1\temp \global\advance\defcount-1 |
| 508 |
\else\global\advance\changecount1 \global\let#1\temp\fi |
| 509 |
{\escapechar=-1\immediate\write\refo{\noexpand#1{\temp}}}} |
| 510 |
\def\eqref{\ref{\number\eqcount}} |
| 511 |
\def\exref{\ref{\number\excount}} |
| 512 |
\def\tabref|#1|{\expandafter\pageref\csname\vertical#1\endcsname} |
| 513 |
\def\pageref#1{\ifx#1\relax\else\global\advance\defcount-1 \fi |
| 514 |
\write\refo{\noexpand#1{\number\pageno}}% |
| 515 |
\write\m@ne{\ifx#1\relax New Pageref!\else |
| 516 |
\ifnum#1=\pageno\else Changed Pageref!\fi\fi}} |
| 517 |
\def\crossref#1|{\expandafter\usedef\csname\vertical#1\endcsname} |
| 518 |
\def\usedef#1{\ifx#1\relax |
| 519 |
\ifshowmisses\showmiss#1\fi\global\advance\miscount1 ??\else #1\fi} |
| 520 |
\let|=\crossref |
| 521 |
\def\showmiss#1{{\escapechar=-1% |
| 522 |
\message{***** WARNING: Undefined reference #1\string|! *****}}} |
| 523 |
|
| 524 |
\def\cite#1.{\ifinxmode\write\bnx{[#1] \number\pageno.}\fi#1} |
| 525 |
{\catcode`\@=\active |
| 526 |
\gdef\newcite#1.{\ifinxmode\write\bnx{[#1'] \number\pageno.}\fi#1$'@$}} |
| 527 |
|
| 528 |
\outer\def\bye{ |
| 529 |
\ifnum\miscount>0 |
| 530 |
\message{(\the\miscount\space undefined references were present)}\fi |
| 531 |
\ifnum\changecount>0 |
| 532 |
\message{(\the\changecount\space new references written on \jobname.ref)}\fi |
| 533 |
\ifnum\defcount>0 |
| 534 |
\message{(\the\defcount\space old references dropped from \jobname.ref)}\fi |
| 535 |
\par\vfill\supereject |
| 536 |
\end} |
| 537 |
|
| 538 |
% Exercises |
| 539 |
|
| 540 |
\newwrite\ans |
| 541 |
\immediate\openout\ans=\jobname.ans |
| 542 |
|
| 543 |
\outer\def\answer{\par |
| 544 |
\immediate\write\ans{} |
| 545 |
\immediate\write\ans{\string\ansno\chapno.\the\excount:} |
| 546 |
\copytoblankline} |
| 547 |
\def\copytoblankline{\begingroup\setupcopy\copyans} |
| 548 |
\def\setupcopy{\def\do##1{\catcode`##1=\other}\dospecials \obeylines} |
| 549 |
{\obeylines \gdef\copyans#1 |
| 550 |
{\def\next{#1}% |
| 551 |
\ifx\next\empty\let\next=\endgroup % |
| 552 |
\else\immediate\write\ans{\next} \let\next=\copyans\fi\next}} |
| 553 |
|
| 554 |
\def\ansno#1:{\par\medbreak\def\thisansno{\source#1}% |
| 555 |
\noindent\hbox to\parindent{\bf #1\hfil}\ignorespaces} |
| 556 |
|
| 557 |
% Pictures (a subset of \LaTeX's conventions) |
| 558 |
\newskip\hsssglue \hsssglue=0pt plus 1fill minus 1fill \def\hsss{\hskip\hsssglue} |
| 559 |
|
| 560 |
\newdimen\unitlength \newdimen\linethickness |
| 561 |
\newdimen\@picheight \newdimen\@xdim \newdimen\@ydim \newdimen\@len \newdimen\@save |
| 562 |
\newcount\@multicount \newcount\@xarg \newcount\@yarg |
| 563 |
\newbox\@picbox \newbox\@mpbox |
| 564 |
|
| 565 |
\font\tenln=line10 \font\tenlnw=linew10 |
| 566 |
\font\tencirc=lcircle10 \font\tencircw=lcirclew10 |
| 567 |
\font\smallln=linew10 scaled 483 % that's magstep-4 |
| 568 |
|
| 569 |
\def\thinlines{\let\linefont=\tenln \let\circlefont=\tencirc |
| 570 |
\linethickness=\fontdimen8\linefont} |
| 571 |
\def\thicklines{\let\linefont=\tenlnw \let\circlefont=\tencircw |
| 572 |
\linethickness=\fontdimen8\linefont} |
| 573 |
\thinlines |
| 574 |
|
| 575 |
\def\beginpicture(#1,#2)(#3,#4){\@picheight=#2\unitlength \let\line=\@line |
| 576 |
\setbox\@picbox=\hbox to#1\unitlength\bgroup |
| 577 |
\kern-#3\unitlength \lower#4\unitlength\hbox\bgroup\ignorespaces} |
| 578 |
\def\endpicture{\egroup\hss\egroup |
| 579 |
\ht\@picbox=\@picheight \dp\@picbox=\z@ |
| 580 |
\leavevmode\box\@picbox} |
| 581 |
|
| 582 |
\def\put(#1,#2)#3{\raise#2\unitlength\rlap{\kern#1\unitlength #3}\ignorespaces} |
| 583 |
|
| 584 |
\def\multiput(#1,#2)(#3,#4)#5#6{\@multicount=#5 |
| 585 |
\@xdim=#1\unitlength \@ydim=#2\unitlength \setbox\@mpbox=\hbox{#6}% |
| 586 |
\loop\ifnum\@multicount>0 |
| 587 |
\raise\@ydim\rlap{\kern\@xdim \unhcopy\@mpbox}% |
| 588 |
\advance\@xdim#3\unitlength \advance\@ydim#4\unitlength |
| 589 |
\advance\@multicount\m@ne \repeat\ignorespaces} |
| 590 |
|
| 591 |
\def\makebox(#1,#2)#3{\setbox\@picbox=\hbox to#1\unitlength{\hss#3\hss}% |
| 592 |
\@ydim=\ht\@picbox \advance\@ydim-\dp\@picbox |
| 593 |
\ht\@picbox=#2\unitlength \dp\@picbox=\z@ |
| 594 |
\leavevmode\lower.5\@ydim\box\@picbox} |
| 595 |
|
| 596 |
\newif\ifneg |
| 597 |
\def\@line(#1,#2)#3{\@xarg=#1 \@yarg=#2 \@len=#3\unitlength \leavevmode |
| 598 |
\ifnum\@xarg<0 \reverseline \else \negfalse \@ydim=\z@\fi |
| 599 |
\ifnum\@xarg=0 \@vline |
| 600 |
\else\ifnum\@yarg=0 \@hline \else\@sline\fi\fi |
| 601 |
\ifneg\kern-\@len\else\@save=\@ydim\fi} |
| 602 |
\def\reverseline{\negtrue \kern-\@len \@xarg=-\@xarg |
| 603 |
\@ydim=\@len \multiply\@ydim\@yarg \divide\@ydim\@xarg \@yarg=-\@yarg} |
| 604 |
|
| 605 |
\def\@hline{\vrule height.5\linethickness depth.5\linethickness width\@len} |
| 606 |
\def\@vline{\kern-.5\linethickness\vrule width\linethickness |
| 607 |
\ifnum\@yarg<0 height\z@ depth\else depth\z@ height\fi\@len |
| 608 |
\kern-.5\linethickness} |
| 609 |
|
| 610 |
\def\@sline{\setbox\@picbox=\hbox{\linefont \count@=\@xarg \multiply\count@ 8 |
| 611 |
\ifnum\@yarg>0 \advance\count@\@yarg \advance\count@-9 |
| 612 |
\else \advance\count@-\@yarg \advance\count@ 55 \fi \char\count@}% |
| 613 |
\ifnum\@yarg<0 \@picheight=-\ht\@picbox \advance\@ydim\@picheight |
| 614 |
\else \@picheight=\ht\@picbox \fi |
| 615 |
\@xdim=\wd\@picbox \@save=\@ydim |
| 616 |
\loop\ifdim\@xdim<\@len \raise\@ydim\copy\@picbox |
| 617 |
\advance\@xdim\wd\@picbox \advance\@ydim\@picheight \repeat |
| 618 |
\advance\@xdim-\@len \kern-\@xdim |
| 619 |
\multiply\@xdim\@yarg \divide\@xdim\@xarg \advance\@ydim-\@xdim |
| 620 |
\raise\@ydim\box\@picbox} |
| 621 |
|
| 622 |
\def\vector(#1,#2)#3{\@line(#1,#2){#3}% |
| 623 |
\ifnum\@xarg=0 \@vvector \else\ifnum\@yarg=0 \@hvector \else\@svector\fi\fi} |
| 624 |
\def\@hvector{\ifneg\rlap{\linefont\char27}\else |
| 625 |
\smash{\llap{\linefont\char45}}\fi} % we have to smash because of font bug |
| 626 |
\def\@vvector{\ifnum\@yarg<0 \raise-\@len\rlap{\linefont\char63}% |
| 627 |
\else\setbox\@picbox=\rlap{\linefont\char54}\advance\@len-\ht\@picbox |
| 628 |
\raise\@len\box\@picbox\fi} |
| 629 |
|
| 630 |
\def\@svector{\setbox\@picbox=\hbox to\z@{\linefont |
| 631 |
\ifnum\@yarg<0 \count@=55 \@yarg=-\@yarg \else\count@=-9 \fi |
| 632 |
\ifneg\multiply\@xarg16 \multiply\@yarg2 |
| 633 |
\else\hss % \llap |
| 634 |
\ifnum\@xarg>2 \multiply\@xarg9 \multiply\@yarg2 \advance\count@29 |
| 635 |
\else\ifnum\@yarg>2 \multiply\@xarg16 \multiply\@yarg9 \advance\count@-20 |
| 636 |
\else\multiply\@xarg24 \multiply\@yarg3 \fi\fi\fi |
| 637 |
\advance\count@\@xarg \advance\count@\@yarg \char\count@ |
| 638 |
\ifneg\hss\fi}% \rlap |
| 639 |
\raise\@save\box\@picbox} |
| 640 |
|
| 641 |
\def\disk#1{\@len=#1\unitlength \count@='160 \@diskcirc} |
| 642 |
\def\circle#1{\@len=#1\unitlength \count@='140 \@diskcirc} |
| 643 |
\def\@diskcirc{\setbox\@picbox=\hbox{\circlefont\char\count@}\@xdim=\wd\@picbox |
| 644 |
\leavevmode \ifdim\@len>15.499\@xdim \@bigdc \else \@smalldc\fi} |
| 645 |
\def\@bigdc{\ifnum\count@<'160 \@bigcirc |
| 646 |
\else \@len=15\@xdim \@diskcirc\fi} |
| 647 |
\def\@smalldc{{\advance\@len-.5\@xdim |
| 648 |
\loop\ifdim\@xdim<\@len \advance\count@\@ne \advance\@xdim\wd\@picbox\repeat |
| 649 |
\hbox{\circlefont\char\count@}}} |
| 650 |
\def\@bigcirc{{\circlefont\count@=15 |
| 651 |
\setbox\@picbox=\hbox{\char\count@}\@xdim=\wd\@picbox |
| 652 |
\ifdim\@len>2.5\@xdim \@len=2.5\@xdim\fi |
| 653 |
\advance\@len-.125\wd\@picbox |
| 654 |
\loop\ifdim\@xdim<\@len \advance\count@ 4 \advance\@xdim.25\wd\@picbox\repeat |
| 655 |
\@ydim=.5\@xdim \advance\@ydim.5\linethickness |
| 656 |
\setbox\@picbox=\vbox{\hbox{\char\count@\advance\count@-3\char\count@}% |
| 657 |
\nointerlineskip |
| 658 |
\hbox{\advance\count@\m@ne\char\count@\advance\count@\m@ne\char\count@}}% |
| 659 |
\kern-\@ydim\lower\@ydim\box\@picbox}} |
| 660 |
|
| 661 |
\newif\ifovaltl \newif\ifovaltr \newif\ifovalbl \newif\ifovalbr |
| 662 |
\ovaltltrue \ovaltrtrue \ovalbltrue \ovalbrtrue |
| 663 |
\def\oval(#1,#2){\@xdim=#1\unitlength \@ydim=#2\unitlength |
| 664 |
{\circlefont \setbox\@picbox=\hbox{\char0} |
| 665 |
\ifdim\@xdim<\wd\@picbox \@xdim=\wd\@picbox\fi |
| 666 |
\ifdim\@ydim<\wd\@picbox \@ydim=\wd\@picbox\fi |
| 667 |
\@save=\@xdim \ifdim\@ydim<\@save \@save=\@ydim \fi |
| 668 |
\count@=39 |
| 669 |
\loop \setbox\@picbox=\hbox{\char\count@}\ifdim\@save<\wd\@picbox |
| 670 |
\advance\count@-4 \repeat |
| 671 |
\setbox\strutbox=\hbox{\vrule height\ht\@picbox depth\dp\@picbox width\z@ |
| 672 |
\kern\wd\@picbox}% |
| 673 |
\@save=.5\wd\@picbox \advance\@save-.5\linethickness |
| 674 |
\setbox0=\hbox to\@xdim{\ifovaltl\char\count@\else\strut\fi |
| 675 |
\kern-\@save\leaders\hrule height\ifovaltl\linethickness\else\z@\fi\hfil |
| 676 |
\leaders\hrule height\ifovaltr\linethickness\else\z@\fi\hfil\kern\@save |
| 677 |
\ifovaltr\advance\count@-3\char\count@\else\strut\fi\kern-\wd\@picbox}% |
| 678 |
\advance\count@\m@ne |
| 679 |
\setbox2=\hbox to\@xdim{\ifovalbl\char\count@\else\strut\fi |
| 680 |
\kern-\@save\leaders\hrule height\ifovalbl\linethickness\else\z@\fi\hfil |
| 681 |
\leaders\hrule height\ifovalbr\linethickness\else\z@\fi\hfil\kern\@save |
| 682 |
\ifovalbr\advance\count@\m@ne\char\count@\else\strut\fi\kern-\wd\@picbox}% |
| 683 |
\@save=\@ydim \advance\@save-\wd\@picbox \divide\@save 2 |
| 684 |
\setbox\@picbox=\vbox{\box0\nointerlineskip |
| 685 |
\hbox to\@xdim{\vrule height\@save width\ifovaltl\linethickness\else\z@\fi |
| 686 |
\hfil\ifovaltr\vrule width\linethickness\kern-\linethickness\fi}% |
| 687 |
\nointerlineskip |
| 688 |
\hbox to\@xdim{\vrule height\@save width\ifovalbl\linethickness\else\z@\fi |
| 689 |
\hfil\ifovalbr\vrule width\linethickness\kern-\linethickness\fi}% |
| 690 |
\nointerlineskip\box2}% |
| 691 |
\@save=.5\@ydim \advance\@save.5\linethickness \leavevmode |
| 692 |
\kern-.5\@xdim \kern-.5\linethickness \lower\@save\box\@picbox}} |
| 693 |
|
| 694 |
\def\cpic#1\endcpic{\vcenter{\hbox{\beginpicture#1\endpicture}}} |
| 695 |
|
| 696 |
% Squines (quadratic splines) |
| 697 |
% example of use: to plot f(x) between x0 and x1, you can say |
| 698 |
% \put(0,0){\squine(x0,xm,x1,y0,ym,y1)}, where y0=f(x0), y1=f(x1) |
| 699 |
% xm=(y0-y1+s1x1-s0x0)/(s1-s0), ym=(s0(s1x1-y1)-s1(s0x0-y0))/(s1-s0), |
| 700 |
% s0=f'(x0), and s1=f'(x1). |
| 701 |
|
| 702 |
\newdimen\@xi \newdimen\@xii \newdimen\@xiii \newdimen\@xiv |
| 703 |
\newdimen\@xpt \newdimen\@xoldpt |
| 704 |
\newdimen\@yi \newdimen\@yii \newdimen\@yiii \newdimen\@yiv |
| 705 |
\newdimen\@ypt \newdimen\@yoldpt |
| 706 |
\def\squine(#1,#2,#3,#4,#5,#6){\setbox\@picbox\hbox{\tencirc q}% |
| 707 |
\global\@xoldpt=#1\unitlength \global\@yoldpt=#4\unitlength \kern\@xoldpt |
| 708 |
\@xi=\@xoldpt \@xii=#2\unitlength \@xiii=#3\unitlength |
| 709 |
\@yi=\@yoldpt \@yii=#5\unitlength \@yiii=#6\unitlength |
| 710 |
\squinerec |
| 711 |
\@xpt=#3\unitlength \@ypt=#6\unitlength \@addpoint |
| 712 |
\raise\@ypt\copy\@picbox} |
| 713 |
\newif\iffar |
| 714 |
\def\squinerec{\farfalse \testnear\@xi\@xiii \testnear\@yi\@yiii |
| 715 |
\iffar \decast \fi} |
| 716 |
\def\testnear#1#2{\@save=#1\advance\@save-#2% |
| 717 |
\ifdim\@save<\z@ \@save=-\@save\fi \ifdim\@save>\p@ \fartrue \fi} |
| 718 |
\def\decast{\@xpt=\@xi \advance\@xpt\@xii \divide\@xpt2 |
| 719 |
\advance\@xii\@xiii \divide\@xii2 |
| 720 |
\@xiv=\@xpt \advance\@xiv\@xii \divide\@xiv2 |
| 721 |
\@ypt=\@yi \advance\@ypt\@yii \divide\@ypt2 |
| 722 |
\advance\@yii\@yiii \divide\@yii2 |
| 723 |
\@yiv=\@ypt \advance\@yiv\@yii \divide\@yiv2 |
| 724 |
\begingroup\@xii=\@xpt \@xiii=\@xiv |
| 725 |
\@yii=\@ypt \@yiii=\@yiv \squinerec\endgroup |
| 726 |
\@xpt=\@xiv \@ypt=\@yiv \@addpoint |
| 727 |
\@xi=\@xiv \@yi=\@yiv \squinerec} |
| 728 |
\def\@addpoint{%\message{(\the\@xpt,\the\@ypt)}% |
| 729 |
\global\advance\@xoldpt-\@xpt \wd\@picbox=-\@xoldpt |
| 730 |
\raise\@yoldpt\copy\@picbox \global\@xoldpt=\@xpt \global\@yoldpt=\@ypt} |
| 731 |
|
| 732 |
% Math operators |
| 733 |
\def\2{\mskip-.5mu2\mskip.5mu} |
| 734 |
\newmuskip\lessfortimes \lessfortimes=-2mu minus -2mu |
| 735 |
\def\cdt{\mskip\lessfortimes\cdot\mskip\lessfortimes} |
| 736 |
\def\nullnum{\phantom{0}} |
| 737 |
\def\twonullnum{\phantom{00}} |
| 738 |
\def\bex{\mskip-2mu} |
| 739 |
\def\twoconditions#1#2{_{\scriptstyle#1\atop\scriptstyle#2}} |
| 740 |
\def\tworestrictions#1#2{\vcenter{\offinterlineskip |
| 741 |
\halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}} |
| 742 |
\def\dts{\mathinner{\ldotp\ldotp}} |
| 743 |
\def\[#1]{[\hbox{$\mskip1mu\thickmuskip=\thinmuskip#1\mskip1mu$}]} |
| 744 |
\def\bigi[#1\bigr]{\bigl[\hbox{$\thickmuskip=\thinmuskip#1$}\bigr]} |
| 745 |
\def\Bigi[#1\Bigr]{\Bigl[\hbox{$\thickmuskip=\thinmuskip#1$}\Bigr]} |
| 746 |
\def\prp(#1){(\hbox{$\thickmuskip=\thinmuskip#1$})} |
| 747 |
\def\pbigi(#1\bigr){\bigl(\hbox{$\thickmuskip=\thinmuskip#1$}\bigr)} |
| 748 |
\def\_#1{\def\next{#1}% |
| 749 |
\ifx\next\risingsign\expandafter\rising\else^{\underline{#1}}\fi} |
| 750 |
\def\risingsign{^} |
| 751 |
\def\rising#1{^{\overline{#1}}} |
| 752 |
\def\dotminus{\mathbin{\buildrel{\hbox{\runhead.}}\over{\smash{-}\vphantom{_2}}}} |
| 753 |
\let\divides=\backslash |
| 754 |
\def\edivides{\divides\mskip-4mu\divides} |
| 755 |
\def\ndivides{\mathpalette\notdiv\relax} |
| 756 |
\def\notdiv#1#2{\setbox0=\hbox{$#1\divides$}% |
| 757 |
\vcenter{\hbox to\wd0{$\hss\scriptscriptstyle/\hss$}}\kern-\wd0 |
| 758 |
\vcenter{\hbox to\wd0{$\hss\kern.5pt\scriptscriptstyle/\hss$}}\kern-\wd0 |
| 759 |
\box0\relax} |
| 760 |
\def\spec{\mathop{\rm Spec}} |
| 761 |
\def\half{{1\over2}} |
| 762 |
\def\rp{\mathchar"323F } % relatively prime |
| 763 |
\def\lcm{\mathop{\rm lcm}} |
| 764 |
\def\And{\quad{\rm and}\quad} |
| 765 |
\let\==\equiv |
| 766 |
\def\tmod#1{(mod~$#1$)} |
| 767 |
\def\pmod#1{\allowbreak\mkern18mu\hbox{(}{\rm mod}\,\,#1\hbox{)}} |
| 768 |
\let\implies=\Longrightarrow |
| 769 |
\def\?{\hbox{!`}} % subfactorial |
| 770 |
\def\hyp{\mathop{F{}}\nolimits\hyper} |
| 771 |
\def\tightplus{\medmuskip=1.5mu\relax} |
| 772 |
\def\hyper#1#2#3{\mathchoice{\tightplus |
| 773 |
\hbox{$\displaystyle\biggl({#1\atop#2}\Big\vert\,{#3}\!\biggr)$}}% |
| 774 |
{\bigl({#1\atop#2}\vert\mskip2mu#3\bigr)}% |
| 775 |
{}{}} % used only in D and T styles |
| 776 |
%\def\hypk_#1{\mathop{F{}}_{#1}\nolimits\hyper} % confl with mFn convention |
| 777 |
\def\hypk_#1#2#3#4{\mathop{F{}}\mathchoice{\tightplus |
| 778 |
\hbox{$\displaystyle\biggl({#2\atop#3}\Big\vert\,{#4}\!\biggr)$}% |
| 779 |
\lower\fontdimen11\mathsym\hbox{$\scriptstyle\!#1$}}% |
| 780 |
{\bigl({#2\atop#3}\vert\mskip2mu#4\bigr)\lower\fontdimen12\mathsym |
| 781 |
\hbox{$\scriptstyle\!#1$}}% |
| 782 |
{}{}} % used only in D and T styles |
| 783 |
\def\double(#1\choose#2){\mathchoice{\biggl(\!\!{#1\choose#2}\!\!\biggr)} |
| 784 |
{\bigl(\!{#1\choose#2}\!\bigr)}{}{}} % only D and T styles |
| 785 |
\def\hypstrut{\vphantom{_1\_^k}} % if there's another denominator with \_^k |
| 786 |
\def\deg{\mathop{\rm deg}} |
| 787 |
\def\Bscr{{\scr B}} |
| 788 |
\def\Escr{{\scr E}} |
| 789 |
\def\Fscr{{\scr F}} |
| 790 |
\def\Pscr{{\scr P}} |
| 791 |
\def\Sscr{{\scr S}} |
| 792 |
\def\adj{\relbar\joinrel\relbar} % adjacent in a graph |
| 793 |
\let\<=\langle \let \>=\rangle |
| 794 |
\def\Pr{\mathop{\rm Pr}\nolimits} |
| 795 |
\def\Mean{\mathop{\rm Mean}\nolimits} |
| 796 |
\def\Var{\mathop{\rm Var}\nolimits} |
| 797 |
\def\between{\big\vert\hbox{\vphantom)}} % \between_a^b |
| 798 |
{\catcode`\'=\active \gdef'{^\bgroup\mskip2mu\prim@s}} % more space before ' |
| 799 |
\def\array#1[#2]{\hbox{\tt#1[$#2$]}} |
| 800 |
\def\given{\mskip1mu\vert\mskip1mu} |
| 801 |
\def\euler{\atopwithdelims<>} |
| 802 |
\def\Euler#1#2{\mathchoice{\biggl<\mskip-7mu{#1\euler#2}\mskip-7mu\biggr>}% |
| 803 |
{\bigl<\!{#1\euler#2}\!\bigr>}{}{}} |
| 804 |
|
| 805 |
\newbox\phihatbox \newbox\scrphihatbox |
| 806 |
\setbox\phihatbox=\hbox{$\phi$} \ht\phihatbox=1ex |
| 807 |
\setbox\scrphihatbox=\hbox{$\scriptstyle\phi$} |
| 808 |
\ht\scrphihatbox=\fontdimen5\mathsublet |
| 809 |
\setbox\phihatbox=\hbox{$\widehat{\box\phihatbox}$} |
| 810 |
\setbox\scrphihatbox=\hbox{$\hat{\box\scrphihatbox}$} |
| 811 |
\def\phihat{\mathchoice{\copy\phihatbox}{\copy\phihatbox}% |
| 812 |
{\copy\scrphihatbox}{{\hat\phi}}} |
| 813 |
|
| 814 |
\newbox\mathsizebox |
| 815 |
\def\setmathsize#1{\global\setbox\mathsizebox=\hbox{\displaymath#1$}} |
| 816 |
\def\mathsize#1{\hbox to\wd\mathsizebox{\displaymath#1$\hss}} |
| 817 |
|
| 818 |
\newbox\sqrtstrutbox |
| 819 |
\setbox\sqrtstrutbox=\hbox{\vrule height10.5pt width\z@} |
| 820 |
\def\strutsqrt#1{\copy\sqrtstrutbox\sqrt{{}^{\mathstrut}#1}} |
| 821 |
|
| 822 |
\newbox\Sqbox % for sum of squares |
| 823 |
\setbox\Sqbox=\vbox{\tenrm\hrule height.6pt\kern-.6pt |
| 824 |
\hbox to1.5ex{\vrule height1.5ex width.6pt\hss\vrule width.6pt}\kern-.6pt |
| 825 |
\hrule height.3pt depth.3pt} |
| 826 |
\def\Sq{\mskip1.5mu\copy\Sqbox\mskip1.5mu} |
| 827 |
|
| 828 |
% primitive index macros |
| 829 |
% "stuff for index" will go into a file for sorting and into normal text |
| 830 |
% "!stuff for index" will go into the file only |
| 831 |
\expandafter\def\expandafter\dospecials\expandafter{\dospecials\do\"} |
| 832 |
\def\hexcode{"} \catcode`\"=\active |
| 833 |
|
| 834 |
\newif\ifinxmode |
| 835 |
\newwrite\inx \newwrite\bnx |
| 836 |
\newbox\inxbox |
| 837 |
|
| 838 |
\newif\ifsilent |
| 839 |
\def\beginxref{\futurelet\next\beginxrefswitch} |
| 840 |
\def\beginxrefswitch{\ifx\next!\let\next=\silentxref |
| 841 |
\else\silentfalse\let\next=\xref\fi \next} |
| 842 |
\def\silentxref!{\silenttrue\xref} |
| 843 |
\let"=\beginxref |
| 844 |
|
| 845 |
\def\xref#1"{\ifinxmode\edef\text{#1}\makexref\fi |
| 846 |
\ifsilent\ignorespaces\else#1\fi} |
| 847 |
\def\makexref{\global\setbox\inxbox=% |
| 848 |
\vbox{\unvbox\inxbox\allowbreak\hbox{\inxstyle\text}}% |
| 849 |
\xdef\writeit{\write\inx{\text\space!\space |
| 850 |
\noexpand\number\pageno.}}\writeit} |
| 851 |
|
| 852 |
% Final considerations |
| 853 |
\catcode`\@=\active \def@{\mskip1mu\relax} |
| 854 |
\expandafter\def\expandafter\dospecials\expandafter{\dospecials\do\@} |
| 855 |
|
| 856 |
\hyphenation{logical Mac-Mahon hyper-geo-metric hyper-geo-met-rics Ber-noulli} |
| 857 |
|
| 858 |
\preprintfalse % WE ARE MAKING THE REAL BOOK! |
| 859 |
\inxmodetrue % WE ARE PREPARING A ROUGH INDEX |
| 860 |
\showmissestrue % THE REFERENCES SHOULD ALL BE READY NOW |
| 861 |
|
| 862 |
\ifinxmode\immediate\openout\inx=\jobname.inx \fi % file for index reminders |
| 863 |
\ifinxmode\immediate\openout\bnx=\jobname.bnx \fi % file for bib reminders |
| 864 |
|
| 865 |
% To make the book: |
| 866 |
% First TeX BIB, to get BIB.REF correct. (Must have \cite entries.) |
| 867 |
% Then TeX CHAP1..CHAP9, PREF, ANS, CRED, FRONT, CONT. |
| 868 |
% Then make BNX file from individual *.BNX files including BIB.BNX. |
| 869 |
% Then reTeX BIB. |
| 870 |
% *.INX files are raw data only. Index and Contents are prepared by hand. |
| 871 |
|
| 872 |
% To produce only a subset of pages, put the page numbers on separate |
| 873 |
% lines in a file called pages.tex, ended by 999 |
| 874 |
% WARNING: This will screw up the .grf file! Save it, then restore it. |
| 875 |
% WARNING: This may screw up the .ref file (if there are \tabrefs). Ditto. |
| 876 |
\let\Shipout=\shipout |
| 877 |
\newread\pages \newcount\nxtpg \openin\pages=pages |
| 878 |
\def\getnxtpg{\ifeof\pages\else |
| 879 |
{\endlinechar=-1\read\pages to\next |
| 880 |
\ifx\next\empty % in this case we should have eof now |
| 881 |
\else\global\nxtpg=\next\fi}\fi} |
| 882 |
\ifeof\pages\finalfalse\else\finaltrue |
| 883 |
\getnxtpg |
| 884 |
\ifnum\nxtpg=999 |
| 885 |
\message{OK, I'm making final copy with trim marks!} |
| 886 |
\hoffset=-.5in |
| 887 |
\getnxtpg % this should ensure eof on the \pages file |
| 888 |
\else\message{OK, I'll ship only the requested pages!} |
| 889 |
\hoffset=-.5in\fi\fi |
| 890 |
\def\shipout{\ifeof\pages\let\next=\Shipout |
| 891 |
\else\ifnum\pageno=\nxtpg\getnxtpg\let\next=\Shipout |
| 892 |
\else\let\next=\Tosspage\fi\fi \next} |
| 893 |
\newbox\garbage \def\Tosspage{\deadcycles=0\setbox\garbage=} |