| 1 |
% \def\filename{amsdtx.dtx} |
| 2 |
% \def\fileversion{2.07} |
| 3 |
% \def\filedate{2009/08/19} |
| 4 |
% |
| 5 |
% \iffalse meta-comment |
| 6 |
% |
| 7 |
% American Mathematical Society |
| 8 |
% Technical Support |
| 9 |
% Publications Technical Group |
| 10 |
% 201 Charles Street |
| 11 |
% Providence, RI 02904 |
| 12 |
% USA |
| 13 |
% tel: (401) 455-4080 |
| 14 |
% (800) 321-4267 (USA and Canada only) |
| 15 |
% fax: (401) 331-3842 |
| 16 |
% email: [email protected] |
| 17 |
% |
| 18 |
% Copyright 1996, 1999, 2004, 2009 American Mathematical Society. |
| 19 |
% |
| 20 |
% This work may be distributed and/or modified under the |
| 21 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 22 |
% of this license or (at your option) any later version. |
| 23 |
% The latest version of this license is in |
| 24 |
% http://www.latex-project.org/lppl.txt |
| 25 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 26 |
% version 2005/12/01 or later. |
| 27 |
% |
| 28 |
% This work has the LPPL maintenance status `maintained'. |
| 29 |
% |
| 30 |
% The Current Maintainer of this work is the American Mathematical |
| 31 |
% Society. |
| 32 |
% |
| 33 |
% \fi |
| 34 |
% |
| 35 |
% \iffalse |
| 36 |
% The following section of code makes this file self-printable. |
| 37 |
%<*driver> |
| 38 |
\NeedsTeXFormat{LaTeX2e} |
| 39 |
\documentclass{amsdtx} |
| 40 |
|
| 41 |
\newcommand{\rp}{\let\PBS\\\raggedright\let\\\PBS} |
| 42 |
|
| 43 |
\CodelineIndex |
| 44 |
|
| 45 |
\begin{document} |
| 46 |
|
| 47 |
\title{The \cls{amsldoc} and \cls{amsdtx} document classes} |
| 48 |
|
| 49 |
\author{American Mathematical Society\\Michael Downes\\ |
| 50 |
updated by David M. Jones} |
| 51 |
|
| 52 |
\date{Version \fileversion, \filedate} |
| 53 |
|
| 54 |
\DocInput{amsdtx.dtx} |
| 55 |
|
| 56 |
\PrintIndex |
| 57 |
|
| 58 |
\end{document} |
| 59 |
%</driver> |
| 60 |
% \fi |
| 61 |
% |
| 62 |
%^^A If this file is printed by itself the \fileversion and \filedate |
| 63 |
%^^A information will come from the file header rather than from the |
| 64 |
%^^A \ProvidesClass command. See \hDocInput. |
| 65 |
% \maketitle |
| 66 |
% |
| 67 |
% \tableofcontents |
| 68 |
% |
| 69 |
% \MakeShortVerb\| |
| 70 |
% \section{Introduction} |
| 71 |
% This file is the source for two documentclasses, \cls{amsldoc} |
| 72 |
% (used for the \amslatex/ user's guide) and \cls{amsdtx} (used for |
| 73 |
% printing AMS \fn{.dtx} files). The generic \cls{book} class is used |
| 74 |
% as a base, but the \cls{amsdtx} class is modified to serve as an |
| 75 |
% article-type class. This affects the form of documentation files |
| 76 |
% mainly in the use of \cn{maketitle} and \cn{chapter}. |
| 77 |
% |
| 78 |
% \begin{table} |
| 79 |
% \caption{Features of the \cls{amsldoc} and \cls{amsdtx} classes} |
| 80 |
% \centering |
| 81 |
% \begin{tabular}{lp{.65\columnwidth}} |
| 82 |
% Command Name& Purpose\\ |
| 83 |
% \hline |
| 84 |
% \cn{cn}& \rp To print a user command name: \verb"\cn{title}"; leading |
| 85 |
% backslash can be optionally included for control symbols: |
| 86 |
% \verb"\cn{\%}". The \cn{cn} command works properly even in macro |
| 87 |
% arguments (compare to, e.g., \cn{verb}\verb"'\newif'"). But beware |
| 88 |
% of a fragile control symbol (are there any?) in a moving argument.\\ |
| 89 |
% \cn{cs}& \rp `Control sequence': to print an internal command name, |
| 90 |
% not intended for the end user\\ |
| 91 |
% \cn{env}& \rp To print an environment name: \verb"\env{table}"\\ |
| 92 |
% \cn{pkg}& \rp To print a package name: \verb"\pkg{eufrak}"\\ |
| 93 |
% \cn{cls}& \rp To print a class name: \verb"\cls{book}"\\ |
| 94 |
% \cn{opt}& \rp To print the name of a class or package option: |
| 95 |
% \verb"\opt{twocolumn}"\\ |
| 96 |
% \cn{bst}& \rp To print the name of a \bibtex/ style |
| 97 |
% \verb"\bst{amsalpha}"\\ |
| 98 |
% \cn{fn}& \rp To print a file name or font name: \verb"\fn{T1enc.def}", |
| 99 |
% \verb"\fn{cmsy10}"\\ |
| 100 |
% \cn{fnt}& \rp To print a font name: \verb"\fn{cmsy10}" \\ |
| 101 |
% \cn{cnt}& \rp To print a counter name: \verb"\fn{topnumber}" \\ |
| 102 |
% \cn{qc}& \rp To quote a single character: \verb"\qc{\%}"; |
| 103 |
% this works properly for special characters, even in macro |
| 104 |
% arguments, unlike e.g., \verb"\verb'%'"\\ |
| 105 |
% \cn{latex/} etc.& \rp Convenient forms of \cn{LaTeX}, \cn{TeX}, |
| 106 |
% \cn{BibTeX}, etc. that are easier to type and have a trailing slash |
| 107 |
% to eliminate the following-space problem (without needing different |
| 108 |
% markup in different contexts) |
| 109 |
% \end{tabular} |
| 110 |
% \end{table} |
| 111 |
% |
| 112 |
% \StopEventually{} |
| 113 |
% |
| 114 |
% Standard starting pieces. (Note: the reason each \cn{ProvidesClass} |
| 115 |
% command is placed on a line by itself, with separate begin and end |
| 116 |
% guards for docstripping, is to make automatic update of file date |
| 117 |
% and version slightly easier and more robust.) |
| 118 |
% \begin{macrocode} |
| 119 |
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) |
| 120 |
[1995/06/01]% LaTeX date must be June 1995 or later |
| 121 |
%<*amsldoc> |
| 122 |
\ProvidesClass{amsldoc}[2009/08/19 v2.07] |
| 123 |
%</amsldoc> |
| 124 |
%<*amsdtx> |
| 125 |
\ProvidesClass{amsdtx}[2009/08/19 v2.07] |
| 126 |
%</amsdtx> |
| 127 |
% \end{macrocode} |
| 128 |
% |
| 129 |
% \section{Implementation} |
| 130 |
% Start with the generic book class as a base. |
| 131 |
% \begin{macrocode} |
| 132 |
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} |
| 133 |
\ProcessOptions |
| 134 |
\LoadClass{book} |
| 135 |
% \end{macrocode} |
| 136 |
% |
| 137 |
% \begin{macrocode} |
| 138 |
\IfFileExists{url.sty}{% |
| 139 |
\RequirePackage{url}\relax |
| 140 |
\@gobble |
| 141 |
}{% |
| 142 |
\@firstofone |
| 143 |
} |
| 144 |
{ |
| 145 |
\DeclareRobustCommand{\url}[1]{% |
| 146 |
\def\@tempa{#1}% |
| 147 |
\texttt{\urlsetup $\expandafter\strip@prefix\meaning\@tempa$}% |
| 148 |
}% |
| 149 |
\def\urlsetup{% |
| 150 |
\check@mathfonts \textfont\@ne\the\font \textfont\z@\the\font |
| 151 |
\urlfix +\urlfix\=\urlfix\:\urlfix\-\urlfix\.\urlfix\,\urlfix\;% |
| 152 |
\urlbreak\&\urlbreak\/\urlbreak\?% |
| 153 |
}% |
| 154 |
\def\urlbreak#1{% |
| 155 |
\mathcode`#1="8000 |
| 156 |
\begingroup \lccode`\~=`#1 \lowercase{\endgroup \edef~}% |
| 157 |
{\mathchar\number`#1\penalty\hyphenpenalty}% |
| 158 |
}% |
| 159 |
\def\urlfix#1{% |
| 160 |
\mathcode`#1=`#1\relax |
| 161 |
}% |
| 162 |
} |
| 163 |
% \end{macrocode} |
| 164 |
% |
| 165 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 166 |
% |
| 167 |
% \begin{macrocode} |
| 168 |
\providecommand{\qq}[1]{\textquotedblleft#1\/\textquotedblright} |
| 169 |
\providecommand{\mdash}{\textemdash\penalty\exhyphenpenalty} |
| 170 |
\providecommand{\ndash}{\textendash\penalty\exhyphenpenalty} |
| 171 |
% \end{macrocode} |
| 172 |
% |
| 173 |
% \begin{macrocode} |
| 174 |
\let\@xp\expandafter |
| 175 |
% \end{macrocode} |
| 176 |
% \section{Indexing primitives} |
| 177 |
% |
| 178 |
% Unlike \pkg{amsdtx}, \pkg{amsldoc} doesn't load the \pkg{doc} |
| 179 |
% package, so we need to provide the following logical names. The |
| 180 |
% values are consistent with \fn{makeindex}'s default conventions. |
| 181 |
% \begin{macrocode} |
| 182 |
%<*amsldoc> |
| 183 |
\def\actualchar{@} |
| 184 |
\def\quotechar{"} |
| 185 |
\def\levelchar{!} |
| 186 |
\def\encapchar{|} |
| 187 |
\def\verbatimchar{+} |
| 188 |
% \end{macrocode} |
| 189 |
% We also need the \cs{ifcodeline@index} switch. |
| 190 |
% \begin{macrocode} |
| 191 |
\newif\ifcodeline@index |
| 192 |
%</amsldoc> |
| 193 |
% \end{macrocode} |
| 194 |
% |
| 195 |
% \begin{macro}{\autoindex} |
| 196 |
% When generating a codeline index, this encapsulates the page |
| 197 |
% number in italics. |
| 198 |
% \begin{macrocode} |
| 199 |
\newcommand*{\autoindex}[1]{% |
| 200 |
\index{#1\ifcodeline@index\encapchar usage\fi}% |
| 201 |
} |
| 202 |
% \end{macrocode} |
| 203 |
% \end{macro} |
| 204 |
% |
| 205 |
% \begin{macro}{\ntt} |
| 206 |
% To avoid font substitution warnings we make the tt font always |
| 207 |
% print in the normal weight and shape. |
| 208 |
% \begin{macrocode} |
| 209 |
\newcommand{\ntt}{\normalfont\ttfamily} |
| 210 |
% \end{macrocode} |
| 211 |
% \end{macro} |
| 212 |
% |
| 213 |
% \begin{macro}{\indexcs} |
| 214 |
% Index a control sequence without printing it. Note |
| 215 |
% non-long. The \cs{@nobslash} strips off an optional leading |
| 216 |
% backslash before passing the control sequence name to |
| 217 |
% \cs{@indexcs}. This means that |\indexcs{\cs}| and |
| 218 |
% |\indexcs{cs}| produce the same index entry. |
| 219 |
% \begin{macrocode} |
| 220 |
\newcommand*{\indexcs}[1]{% |
| 221 |
\@xp\@xp\@xp\@indexcs\@xp\@nobslash\string#1\@nil |
| 222 |
} |
| 223 |
% \end{macrocode} |
| 224 |
% \end{macro} |
| 225 |
% |
| 226 |
% \begin{macro}{\@indexcs} |
| 227 |
% Given |cs| as an argument, this writes something like |
| 228 |
% |cs@\verb"*+\cs+| to the \fn{.idx} file (or |cs=\verb!*+\cs+| if |
| 229 |
% using \fn{doc.sty}). |
| 230 |
% \begin{macrocode} |
| 231 |
\def\@indexcs#1\@nil{% |
| 232 |
\autoindex{#1\actualchar |
| 233 |
\string\verb\quotechar*\verbatimchar |
| 234 |
\@xp\@bothoftwo\string\ #1\@empty |
| 235 |
\verbatimchar |
| 236 |
}% |
| 237 |
} |
| 238 |
% \end{macrocode} |
| 239 |
% \end{macro} |
| 240 |
% |
| 241 |
% \begin{macro}{\@bothoftwo} |
| 242 |
% This has the effect of removing spaces before each of the |
| 243 |
% arguments. In particular, it removes the space generated by |
| 244 |
% \verb*+\string\ + above. |
| 245 |
% \begin{macrocode} |
| 246 |
\def\@bothoftwo#1#2{#1#2} |
| 247 |
% \end{macrocode} |
| 248 |
% \end{macro} |
| 249 |
% |
| 250 |
% \begin{macro}{\category@index} |
| 251 |
% \begin{macrocode} |
| 252 |
\def\category@index#1#2{% |
| 253 |
{\ntt#2}% |
| 254 |
\@category@index{#1}{#2}% |
| 255 |
} |
| 256 |
% \end{macrocode} |
| 257 |
% \end{macro} |
| 258 |
% |
| 259 |
% \begin{macro}{\@category@index} |
| 260 |
% \begin{macrocode} |
| 261 |
\def\@category@index#1#2{% |
| 262 |
\autoindex{% |
| 263 |
#2\actualchar\string\texttt{#2}% |
| 264 |
\ifx\@nil#1\@nil\else\space#1\fi |
| 265 |
}% |
| 266 |
} |
| 267 |
% \end{macrocode} |
| 268 |
% \end{macro} |
| 269 |
% |
| 270 |
% Some functions to support \cn{cn} etc. For most of these commands |
| 271 |
% we don't really want them to be \cs{long}! But in some early |
| 272 |
% releases of \LaTeXe\ the \verb'*' form of \cn{newcommand} was not |
| 273 |
% yet available. |
| 274 |
% |
| 275 |
% We use the name \cn{bslchar} instead of \cn{bslash} to avoid |
| 276 |
% potential conflict with the \pkg{doc} package \cn{bslash} command. |
| 277 |
% Unlike \cn{bslash}, \cn{bslchar} survives unlimited |
| 278 |
% writing/expansion because it is a chardef. |
| 279 |
% \begin{macrocode} |
| 280 |
\chardef\bslchar=`\\ % p. 424, TeXbook |
| 281 |
\newcommand{\addbslash}{\expandafter\@addbslash\string} |
| 282 |
\def\@addbslash#1{\bslchar\@nobslash#1} |
| 283 |
\newcommand{\nobslash}{\expandafter\@nobslash\string} |
| 284 |
\def\@nobslash#1{\ifnum`#1=\bslchar\else#1\fi} |
| 285 |
% \end{macrocode} |
| 286 |
% |
| 287 |
% \begin{macro}{\@boxorbreak} |
| 288 |
% Start up for a \cn{cs} or \cn{cn} command, adds an \cs{hbox} if in |
| 289 |
% math, or an allowbreak penalty if the preceding item is not a space. |
| 290 |
% (In case two such commands are used side-by-side.) |
| 291 |
% \begin{macrocode} |
| 292 |
\def\@boxorbreak{% |
| 293 |
\leavevmode |
| 294 |
\ifmmode\hbox\else\ifdim\lastskip=\z@\penalty9999 \fi\fi |
| 295 |
} |
| 296 |
% \end{macrocode} |
| 297 |
% \end{macro} |
| 298 |
% |
| 299 |
% Control sequence. The function \cn{addbslash} makes this command |
| 300 |
% also usable for some special control sequences like \cn{\%} \cn{\}} |
| 301 |
% \cn{\{}: instead of writing |\cs{%}| which doesn't work, you can |
| 302 |
% write |\cs{\%}|. |
| 303 |
% \begin{macrocode} |
| 304 |
\DeclareRobustCommand{\cs}[1]{% |
| 305 |
\@boxorbreak{% |
| 306 |
\ntt |
| 307 |
\addbslash#1\@empty |
| 308 |
\@xp\@xp\@xp\@indexcs\@xp\@nobslash\string#1\@nil |
| 309 |
}% |
| 310 |
} |
| 311 |
% \end{macrocode} |
| 312 |
% |
| 313 |
% Allow distinguishing non-private `command names' that will be |
| 314 |
% visible to the user from internal (mostly private) `control |
| 315 |
% sequences'. |
| 316 |
% \begin{macrocode} |
| 317 |
\let\cn\cs |
| 318 |
% \end{macrocode} |
| 319 |
% |
| 320 |
% \begin{macro}{\embrace} |
| 321 |
% \begin{macrocode} |
| 322 |
\DeclareTextSymbol{\lbracechar}{OT1}{123} |
| 323 |
\DeclareTextSymbolDefault{\lbracechar}{OT1} |
| 324 |
\DeclareTextSymbol{\rbracechar}{OT1}{125} |
| 325 |
\DeclareTextSymbolDefault{\rbracechar}{OT1} |
| 326 |
|
| 327 |
\providecommand{\embrace}[1]{% |
| 328 |
\begingroup \ntt\lbracechar#1\rbracechar\endgroup} |
| 329 |
% \end{macrocode} |
| 330 |
% \end{macro} |
| 331 |
% |
| 332 |
% One mandatory argument: cnm; two: cnmm; one optional and one |
| 333 |
% mandatory: cnom; throwing in a star: cnsom; and so on. |
| 334 |
% \begin{macrocode} |
| 335 |
\providecommand{\cnbreak}{\penalty999\hskip0pt\relax} |
| 336 |
\providecommand{\cnm}[2]{\cn{#1}\cnbreak\embrace{#2}} |
| 337 |
\providecommand{\cnmm}[3]{\cn{#1}\cnbreak\embrace{#2}\cnbreak\embrace{#3}} |
| 338 |
\providecommand{\cnom}[1]{\cn{#1}\cnbreak\ommitude} |
| 339 |
\providecommand{\ommitude}[2][]{{\ntt[#1]}\cnbreak\embrace{#2}} |
| 340 |
\providecommand{\cnmsm}[4]{% |
| 341 |
\cn{#1}\cnbreak\embrace{#2}\cnbreak *\embrace{#4}} |
| 342 |
% \end{macrocode} |
| 343 |
% The following items should not normally appear in math mode so they |
| 344 |
% don't need to call \cs{@boxorbreak}. |
| 345 |
% |
| 346 |
% \latex/ documentclass name. |
| 347 |
% \begin{macrocode} |
| 348 |
\DeclareRobustCommand{\cls}{\category@index{class}} |
| 349 |
% \end{macrocode} |
| 350 |
% |
| 351 |
% \latex/ package name. |
| 352 |
% \begin{macrocode} |
| 353 |
\DeclareRobustCommand{\pkg}{\category@index{package}} |
| 354 |
% \end{macrocode} |
| 355 |
% |
| 356 |
% \latex/ option name. |
| 357 |
% \begin{macrocode} |
| 358 |
\DeclareRobustCommand{\opt}{\category@index{option}} |
| 359 |
% \end{macrocode} |
| 360 |
% |
| 361 |
% Environment name. |
| 362 |
% \begin{macrocode} |
| 363 |
%<amsdtx>\DeclareRobustCommand{\env}[1]{{\ntt#1}\SpecialEnvIndex{#1}} |
| 364 |
%<amsldoc>\DeclareRobustCommand{\env}{\category@index{environment}} |
| 365 |
% \end{macrocode} |
| 366 |
% |
| 367 |
% File name. |
| 368 |
% \begin{macrocode} |
| 369 |
\DeclareRobustCommand{\fn}{\category@index{}} |
| 370 |
% \end{macrocode} |
| 371 |
% |
| 372 |
% \bibtex/ style. |
| 373 |
% \begin{macrocode} |
| 374 |
\DeclareRobustCommand{\bst}{\category@index{\string\BibTeX{} style}} |
| 375 |
% \end{macrocode} |
| 376 |
% |
| 377 |
% \begin{macrocode} |
| 378 |
\DeclareRobustCommand{\cnt}{\category@index{counter}} |
| 379 |
\DeclareRobustCommand{\fnt}{\category@index{font}} |
| 380 |
% \end{macrocode} |
| 381 |
% |
| 382 |
% With long command names or file names we sometimes prefer to allow |
| 383 |
% hyphenation in the tt font (in combination with suitable |
| 384 |
% \cn{hyphenation} statements for individual documents). To make this |
| 385 |
% work we must turn off the feature of \latex/ that disables the |
| 386 |
% hyphenchar of the tt fonts. |
| 387 |
% |
| 388 |
% The method shown here depends on the assumption that OT1 encoding |
| 389 |
% will be used for the tt fonts. An encoding-independent method would |
| 390 |
% be more awkward: You'd have to explicitly load the relevant |
| 391 |
% fonts, let's say by using \cn{AtBeginDocument}, and undo the |
| 392 |
% hyphenchar change individually for each font. |
| 393 |
% |
| 394 |
% Instead we force loading, or possibly reloading (depending on the |
| 395 |
% preload options used locally for creating the \latex/ format file), |
| 396 |
% of the \fn{OT1/cmtt} fd file, and then clear the macro |
| 397 |
% \cs{OT1+cmtt} which contains code to execute whenever a font of |
| 398 |
% this family is first loaded. The default value is to turn off the |
| 399 |
% hyphenchar, and that's what we don't want. |
| 400 |
% |
| 401 |
% This method is not especially palatable but other methods that |
| 402 |
% don't involve loading the fd file are significantly less reliable. |
| 403 |
% \begin{macrocode} |
| 404 |
\def\allowtthyphens{\begingroup |
| 405 |
\fontencoding{OT1}\fontfamily{cmtt}% |
| 406 |
% \end{macrocode} |
| 407 |
% Undefine the csname that \cs{try@load@fontshape} tests to determine |
| 408 |
% whether the fd file needs loading. Then call |
| 409 |
% \cs{try@load@fontshape}. Then we can remove the `turn off |
| 410 |
% hyphenation' code, which as it happens resides in the same csname |
| 411 |
% that was tested. |
| 412 |
% \begin{macrocode} |
| 413 |
\expandafter\let\csname OT1+cmtt\endcsname\relax |
| 414 |
\try@load@fontshape |
| 415 |
\endgroup |
| 416 |
\expandafter\let\csname OT1+cmtt\endcsname\@empty |
| 417 |
} |
| 418 |
% \end{macrocode} |
| 419 |
% |
| 420 |
% We allow some slop at the right margin because we have some |
| 421 |
% long control sequence names and verbatim text to deal with. Also |
| 422 |
% ignore underfull hboxes and vboxes unless they are really bad. |
| 423 |
% \begin{macrocode} |
| 424 |
\hfuzz2pc |
| 425 |
\vbadness9999 \hbadness5000 |
| 426 |
% \end{macrocode} |
| 427 |
% |
| 428 |
% \begin{macrocode} |
| 429 |
\def\AmS{{\protect\usefont{OMS}{cmsy}{m}{n}% |
| 430 |
A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}} |
| 431 |
% \end{macrocode} |
| 432 |
% |
| 433 |
% \begin{macrocode} |
| 434 |
\def\latex/{{\protect\LaTeX}} |
| 435 |
\def\amslatex/{{\protect\AmS-\protect\LaTeX}} |
| 436 |
\def\tex/{{\protect\TeX}} |
| 437 |
\def\amstex/{{\protect\AmS-\protect\TeX}} |
| 438 |
\def\bibtex/{{Bib\protect\TeX}} |
| 439 |
% \end{macrocode} |
| 440 |
% |
| 441 |
% \cn{makeindex} command is already used for other purposes. |
| 442 |
% \begin{macrocode} |
| 443 |
\def\makeindx/{MakeIndex} |
| 444 |
% \end{macrocode} |
| 445 |
% |
| 446 |
% Don't allow a break after the hyphen: |
| 447 |
% \begin{macrocode} |
| 448 |
\def\xypic/{XY\mbox{-}pic} |
| 449 |
% \end{macrocode} |
| 450 |
% |
| 451 |
% \begin{macrocode} |
| 452 |
\newcommand{\Textures}{\textit{Textures}} |
| 453 |
% \end{macrocode} |
| 454 |
% |
| 455 |
% `Meta' macro. |
| 456 |
% \begin{macrocode} |
| 457 |
\def\<#1>{\textit{$\langle$#1\/$\rangle$}} |
| 458 |
% \end{macrocode} |
| 459 |
% |
| 460 |
% Reduce itemsep in lists. |
| 461 |
% \begin{macrocode} |
| 462 |
\def\@listi{% |
| 463 |
\leftmargin\leftmargini |
| 464 |
\topsep 3\p@ \@plus2\p@ \@minus\p@ |
| 465 |
\parsep \p@ \@plus\p@ \itemsep\parsep |
| 466 |
} |
| 467 |
\let\@listI\@listi |
| 468 |
\@listi |
| 469 |
\def\@listii{% |
| 470 |
\leftmargin\leftmarginii |
| 471 |
\labelwidth\leftmarginii \advance\labelwidth-\labelsep |
| 472 |
\topsep\p@\@plus\p@ \@minus\p@ |
| 473 |
\parsep\z@skip \itemsep\z@skip |
| 474 |
} |
| 475 |
\def\@listiii{% |
| 476 |
\leftmargin\leftmarginiii |
| 477 |
\labelwidth\leftmarginiii \advance\labelwidth-\labelsep |
| 478 |
\topsep\z@skip \parsep\z@skip \itemsep\z@skip |
| 479 |
} |
| 480 |
% \end{macrocode} |
| 481 |
% |
| 482 |
% An environment to encapsulate remarks relevant to old versions but |
| 483 |
% not essential for the current version. |
| 484 |
% \begin{macrocode} |
| 485 |
\newenvironment{histnote}{% |
| 486 |
\trivlist\item[\hspace{\labelsep}\bfseries Historical Note:]% |
| 487 |
}{% |
| 488 |
\endtrivlist |
| 489 |
} |
| 490 |
% \end{macrocode} |
| 491 |
% |
| 492 |
% Turn off \cs{autoindex} during \cn{tableofcontents} or similar. |
| 493 |
% \begin{macrocode} |
| 494 |
\def\@starttoc#1{\begingroup |
| 495 |
\let\autoindex\@gobble |
| 496 |
\makeatletter |
| 497 |
\@input{\jobname.#1}\if@filesw |
| 498 |
\expandafter\newwrite\csname tf@#1\endcsname |
| 499 |
\immediate\openout |
| 500 |
\csname tf@#1\endcsname \jobname.#1\relax |
| 501 |
\fi \global\@nobreakfalse \endgroup} |
| 502 |
% \end{macrocode} |
| 503 |
% |
| 504 |
% Make glossary commands a no-op for the moment. [mjd,1994/10/03] |
| 505 |
% Provide a \cn{secref} command for section references. |
| 506 |
% \begin{macrocode} |
| 507 |
%<*amsldoc> |
| 508 |
\newcommand{\gloss}[1]{} |
| 509 |
%</amsldoc> |
| 510 |
\newcommand*{\secref}[1]{\S\ref{#1}} |
| 511 |
% \end{macrocode} |
| 512 |
% |
| 513 |
% We can write |\qc{\%}| to quote a single |
| 514 |
% character in situations where |\verb"%"| would not work, mainly |
| 515 |
% when text is read as a macro argument (e.g., footnotes). |
| 516 |
% \begin{macrocode} |
| 517 |
\newcommand{\qc}[1]{}% check for prior definition |
| 518 |
\edef\qc#1{\noexpand\protect\expandafter\noexpand\csname qc \endcsname |
| 519 |
\noexpand\protect#1} |
| 520 |
% \end{macrocode} |
| 521 |
% For this function the first argument is \cn{protect} and just needs |
| 522 |
% to be discarded. The method for removing a leading backslash is to |
| 523 |
% turn off \cs{escapechar}; this is more forgiving of variations like |
| 524 |
% |\qc{$}|. If the argument is `|\ |' we print a cmtt visible-space |
| 525 |
% character, \qc{\ }. |
| 526 |
% \begin{macrocode} |
| 527 |
\@namedef{qc }#1#2{\begingroup\ntt |
| 528 |
\ifx\ #2\char`\ \else\escapechar\m@ne\string#2\fi\endgroup} |
| 529 |
% \end{macrocode} |
| 530 |
% Declare a few character names to avoid e.g., indexing difficulties. |
| 531 |
% \begin{macrocode} |
| 532 |
\DeclareRobustCommand{\qcat}{\qc\@}% |
| 533 |
\DeclareRobustCommand{\qcamp}{\qc\&}% |
| 534 |
\DeclareRobustCommand{\qcbang}{\qc\!}% |
| 535 |
% \end{macrocode} |
| 536 |
% |
| 537 |
% \begin{macro}{\arg} |
| 538 |
% Change \cn{arg} to print a macro argument number: |
| 539 |
% \begin{macrocode} |
| 540 |
\DeclareRobustCommand{\arg}[1]{{\ntt\##1}} |
| 541 |
% \end{macrocode} |
| 542 |
% \end{macro} |
| 543 |
% |
| 544 |
% We need to emulate the \pkg{amsthm} \cn{qedsymbol} for the |
| 545 |
% \amslatex/ user's guide. |
| 546 |
% \begin{macrocode} |
| 547 |
%<*amsldoc> |
| 548 |
\newcommand{\openbox}{\leavevmode |
| 549 |
\hbox to.77778em{% |
| 550 |
\hfil\vrule |
| 551 |
\vbox to.675em{\hrule width.6em\vfil\hrule}% |
| 552 |
\vrule\hfil}} |
| 553 |
\newcommand{\qedsymbol}{\openbox} |
| 554 |
%</amsldoc> |
| 555 |
% \end{macrocode} |
| 556 |
% |
| 557 |
% Logical markup for e-mail address: |
| 558 |
% \begin{macrocode} |
| 559 |
%<amsldoc>\def\mail{\texttt} |
| 560 |
% \end{macrocode} |
| 561 |
% |
| 562 |
% Shorthand for indexing: |
| 563 |
% \begin{macrocode} |
| 564 |
%<*amsldoc> |
| 565 |
\def\*#1{\def\@tempa{#1}\def\@tempb{*}% |
| 566 |
\ifx\@tempa\@tempb \expandafter\index |
| 567 |
\else #1\index{#1}\fi} |
| 568 |
%</amsldoc> |
| 569 |
% \end{macrocode} |
| 570 |
% |
| 571 |
% Non-indexed \cn{cn} (maybe call this |\cn*|?) |
| 572 |
% \begin{macrocode} |
| 573 |
\def\ncn#1{{\let\index\@gobble\cn{#1}}} |
| 574 |
% \end{macrocode} |
| 575 |
% Indexing difficulties with !, @. |
| 576 |
% \begin{macrocode} |
| 577 |
|
| 578 |
\DeclareRobustCommand{\cnbang}{% |
| 579 |
\ncn{\!}\index{"!@{\ntt\bslchar\qcbang}}} |
| 580 |
\DeclareRobustCommand{\cnat}{% |
| 581 |
\ncn{\!}\index{"@@{\ntt\bslchar\qcat}}} |
| 582 |
% \end{macrocode} |
| 583 |
% |
| 584 |
% Shorthand for a discouraged, but not forbidden, line break: |
| 585 |
% \begin{macrocode} |
| 586 |
\def\5{\penalty500 } |
| 587 |
% \end{macrocode} |
| 588 |
% |
| 589 |
% Environment for error message examples. Use \cs{meaning} to allow |
| 590 |
% reading the error message text as an ordinary brace-delimited arg |
| 591 |
% but still be able to print embedded braces; and first change the |
| 592 |
% backslash catcode to prevent extra spaces after control words. |
| 593 |
% \begin{macrocode} |
| 594 |
%<*amsldoc> |
| 595 |
\newenvironment{error}{% |
| 596 |
\begingroup\catcode`\\=12 \expandafter\endgroup\errora |
| 597 |
}{% |
| 598 |
\endtrivlist |
| 599 |
} |
| 600 |
% \end{macrocode} |
| 601 |
% |
| 602 |
% \begin{macrocode} |
| 603 |
\newcommand{\errora}[1]{% |
| 604 |
\trivlist |
| 605 |
\item[\hskip\labelsep\errorbullet\enspace |
| 606 |
\ntt\frenchspacing\def\@tempa{#1}% |
| 607 |
\expandafter\strip@prefix\meaning\@tempa]\leavevmode\par |
| 608 |
} |
| 609 |
% \end{macrocode} |
| 610 |
% \cs{errorbullet} is just an attempt at a simple graphic device that |
| 611 |
% doesn't require any special fonts. |
| 612 |
% \begin{macrocode} |
| 613 |
\newcommand{\errorbullet}{\rule[-.5pt]{2.5pt}{7.5pt}% |
| 614 |
\rule[-.5pt]{5pt}{2.5pt}\kern-2.5pt% |
| 615 |
\rule[4.5pt]{2.5pt}{2.5pt}} |
| 616 |
%</amsldoc> |
| 617 |
% \end{macrocode} |
| 618 |
% A couple of subheading commands: |
| 619 |
% \begin{macrocode} |
| 620 |
\newcommand{\errexa}{\par\noindent\textit{Example}:\ } |
| 621 |
\newcommand{\errexpl}{\par\noindent\textit{Explanation}:\ } |
| 622 |
% \end{macrocode} |
| 623 |
% |
| 624 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 625 |
% \section{\cls{amsldoc} style modifications for sectioning commands} |
| 626 |
% The following section deals with book commands (part, chapter, |
| 627 |
% frontmatter, \dots). |
| 628 |
% \begin{macrocode} |
| 629 |
%<*amsldoc> |
| 630 |
% \end{macrocode} |
| 631 |
% |
| 632 |
% Modifications of sectioning commands from \fn{book.cls}, mostly |
| 633 |
% reducing font sizes and vertical spacing. |
| 634 |
% \begin{macrocode} |
| 635 |
\renewcommand\frontmatter{\clearpage |
| 636 |
\@mainmatterfalse\pagenumbering{roman}} |
| 637 |
\renewcommand\mainmatter{\clearpage |
| 638 |
\@mainmattertrue\pagenumbering{arabic}} |
| 639 |
\renewcommand\backmatter{\clearpage \@mainmatterfalse} |
| 640 |
% \end{macrocode} |
| 641 |
% |
| 642 |
% \begin{macrocode} |
| 643 |
\renewcommand\part{\clearpage |
| 644 |
\thispagestyle{plain}% |
| 645 |
\if@twocolumn |
| 646 |
\onecolumn |
| 647 |
\@tempswatrue |
| 648 |
\else |
| 649 |
\@tempswafalse |
| 650 |
\fi |
| 651 |
\hbox{}\vfil |
| 652 |
\secdef\@part\@spart} |
| 653 |
% \end{macrocode} |
| 654 |
% |
| 655 |
% \begin{macrocode} |
| 656 |
\def\@part[#1]#2{% |
| 657 |
\ifnum \c@secnumdepth >-2\relax |
| 658 |
\refstepcounter{part}% |
| 659 |
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% |
| 660 |
\else |
| 661 |
\addcontentsline{toc}{part}{#1}% |
| 662 |
\fi |
| 663 |
\markboth{}{}% |
| 664 |
{\centering |
| 665 |
\interlinepenalty \@M |
| 666 |
\reset@font |
| 667 |
\ifnum \c@secnumdepth >-2\relax |
| 668 |
\Large\bfseries \partname~\thepart |
| 669 |
\par |
| 670 |
\vskip 20\p@ |
| 671 |
\fi |
| 672 |
\Large \bfseries #2\par}% |
| 673 |
\@endpart} |
| 674 |
% \end{macrocode} |
| 675 |
% |
| 676 |
% \begin{macrocode} |
| 677 |
\def\@spart#1{% |
| 678 |
{\centering |
| 679 |
\interlinepenalty \@M |
| 680 |
\reset@font |
| 681 |
\Large \bfseries #1\par}% |
| 682 |
\@endpart} |
| 683 |
\def\@endpart{\vfil\newpage |
| 684 |
\if@twoside |
| 685 |
\hbox{}% |
| 686 |
\thispagestyle{empty}% |
| 687 |
\newpage |
| 688 |
\fi |
| 689 |
\if@tempswa |
| 690 |
\twocolumn |
| 691 |
\fi} |
| 692 |
%</amsldoc> |
| 693 |
% \end{macrocode} |
| 694 |
% |
| 695 |
% \begin{macrocode} |
| 696 |
\renewcommand\chapter{\par \@afterindentfalse |
| 697 |
\secdef\@chapter\@schapter} |
| 698 |
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne |
| 699 |
\if@mainmatter |
| 700 |
\refstepcounter{chapter}% |
| 701 |
\typeout{\@chapapp\space\thechapter.}% |
| 702 |
\addcontentsline{toc}{chapter}% |
| 703 |
{\protect\numberline{\thechapter}#1}% |
| 704 |
\else |
| 705 |
\addcontentsline{toc}{chapter}{#1}\fi |
| 706 |
\else |
| 707 |
\addcontentsline{toc}{chapter}{#1} |
| 708 |
\fi |
| 709 |
\chaptermark{#1}% |
| 710 |
\addtocontents{lof}{\protect\addvspace{10\p@}}% |
| 711 |
\addtocontents{lot}{\protect\addvspace{10\p@}}% |
| 712 |
\if@twocolumn |
| 713 |
\@topnewpage[\@makechapterhead{#2}]% |
| 714 |
\else |
| 715 |
\@makechapterhead{#2}% |
| 716 |
\@afterheading |
| 717 |
\fi} |
| 718 |
% \end{macrocode} |
| 719 |
% |
| 720 |
% \begin{macrocode} |
| 721 |
\def\@makechapterhead#1{% |
| 722 |
\vspace{1.5\baselineskip}% |
| 723 |
{\parindent \z@ \raggedright \reset@font |
| 724 |
\ifnum \c@secnumdepth >\m@ne |
| 725 |
\large\bfseries \@chapapp\space\thechapter |
| 726 |
\par\nobreak |
| 727 |
\vskip.5\baselineskip\relax |
| 728 |
\fi |
| 729 |
#1\par\nobreak |
| 730 |
\vskip\baselineskip |
| 731 |
}} |
| 732 |
\def\@schapter#1{\if@twocolumn |
| 733 |
\@topnewpage[\@makeschapterhead{#1}]% |
| 734 |
\else |
| 735 |
\@makeschapterhead{#1}% |
| 736 |
\@afterheading |
| 737 |
\fi} |
| 738 |
\def\@makeschapterhead#1{% |
| 739 |
\vspace*{1.5\baselineskip}% |
| 740 |
{\parindent \z@ \raggedright |
| 741 |
\reset@font |
| 742 |
\large \bfseries #1\par\nobreak |
| 743 |
\vskip\baselineskip |
| 744 |
}} |
| 745 |
% \end{macrocode} |
| 746 |
% |
| 747 |
% Add Donald Arseneau's \cs{@removefromreset}; used to decouple the |
| 748 |
% footnote counter from \cn{chapter}, since chapters here do not |
| 749 |
% automatically start on a new page. [bnb, 1999/09/27] |
| 750 |
% \begin{verbatim} |
| 751 |
% \@removefromreset{FOO}{BAR} : Removes counter FOO from the list of |
| 752 |
% counters \cl@BAR to be reset when counter BAR |
| 753 |
% is stepped. The opposite of \@addtoreset. |
| 754 |
% \end{verbatim} |
| 755 |
% \begin{macrocode} |
| 756 |
\def\@removefromreset#1#2{\let\@tempb\@elt |
| 757 |
\expandafter\let\expandafter\@tempa\csname c@#1\endcsname |
| 758 |
\def\@elt##1{\expandafter\ifx\csname c@##1\endcsname\@tempa\else |
| 759 |
\noexpand\@elt{##1}\fi}% |
| 760 |
\expandafter\edef\csname cl@#2\endcsname{\csname cl@#2\endcsname}% |
| 761 |
\let\@elt\@tempb} |
| 762 |
\@removefromreset{footnote}{chapter} |
| 763 |
% \end{macrocode} |
| 764 |
% |
| 765 |
% Change running head font to \cn{footnotesize}, nonslanted. |
| 766 |
% \begin{macrocode} |
| 767 |
\def\ps@headings{% |
| 768 |
\let\@oddfoot\@empty\let\@evenfoot\@empty |
| 769 |
\def\@evenhead{\thepage\hfil{\footnotesize\leftmark{}{}}}% |
| 770 |
\def\@oddhead{{\footnotesize\rightmark{}{}}\hfil\thepage}% |
| 771 |
\let\@mkboth\markboth |
| 772 |
\def\chaptermark##1{% |
| 773 |
\markboth {\uppercase{\ifnum \c@secnumdepth >\m@ne |
| 774 |
\if@mainmatter |
| 775 |
\@chapapp\ \thechapter. \ \fi |
| 776 |
\fi |
| 777 |
##1}}{}}% |
| 778 |
\def\sectionmark##1{% |
| 779 |
\markright {\uppercase{\ifnum \c@secnumdepth >\z@ |
| 780 |
\thesection. \ \fi |
| 781 |
##1}}}} |
| 782 |
% \end{macrocode} |
| 783 |
% |
| 784 |
% |
| 785 |
% \section{\cls{amsdtx} style modifications for sectioning commands} |
| 786 |
% These definitions for \cn{maketitle} are from \fn{article.cls}. |
| 787 |
% \begin{macrocode} |
| 788 |
%<*amsdtx> |
| 789 |
\renewcommand\maketitle{\par |
| 790 |
\begingroup |
| 791 |
\renewcommand\thefootnote{\fnsymbol{footnote}}% |
| 792 |
\def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}% |
| 793 |
\long\def\@makefntext##1{\parindent 1em\noindent |
| 794 |
\hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% |
| 795 |
\if@twocolumn |
| 796 |
\ifnum \col@number=\@ne |
| 797 |
\@maketitle |
| 798 |
\else |
| 799 |
\twocolumn[\@maketitle]% |
| 800 |
\fi |
| 801 |
\else |
| 802 |
\newpage |
| 803 |
\global\@topnum\z@ % Prevents figures from going at top of page. |
| 804 |
\@maketitle |
| 805 |
\fi |
| 806 |
\thispagestyle{plain}\@thanks |
| 807 |
\endgroup |
| 808 |
\setcounter{footnote}{0}% |
| 809 |
\let\thanks\relax |
| 810 |
\let\maketitle\relax\let\@maketitle\relax |
| 811 |
\gdef\@thanks{}\gdef\@author{}\gdef\@title{}} |
| 812 |
% |
| 813 |
\def\@maketitle{% |
| 814 |
\newpage |
| 815 |
\null |
| 816 |
\vskip 2em% |
| 817 |
\begin{center}% |
| 818 |
{\LARGE \@title \par}% |
| 819 |
\vskip 1.5em% |
| 820 |
{\large |
| 821 |
\lineskip .5em% |
| 822 |
\begin{tabular}[t]{c}% |
| 823 |
\@author |
| 824 |
\end{tabular}\par}% |
| 825 |
\vskip 1em% |
| 826 |
{\large \@date}% |
| 827 |
\end{center}% |
| 828 |
\par |
| 829 |
% \end{macrocode} |
| 830 |
% Put the title into both running heads. |
| 831 |
% \begin{macrocode} |
| 832 |
\uppercase\expandafter{\expandafter\toks@\expandafter{\@title}}% |
| 833 |
\edef\@tempa{\noexpand\markboth{\the\toks@}{\the\toks@}}% |
| 834 |
\@tempa |
| 835 |
\vskip 1.5em} |
| 836 |
%</amsdtx> |
| 837 |
% \end{macrocode} |
| 838 |
% |
| 839 |
% Edit the table of contents. |
| 840 |
% \begin{macrocode} |
| 841 |
%<*amsdtx> |
| 842 |
\renewcommand\tableofcontents{% |
| 843 |
\if@twocolumn |
| 844 |
\@restonecoltrue\onecolumn |
| 845 |
\else |
| 846 |
\@restonecolfalse |
| 847 |
\fi |
| 848 |
\subsection*{\contentsname}% |
| 849 |
\@starttoc{toc}% |
| 850 |
\if@restonecol\twocolumn\fi |
| 851 |
} |
| 852 |
%</amsdtx> |
| 853 |
% \end{macrocode} |
| 854 |
% |
| 855 |
% Edit the sectioning commands. |
| 856 |
% \begin{macrocode} |
| 857 |
\renewcommand\section{\@startsection {section}{1}{\z@}% |
| 858 |
{-.6\baselineskip \@plus -3\p@}% |
| 859 |
{.4\baselineskip} |
| 860 |
%<amsdtx> {\reset@font\Large\bfseries}} |
| 861 |
%<amsldoc> {\reset@font\normalsize\bfseries}} |
| 862 |
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% |
| 863 |
{-.3\baselineskip\@plus -2\p@}% |
| 864 |
{.2\baselineskip}% |
| 865 |
%<amsdtx> {\reset@font\large\bfseries}} |
| 866 |
%<amsldoc> {\reset@font\normalsize\bfseries}} |
| 867 |
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% |
| 868 |
{-.2\baselineskip\@plus -2\p@}% |
| 869 |
{.2\baselineskip}% |
| 870 |
{\reset@font\normalsize\bfseries}} |
| 871 |
% \end{macrocode} |
| 872 |
% Change index environment to turn off \cn{autoindex}. |
| 873 |
% \begin{macrocode} |
| 874 |
\renewenvironment{theindex}{% |
| 875 |
\if@twocolumn \@restonecolfalse \else \@restonecoltrue \fi |
| 876 |
\columnseprule \z@ \columnsep 35\p@ |
| 877 |
\let\autoindex\@gobble |
| 878 |
%<amsdtx> \twocolumn[\section*{\indexname}]% |
| 879 |
%<amsldoc> \twocolumn[\@makeschapterhead{\indexname}]% |
| 880 |
\addcontentsline{toc}{chapter}{\indexname}% |
| 881 |
\@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}% |
| 882 |
\thispagestyle{plain}\parindent\z@ |
| 883 |
\parskip\z@ \@plus .3\p@\relax |
| 884 |
\let\item\@idxitem |
| 885 |
}{% |
| 886 |
\if@restonecol\onecolumn\else\clearpage\fi |
| 887 |
} |
| 888 |
% \end{macrocode} |
| 889 |
% |
| 890 |
% Take out \cn{thechapter} from \cn{thesection}. |
| 891 |
% \begin{macrocode} |
| 892 |
%<amsdtx>\renewcommand{\thesection}{\arabic{section}} |
| 893 |
% \end{macrocode} |
| 894 |
% |
| 895 |
% Change the style of captions slightly. Also incorporate some |
| 896 |
% caption improvements from Donald Arseneau (\fn{comp.text.tex}, 11 |
| 897 |
% Oct 1994). |
| 898 |
% \begin{macrocode} |
| 899 |
\long\def\@makecaption#1#2{% |
| 900 |
\addvspace\abovecaptionskip |
| 901 |
\begingroup |
| 902 |
\countdef\@parcycles=8 % local count register |
| 903 |
\@parcycles\z@ |
| 904 |
\@setpar{\advance\@parcycles\@ne \ifnum\@parcycles>999 |
| 905 |
\@@par\@parcycles\z@\fi |
| 906 |
\ifhmode \unskip\hskip\parfillskip\penalty-\@M\fi}% |
| 907 |
\@hangfrom{\textbf{#1.} }\vadjust{\penalty\m@ne}#2% |
| 908 |
\endgroup |
| 909 |
\ifhmode\unpenalty\fi\par |
| 910 |
\ifnum\lastpenalty=\m@ne % only one line in the caption |
| 911 |
\unpenalty \setbox\@tempboxa\lastbox |
| 912 |
\nointerlineskip |
| 913 |
\hbox to\hsize{\hfill\unhbox\@tempboxa\unskip\hfill}% |
| 914 |
\fi |
| 915 |
\nobreak\vskip\belowcaptionskip |
| 916 |
} |
| 917 |
% \end{macrocode} |
| 918 |
% For table captions, assume top captions and so put space below the |
| 919 |
% caption rather than above: |
| 920 |
% \begin{macrocode} |
| 921 |
\renewenvironment{table}{% |
| 922 |
\belowcaptionskip\abovecaptionskip \abovecaptionskip\z@skip |
| 923 |
\@float{table}% |
| 924 |
}{% |
| 925 |
\end@float |
| 926 |
} |
| 927 |
\renewenvironment{table*}{% |
| 928 |
\belowcaptionskip\abovecaptionskip \abovecaptionskip\z@skip |
| 929 |
\@dblfloat{table}% |
| 930 |
}{% |
| 931 |
\end@dblfloat |
| 932 |
} |
| 933 |
% \end{macrocode} |
| 934 |
% |
| 935 |
% \section{Float placement parameters} |
| 936 |
% These control the placing of floating objects like tables and |
| 937 |
% figures. The values here, which are much more tolerant than the |
| 938 |
% \latex/ defaults, are more or less copied from \fn{amsclass.dtx}. |
| 939 |
% \begin{macrocode} |
| 940 |
\setcounter{topnumber}{4}\setcounter{bottomnumber}{4} |
| 941 |
\setcounter{totalnumber}{4}\setcounter{dbltopnumber}{4} |
| 942 |
\renewcommand{\topfraction}{.97}\renewcommand{\bottomfraction}{.97} |
| 943 |
\renewcommand{\textfraction}{.03}\renewcommand{\floatpagefraction}{.9} |
| 944 |
\renewcommand{\dbltopfraction}{.97} |
| 945 |
\renewcommand{\dblfloatpagefraction}{.9} |
| 946 |
\setlength{\floatsep}{8pt plus6pt} |
| 947 |
\setlength{\textfloatsep}{10pt plus8pt} |
| 948 |
\setlength{\intextsep}{8pt plus6pt} |
| 949 |
\setlength{\dblfloatsep}{8pt plus6pt} |
| 950 |
\setlength{\dbltextfloatsep}{10pt plus8pt} |
| 951 |
\setlength{\@fptop}{0pt}\setlength{\@fpsep}{8pt}% |
| 952 |
\setlength{\@fpbot}{0pt plus 1fil} |
| 953 |
\setlength{\@dblfptop}{0pt}\setlength{\@dblfpsep}{8pt}% |
| 954 |
\setlength{\@dblfpbot}{0pt plus 1fil} |
| 955 |
% \end{macrocode} |
| 956 |
|
| 957 |
% \begin{macrocode} |
| 958 |
\pagestyle{headings} |
| 959 |
% \end{macrocode} |
| 960 |
% |
| 961 |
% Make \verb"|...|" shorthand for verbatim fragments. In the case of |
| 962 |
% the \cls{amsldoc} class, we avoid requiring an extra package |
| 963 |
% (\pkg{doc} or \pkg{shortvrb}), to reduce the possibility of package |
| 964 |
% files not being found at run time. |
| 965 |
% \begin{macrocode} |
| 966 |
%<*amsldoc> |
| 967 |
\AtBeginDocument{\catcode`\|=\active } |
| 968 |
\def\activevert{\verb|} |
| 969 |
\expandafter\gdef\expandafter\dospecials\expandafter |
| 970 |
{\dospecials \do\|}% |
| 971 |
\expandafter\gdef\expandafter\@sanitize\expandafter |
| 972 |
{\@sanitize \@makeother\|} |
| 973 |
\begingroup\catcode`\|=\active \gdef|{\protect\activevert{}}\endgroup |
| 974 |
%</amsldoc> |
| 975 |
% \end{macrocode} |
| 976 |
% |
| 977 |
% \begin{macro}{\arrayargpatch} |
| 978 |
% If the column-specs arg of array or tabular contains a vert bar |
| 979 |
% character, and we have made vert bars active, it will cause |
| 980 |
% trouble. The following command, used in the ctab environment, |
| 981 |
% prevents the trouble. |
| 982 |
% \begin{macrocode} |
| 983 |
\newcommand{\arrayargpatch}{% |
| 984 |
\let\@oldarray\@array |
| 985 |
\edef\@array[##1]##2{\catcode\number`\|=\number\catcode`\| |
| 986 |
\catcode\number`\@=\number\catcode`\@ \relax |
| 987 |
\let\noexpand\@array\noexpand\@oldarray |
| 988 |
\noexpand\@array[##1]{##2}}% |
| 989 |
\catcode`\|=12 \catcode`\@=12 \relax |
| 990 |
} |
| 991 |
% \end{macrocode} |
| 992 |
% \end{macro} |
| 993 |
% |
| 994 |
% \begin{environment}{ctab} |
| 995 |
% An environment for centered tables. |
| 996 |
% \begin{macrocode} |
| 997 |
\newenvironment{ctab}{% |
| 998 |
\par\topsep\medskipamount |
| 999 |
\trivlist\centering |
| 1000 |
\item[]% |
| 1001 |
\arrayargpatch |
| 1002 |
\begin{tabular}% |
| 1003 |
}{% |
| 1004 |
\end{tabular}% |
| 1005 |
\endtrivlist |
| 1006 |
} |
| 1007 |
% \end{macrocode} |
| 1008 |
% \end{environment} |
| 1009 |
% |
| 1010 |
% Load \pkg{doc} package, reset \cn{AltMacroFont} to be the same as |
| 1011 |
% \cn{MacroFont} (when there are large sections of conditional |
| 1012 |
% code I think it looks better not to have it all slanted). |
| 1013 |
% \begin{macrocode} |
| 1014 |
%<*amsdtx> |
| 1015 |
\RequirePackage{doc} |
| 1016 |
\def\AltMacroFont{\MacroFont} |
| 1017 |
% \end{macrocode} |
| 1018 |
% |
| 1019 |
% \begin{macro}{\SpecialMainEnvIndex} |
| 1020 |
% Override \fn{doc.sty}'s main environment indexing to get rid of |
| 1021 |
% the parens around ``environment'', for compatibility with our |
| 1022 |
% \cs{env} command. |
| 1023 |
% \begin{macrocode} |
| 1024 |
\def\SpecialMainEnvIndex#1{% |
| 1025 |
\@bsphack |
| 1026 |
\special@index{% |
| 1027 |
#1\actualchar\string\texttt{#1} environment\encapchar main% |
| 1028 |
}% |
| 1029 |
\special@index{% |
| 1030 |
environments:\levelchar#1% |
| 1031 |
\actualchar\string\texttt{#1}% |
| 1032 |
\encapchar main}% |
| 1033 |
\@esphack |
| 1034 |
} |
| 1035 |
% \end{macrocode} |
| 1036 |
% \end{macro} |
| 1037 |
% |
| 1038 |
% \begin{macro}{\SpecialEnvIndex} |
| 1039 |
% \begin{macrocode} |
| 1040 |
\def\SpecialEnvIndex#1{% |
| 1041 |
\@bsphack |
| 1042 |
\index{#1\actualchar\string\texttt{#1} environment\encapchar usage}% |
| 1043 |
\index{% |
| 1044 |
environments:\levelchar#1% |
| 1045 |
\actualchar\string\texttt{#1}% |
| 1046 |
\encapchar usage}% |
| 1047 |
\@esphack |
| 1048 |
} |
| 1049 |
% \end{macrocode} |
| 1050 |
% \end{macro} |
| 1051 |
% |
| 1052 |
% \begin{macro}{\DescribeOption} |
| 1053 |
% \begin{macrocode} |
| 1054 |
\def\DescribeOption{% |
| 1055 |
\leavevmode |
| 1056 |
\@bsphack |
| 1057 |
\begingroup |
| 1058 |
\MakePrivateLetters |
| 1059 |
\Describe@Option |
| 1060 |
} |
| 1061 |
% \end{macrocode} |
| 1062 |
% \end{macro} |
| 1063 |
% |
| 1064 |
% \begin{macro}{\Describe@Option} |
| 1065 |
% \begin{macrocode} |
| 1066 |
\def\Describe@Option#1{% |
| 1067 |
\endgroup |
| 1068 |
\marginpar{\raggedleft\PrintDescribeOption{#1}}% |
| 1069 |
\SpecialOptionIndex{#1}% |
| 1070 |
\@esphack |
| 1071 |
\ignorespaces |
| 1072 |
} |
| 1073 |
% \end{macrocode} |
| 1074 |
% \end{macro} |
| 1075 |
% |
| 1076 |
% \begin{macro}{\PrintDescribeOption} |
| 1077 |
% \begin{macrocode} |
| 1078 |
\def\PrintDescribeOption#1{\strut \MacroFont #1\ } |
| 1079 |
% \end{macrocode} |
| 1080 |
% \end{macro} |
| 1081 |
% |
| 1082 |
% \begin{macro}{\option} |
| 1083 |
% \begin{macrocode} |
| 1084 |
\def\option{% |
| 1085 |
\let\SpecialMainEnvIndex\SpecialMainOptionIndex |
| 1086 |
\begingroup |
| 1087 |
\catcode`\\12 |
| 1088 |
\MakePrivateLetters \m@cro@ \iffalse} |
| 1089 |
% \end{macrocode} |
| 1090 |
% \end{macro} |
| 1091 |
% |
| 1092 |
% \begin{macro}{\SpecialMainOptionIndex} |
| 1093 |
% \begin{macrocode} |
| 1094 |
\def\SpecialMainOptionIndex#1{% |
| 1095 |
\@bsphack |
| 1096 |
\special@index{#1\actualchar\string\texttt{#1} option\encapchar main}% |
| 1097 |
\@esphack |
| 1098 |
} |
| 1099 |
% \end{macrocode} |
| 1100 |
% \end{macro} |
| 1101 |
% |
| 1102 |
% \begin{macro}{\SpecialOptionIndex} |
| 1103 |
% \begin{macrocode} |
| 1104 |
\def\SpecialOptionIndex{\@category@index{option}} |
| 1105 |
% \end{macrocode} |
| 1106 |
% \end{macro} |
| 1107 |
% |
| 1108 |
% Ordinary \cn{DocInput} doesn't handle standardized file headers |
| 1109 |
% unless you enclose them in \cs{iffalse} \dots\ \cs{fi} which I |
| 1110 |
% don't care to do. So instead here's an alternate version of |
| 1111 |
% \cn{DocInput}, called \cn{hDocInput}. |
| 1112 |
% \begin{macrocode} |
| 1113 |
\def\hDocInput#1{\MakePercentIgnore |
| 1114 |
\begingroup |
| 1115 |
% \end{macrocode} |
| 1116 |
% Define active \qc{\@} which should be the first non-percent, |
| 1117 |
% non-equal-sign character when a file header is present. (If a file |
| 1118 |
% header is not present, \cn{hDocInput} should not be used.) |
| 1119 |
% \begin{macrocode} |
| 1120 |
\begingroup \lccode`\~=`\@ |
| 1121 |
\lowercase{\endgroup\long\def ~}##1##{% |
| 1122 |
\catcode`\==12 \skipfileheader{##1}}% |
| 1123 |
\catcode`\@=\active \catcode`\==14 % comment |
| 1124 |
\def\filename{#1}% |
| 1125 |
\@@input#1 \MakePercentComment} |
| 1126 |
% \end{macrocode} |
| 1127 |
% |
| 1128 |
% \begin{macrocode} |
| 1129 |
\def\skipfileheader#1#2 {\endgroup |
| 1130 |
\hGetFileInfo#2 version = "??" date = "??"\@nil |
| 1131 |
\begingroup\catcode`\==9 \catcode`\ =9 \futurelet\0\endgroup |
| 1132 |
} |
| 1133 |
% \end{macrocode} |
| 1134 |
% |
| 1135 |
% \begin{macrocode} |
| 1136 |
\long\def\hGetFileInfo#1 version = "#2"#3 date = "#4"#5\@nil{% |
| 1137 |
\def\fileversion{#2}\def\filedate{#4}} |
| 1138 |
%</amsdtx> |
| 1139 |
% \end{macrocode} |
| 1140 |
% |
| 1141 |
% |
| 1142 |
% \section{Hyphenation exceptions} |
| 1143 |
% |
| 1144 |
% \begin{macrocode} |
| 1145 |
\hyphenation{base-line-skip} |
| 1146 |
% \end{macrocode} |
| 1147 |
% |
| 1148 |
% \section{Index exceptions} |
| 1149 |
% |
| 1150 |
% A bunch of stuff we don't want in code indexes: |
| 1151 |
% \begin{macrocode} |
| 1152 |
%<*amsdtx> |
| 1153 |
\DoNotIndex{\@xp,\@nx,\@empty,\newcommand,\renewcommand} |
| 1154 |
\DoNotIndex{\newenvironment,\renewenvironment,\providecommand} |
| 1155 |
\DoNotIndex{\if,\fi,\ifnum,\fi,\@let@token,\futurelet,\fsa@n} |
| 1156 |
\DoNotIndex{\ignorespaces,\@tempcnta,\@tempcntb,\count@} |
| 1157 |
\DoNotIndex{\toks@,\@ne,\advance} |
| 1158 |
\DoNotIndex{\!,\/,\?,\@,\^,\_} |
| 1159 |
\DoNotIndex{\@@par,\@M,\@auxout,\@bsphack,\@esphack,\@depth,\@ehc} |
| 1160 |
\DoNotIndex{\@for,\@flushglue,\@gobble,\@gobbletwo,\@height,\@idxitem} |
| 1161 |
\DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@input,\@latexerr} |
| 1162 |
\DoNotIndex{\@makeschapterhead,\@namedef,\@nameuse,\@nil} |
| 1163 |
\DoNotIndex{\@nobreakfalse,\@restonecolfalse,\@restonecoltrue} |
| 1164 |
\DoNotIndex{\@tempa,\@tempb,\@tempc,\@tempf} |
| 1165 |
\DoNotIndex{\@temptokena,\@temptokenb} |
| 1166 |
\DoNotIndex{\@themark,\@width} |
| 1167 |
\DoNotIndex{\active,\aindex,\baselineskip,\begin,\begingroup,\box} |
| 1168 |
\DoNotIndex{\c@page,\catcode,\chapter,\char,\chardef,\closeout} |
| 1169 |
\DoNotIndex{\CodelineIndex,\sp,\sb,\label,\leavevmode,\mark} |
| 1170 |
\DoNotIndex{\mark,\newinsert,\newwrite,\newtoks,\xdef} |
| 1171 |
\DoNotIndex{\columnsep,\columnseprule,\columnwidth,\csname,\def} |
| 1172 |
\DoNotIndex{\dimen,\do,\DocInput,\documentstyle,\edef,\em} |
| 1173 |
\DoNotIndex{\EnableCrossrefs,\end,\endcsname,\endgroup,\endinput} |
| 1174 |
\DoNotIndex{\everypar,\expandafter,\filedate,\fileversion} |
| 1175 |
\DoNotIndex{\footnotesize,\gdef,\global,\glossary,\hangindent} |
| 1176 |
\DoNotIndex{\if@filesw,\else,\fi} |
| 1177 |
\DoNotIndex{\if@nobreak,\if@twocolumn,\if@twoside,\fi,\fi,\fi} |
| 1178 |
\DoNotIndex{\hsize,\hskip} |
| 1179 |
\DoNotIndex{\ifhmode,\ifmmode,\ifodd,\ifvmode,\ifx,\fi,\fi,\fi,\fi,\fi} |
| 1180 |
\DoNotIndex{\ifcase,\ifdim,\ifeof,\iffalse,\iftrue,\fi,\fi,\fi,\fi,\fi} |
| 1181 |
\DoNotIndex{\ifcat,\fi} |
| 1182 |
\DoNotIndex{\immediate,\insert,\item,\jobname,\long} |
| 1183 |
\DoNotIndex{\let,\lineskip,\marginparsep,\marginparwidth,\maxdimen} |
| 1184 |
\DoNotIndex{\makeatletter,\noexpand,\openout,\protect,\rlap} |
| 1185 |
\DoNotIndex{\min,\newpage,\nobreak,\normalbaselineskip} |
| 1186 |
\DoNotIndex{\normallineskip,\p@,\par,\parfillskip,\parindent,\parskip} |
| 1187 |
\DoNotIndex{\penalty,\relax,\section,\sin,\sloppy,\space,\string} |
| 1188 |
\DoNotIndex{\tableofcontents,\the,\thepage,\thispagestyle,\toks,\tt} |
| 1189 |
\DoNotIndex{\twocolumn,\uppercase,\vbox,\vrule,\vskip,\vss} |
| 1190 |
\DoNotIndex{\write,\z@,\z@skip} |
| 1191 |
%</amsdtx> |
| 1192 |
% \end{macrocode} |
| 1193 |
% |
| 1194 |
% The usual \cs{endinput} to ensure that random garbage at the end of |
| 1195 |
% the file doesn't get copied by \fn{docstrip}. |
| 1196 |
% \begin{macrocode} |
| 1197 |
\endinput |
| 1198 |
% \end{macrocode} |
| 1199 |
% |
| 1200 |
% \changes{v1.2b}{1995/02/15}{Added {}{} after rightmark, leftmark to |
| 1201 |
% handle no-maketitle case} |
| 1202 |
% \changes{v1.2b}{1995/02/15}{Added frenchspacing in error env heading} |
| 1203 |
% |
| 1204 |
% \changes{v1.2c}{1996/10/28}{Update version number, date for new release} |
| 1205 |
% |
| 1206 |
% \changes{v1.2d}{1997/03/13}{Fixed up loading method for OT1cmtt fd file} |
| 1207 |
% |
| 1208 |
% \changes{v2.03}{2004/04/06}{Reworked indexing commands for |
| 1209 |
% compatibility with doc.sty} |
| 1210 |
% |
| 1211 |
% \changes{v2.04}{2004/04/07}{Further work on indexing commands for |
| 1212 |
% compatibility with macro and environment environments in \fn{doc.sty}. |
| 1213 |
% Also added \env{option} environment, \cs{DescribeOption}, |
| 1214 |
% \cs{PrintDescribeOption}, \cs{SpecialOptionIndex}, and |
| 1215 |
% \cs{SpecialMainOptionIndex}.} |
| 1216 |
% |
| 1217 |
% \changes{v2.05}{2004/04/27}{Fixed the amsdtx \cs{env} so that it |
| 1218 |
% prints its argument in addition to putting it in the index. Added |
| 1219 |
% |\penalty\exhyphenpenalty| to \cs{mdash} and \cs{ndash} as per |
| 1220 |
% \pkg{textcmds}.} |
| 1221 |
% |
| 1222 |
% \CheckSum{1569} |
| 1223 |
% \Finale |