minor changes, mainly html
[clqr.git] / clqr.tex
blobd0283441183aa0a56ab4ede2c984050235200679
1 % Copyright (C) 2008 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 \newcommand{\maintitle}{Common Lisp Quick Reference}
11 \newcommand{\revision}{\input{REVISION}}
13 \documentclass[8pt,pagesize,twoside,footexclude,headexclude]{scrartcl}
15 %%%%%%%%%%%%%%%%%%
16 % outsourced page dimensions
17 \input{paper-current}
18 %\setlength{\paperwidth}{10.5cm}
19 %\setlength{\paperheight}{29.7cm}
20 %%\areaset[3mm]{9cm}{28.3cm}
21 %\typearea[2mm]{20}
22 %%%%%%%%%%%%%%%%%%
23 \usepackage{amsmath}
24 \usepackage{amsfonts}
25 \usepackage{amssymb}
26 \usepackage{rotating}
27 \usepackage{graphics}
28 \usepackage{multicol}
29 \usepackage{textcase}
30 \usepackage[usenames,dvips]{color}
31 \usepackage{ifthen}
32 \usepackage{suffix}
33 \usepackage{makeidx}
34 \definecolor{lightgray}{gray}{.85}
35 \usepackage[pagestyles]{titlesec}
36 \usepackage{titletoc}
38 %%%%%%%%%%%%%%%%%%
39 % Two font alternatives:
40 % (A) Computer Modern
41 \usepackage{type1cm}
42 \usepackage{exscale}
43 %%%%%%%%%%%%%%%%%%
44 % (B) Times with Helvetica
45 %\usepackage{mathptmx}
46 %\usepackage[scaled]{helvet}
47 %%%%%%%%%%%%%%%%%%
49 \makeindex
50 \titleformat{\section}{\sffamily\mdseries\slshape}
51 {\huge\thesection}{.7em}{\huge}[{\titlerule[0.25pt]}]
53 \titleformat{\subsection}{\sffamily\mdseries\slshape}
54 {\Large\thesubsection}{.7em}{\Large}[{\titlerule[0.25pt]}]
56 % Kill toc header as we want it to span columns
57 \makeatletter
58 \renewcommand{\toc@heading}{}
59 \makeatother
61 \titlecontents{section}
62 [1.5em]
63 {\vspace{.5em plus 1em minus .2em}\sffamily\bfseries\upshape\filright}
64 {\contentslabel{1.5em}}
65 {\hspace*{3em}}
66 {\hfill\contentspage\vspace{.1em}}
68 \titlecontents{subsection}
69 [4em]
70 {\sffamily\mdseries\upshape\filright}
71 {\contentslabel{2.5em}}
72 {\hspace*{5.5em}}
73 {\hspace{1ex}\titlerule*[1.5ex]{.}\contentspage}
75 \newenvironment{LIST}[1]%
77 \begin{list}{}%
78 {\setlength{\itemindent}{-#1}\setlength{\leftmargin}{#1}}%
79 %\parskip0pt\itemsep0pt
81 {\end{list}%
84 \renewcommand{\topfraction}{1}
85 \renewcommand{\bottomfraction}{1}
86 \renewcommand*{\figureformat}{}
87 \renewcommand*{\captionformat}{}
88 \renewcommand{\thefootnote}{\fnsymbol{footnote}}
90 \setlength{\parfillskip}{5cm plus1cm minus3cm}
91 \setlength{\arraycolsep}{0pt}
93 \newcommand{\IT}[1]{\item{{\rule{0pt}{2pt}}%
94 #1}\hspace{2em plus 2em minus.5em}\penalty-9$\triangleright$}
96 \newpagestyle{lispref}[\sffamily\mdseries\slshape]{
97 \headrule\footrule
98 \sethead*{}{}{\maintitle\/}
99 \setfoot*{}{}{\thepage\/}}
100 \pagestyle{lispref}
103 % Literal Text
104 \newcommand{\LIT}[1]{\text{{\fontfamily{cmtt}\selectfont#1}}}
106 % Variable Text
107 \newcommand{\VAR}[1]{\text{{\fontfamily{cmr}\fontshape{it}\selectfont#1\/}}}
109 % Default Value
110 \newcommand{\DF}[1]{\text{\textsubscript{\setlength{\fboxsep}{.5pt}\setlength{\fboxrule}{.1pt}\fbox{#1}}}}
112 % Optional Part, [], two sizes
113 \newcommand{\OP}[1]{{\text{$\big[$}{#1}\text{$\big]$}}}
114 \newcommand{\Op}[1]{{\text{$[$}{#1}\text{$]$}}}
116 % Or, |
117 \newcommand{\XOR}{\hspace{1pt}\text{\rule[-.9ex]{.25pt}{3ex}}\hspace{1pt}}
118 %\newcommand{\XOR}{\text{$\mid$}\hspace{0pt}}
120 % Optional Parts, *
121 \newcommand{\OPn}[1]{{{#1}\text{${}^{*}$}}}
123 % Required Parts, +
124 \newcommand{\RP}[1]{{{#1}\text{${}^{+}$}}}
127 % Group of Objects {}, three sizes
128 \newcommand{\GOO}[1]{{\text{$\Big\{$}{#1}\text{$\Big\}$}}}
129 \newcommand{\GOo}[1]{{\text{$\big\{$}{#1}\text{$\big\}$}}}
130 \newcommand{\Goo}[1]{{\text{$\{$}{#1}\text{$\}$}}}
131 % Optional Group of Objects, {}*, three sizes
132 \newcommand{\GOOs}[1]{{$\Big\{${#1}$\Big\}^{\!\!*}$}}
133 \newcommand{\GOos}[1]{\text{{$\big\{${#1}$\big\}^{\!\!*}$}}}
134 \newcommand{\Goos}[1]{\text{{$\{${#1}$\}^{\!*}$}}}
135 % Required Group of Objects, {}+, three sizes
136 \newcommand{\GOOp}[1]{{\text{$\Big\{$}{#1}\text{$\Big\}^{\!\!+}$}}}
137 \newcommand{\GOop}[1]{{\text{$\big\{$}{#1}\text{$\big\}^{\!\!+}$}}}
138 \newcommand{\Goop}[1]{{\text{$\{$}{#1}\text{$\}^{\!+}$}}}
140 % Vertically Arranged Group of Alternatives, {
141 % usage: \xorGOO{line1\\ line2...}{closing delimiter}
142 \newcommand{\xorGOO}[2]{\text{\(%
143 \left\{%
144 \begin{array}{l}%
146 \end{array}%
147 \right#2%
148 \)}}
150 % Vertically Arranged Group of Optional Objects, {|
151 % usage: \orGOO{line1\\line2}{closing delimiter}
152 \newcommand{\orGOO}[2]{\text{\(%
153 \left\{\!\left|%
154 \begin{array}{l}%
156 \end{array}%
157 \right.\right#2%
158 \)}}
160 % Vertically Arranged Group of Objects, No Opening {
161 % usage: \arrGOO{line1\\line2}{closing delimiter}
162 \newcommand{\arrGOO}[2]{{\(%
163 \left.%
164 \begin{array}{l}%
166 \end{array}%
167 \right#2%
168 \)}}
170 % Boxed Group of Alternatives
171 % usage: \boxGOO{line1\\ line2...}
172 \newcommand{\boxGOO}[1]{\text{\hspace{1ex}\(%
173 \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{0pt}
174 \boxed{
175 \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{.1pt}
176 \boxed{\;%
177 \begin{array}{l}%
179 \end{array}%
182 \)}}
185 % All sorts of keywords
186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188 % Generic Keyword, Lowercase
189 \newcommand{\kwd}[1]{\text{{\sffamily\bfseries\selectfont%
190 \lowercase{#1}}}}
191 % Generic Keyword, Uppercase
192 \newcommand{\KWD}[1]{\text{{\sffamily\bfseries\selectfont%
193 \uppercase{#1}}}}
194 % Special Form
195 \newcommand{\SF}[1]{\text{{\sffamily\bfseries\selectfont%
196 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}SF}}\lowercase{#1}}}}}
197 % Function
198 \newcommand{\FU}[1]{\text{{\sffamily\bfseries\selectfont%
199 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}Fu}}\lowercase{#1}}}}}
200 % Generic Function
201 \newcommand{\GFU}[1]{\text{{\sffamily\bfseries\selectfont%
202 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}gF}}\lowercase{#1}}}}}
203 % Variable
204 \newcommand{\V}[1]{\text{{\sffamily\bfseries\selectfont%
205 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.8em}var}}\lowercase{#1}}}}}
206 % Constant
207 \newcommand{\CNS}[1]{\text{{\sffamily\bfseries\selectfont%
208 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}co}}\lowercase{#1}}}}}
209 % Loop Keyword
210 \newcommand{\LKWD}[1]{\text{{\sffamily\bfseries\selectfont%
211 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}}}\lowercase{#1}}}}}
213 % Return values, First, Second, Third
214 \newcommand{\retval}[1]{\underline{#1}}
215 \newcommand{\retvalii}[1]{\underline{\underline{#1}}}
216 \newcommand{\retvaliii}[1]{\underline{\underline{\underline{#1}}}}
218 % T and NIL
219 \newcommand{\T}{\text{\ttfamily T}}
220 \newcommand{\NIL}{\text{\ttfamily NIL}}
222 \newcommand{\TLD}{{\textasciitilde}}
224 % Starred versions send argument into index:
225 \WithSuffix\newcommand\kwd*[1]{\kwd{#1}\uppercase{\index{#1}}}
226 \WithSuffix\newcommand\KWD*[1]{\KWD{#1}\uppercase{\index{#1}}}
227 \WithSuffix\newcommand\SF*[1]{\SF{#1}\uppercase{\index{#1}}}
228 \WithSuffix\newcommand\FU*[1]{\FU{#1}\uppercase{\index{#1}}}
229 \WithSuffix\newcommand\GFU*[1]{\GFU{#1}\uppercase{\index{#1}}}
230 \WithSuffix\newcommand\V*[1]{\V{#1}\uppercase{\index{#1}}}
231 \WithSuffix\newcommand\CNS*[1]{\CNS{#1}\uppercase{\index{#1}}}
232 \WithSuffix\newcommand\LKWD*[1]{\LKWD{#1}\uppercase{\index{#1}}}
234 \begin{document}
236 \newlength{\titlepagewidth}
237 \setlength{\titlepagewidth}{8cm}
238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239 %% Front Cover
240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241 \begin{titlepage}
242 \renewcommand{\rmdefault}{ptm} %% Always times font on title
243 \vspace*{15mm}
244 \begin{center}
245 \begin{minipage}{\titlepagewidth}
246 \begin{center}
247 \rmfamily\mdseries\itshape\fontsize{20}{0}\selectfont
248 Quick Reference\\
249 \end{center}
250 \end{minipage}
251 \vfill
252 \begin{minipage}{\titlepagewidth}
253 \begin{center}
254 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont%
255 {\color{lightgray}cl\/}\\
256 %\rmfamily\mdseries\upshape\fontsize{350}{0}\selectfont
257 %{\color{lightgray}\boldmath$\lambda$}\\
258 \end{center}
259 \end{minipage}
260 \vfill
261 \begin{minipage}{\titlepagewidth}
262 \rmfamily\mdseries\itshape\fontsize{36}{0}\selectfont
263 \hfill Common\/\\[2mm]
264 \rmfamily\mdseries\upshape\fontsize{157}{0}\selectfont
265 \rule[3mm]{\textwidth}{1.5mm}\\
266 lisp\\[-10mm]
267 \rule[15mm]{5.5cm}{1.5mm}\hfill\rule[15mm]{1.77cm}{1.5mm}
268 \end{minipage}
269 \begin{minipage}{\titlepagewidth}
270 \rmfamily\mdseries\upshape\fontsize{14}{0}\selectfont
271 Bert Burgemeister
272 \vspace*{4mm}
273 \end{minipage}
274 \end{center}
276 \end{titlepage}
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279 \section*{\contentsname}
280 \vspace{-3ex}
282 \setlength{\columnsep}{1.5em}%
283 \begin{multicols}{2}
284 \tableofcontents
285 \end{multicols}%
287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 \vfill
289 \raggedright
291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292 \section*{Typographic Conventions}
293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295 \begin{LIST}{1cm}
297 \IT{\kwd{NAME}, \FU{NAME}, \SF{NAME}, \GFU{NAME}, \V{*name*},
298 \CNS{name}}
299 Symbol defined in Common Lisp; esp. function, special form, generic function,
300 variable, constant.
302 \IT{\VAR{them}\DF{\LIT{foo}}}
303 Placeholder for actual code. Defaults to \LIT{foo}.
305 \IT{\LIT{me}}
306 Text to input literally, or output literally.
308 \IT{\Op{\VAR{foo}}}
309 Either one \VAR{foo} or nothing.
311 \IT{\OPn{\VAR{foo}}; \Goos{\VAR{foo}}}
312 Zero or more \VAR{foo}s.
314 \IT{\RP{\VAR{foo}}; \Goop{\VAR{foo}}}
315 One or more \VAR{foo}s.
317 \IT{\VAR{foos}}
318 English plural denotes a list argument.
320 \IT{\Goo{\VAR{foo}\XOR\VAR{bar}\XOR\VAR{baz}};
321 \xorGOO{
322 \VAR{foo}\\
323 \VAR{bar}\\
324 \VAR{baz}%
325 }{.}}
326 Either \VAR{foo}, or \VAR{bar}, or \VAR{baz}.
328 \IT{\orGOO{
329 \VAR{foo}\\
330 \VAR{bar}\\
331 \VAR{baz}
332 }{.}}
333 Anything from none to all of \VAR{foo}, \VAR{bar}, and \VAR{baz}.
335 \IT{\retval{\VAR{foo}}; \retvalii{\VAR{bar}}; \retvaliii{\VAR{baz}}}
336 \VAR{foo}, \VAR{bar}, \VAR{baz} are 1st, 2nd, and 3rd return value.
338 \IT{\T}
339 \kwd*{T}, or truth.
341 \IT{\NIL}
342 \kwd*{NIL}, falsehood, or \kwd{()}.
344 \end{LIST}
345 \clearpage
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348 %%% Content starts here %%%%%%%%%%%%%%%%%%%%%%%%%%
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353 \input{clqr-numbers}
355 \input{clqr-characters}
357 \input{clqr-strings}
359 \input{clqr-conses}
361 \input{clqr-arrays}
363 \input{clqr-sequences}
365 \input{clqr-hash-tables}
367 \input{clqr-structures}
369 \input{clqr-control-structure}
371 \input{clqr-clos}
373 \input{clqr-conditions-and-errors}
375 \input{clqr-input-output}
377 \input{clqr-system-types-and-classes}
379 \input{clqr-symbols-and-packages}
381 \input{clqr-compiler}
383 \input{clqr-environment}
385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 \renewcommand{\indexpagestyle}{lispref}
389 \renewenvironment{theindex}%
390 {\begin{list}{}%
391 {\setlength{\itemindent}{-1em}\setlength{\leftmargin}{1em}}%
392 \parskip0pt\itemsep0pt}%
393 {\end{list}}
394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
395 \section*{Index}
396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
397 \vspace{-3ex}
398 \begin{multicols}{3}
399 % Stock \printindex won't do as we want three-column.
400 \tiny\sffamily\input{clqr.ind}
401 \end{multicols}
404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
405 % Make (total) page count a multiple of four.
406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407 \clearpage
408 \pagestyle{empty}
409 \newcount\currentpage
410 \currentpage=\value{page}
411 \divide\currentpage by 4
412 \multiply\currentpage by 4
413 \advance\currentpage by -\value{page}
414 \ifthenelse{\equal{\the\currentpage}{-3}}{\rule{0pt}{0pt}\clearpage}{}
415 \ifthenelse{\equal{\the\currentpage}{-2}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
416 \ifthenelse{\equal{\the\currentpage}{-1}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
419 %% Back Cover
420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421 \begin{titlepage}
422 \begin{center}
423 \renewcommand{\rmdefault}{ptm} %% Always times font on title
424 \vspace*{15mm}
425 \vfill
426 \begin{minipage}{\titlepagewidth}
427 \begin{center}
428 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont
429 \reflectbox{{\color{lightgray}cl\/}}\\
430 %\ttfamily\mdseries\upshape\fontsize{200}{0}\selectfont
431 %{\color{Gray}$(\lambda)$}
432 \end{center}
433 \end{minipage}
434 \vfill
435 \rule{1.75cm}{0pt}
436 \vfill
437 \begin{minipage}{\titlepagewidth}
438 \hrule
439 \vspace{1.5mm}
440 \rmfamily\small
441 \makebox[\textwidth][l]{\maintitle\ \hfill Revision \revision [\number\year-\number\month-\number\day]}
442 \makebox[\textwidth][l]{Copyright \copyright\ 2008 Bert Burgemeister}\\
444 Permission is granted to copy, distribute and/or modify this
445 document under the terms of the GNU Free Documentation License,
446 Version 1.2 or any later version published by the Free Software
447 Foundation; with no Invariant Sections, no Front-Cover Texts and
448 no Back-Cover Texts.\\
449 http://www.gnu.org/licenses/fdl.html\\
451 \vspace{-1mm}
452 \hrule
453 \end{minipage}
454 \end{center}
455 \end{titlepage}
457 \end{document}
458 % -*-latex-*-