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