index.html now index.php with news
[clqr.git] / clqr.tex
blob6df21758197209a6effeb3b06abdb83bf82fb4ba
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{\AUTHOR}{Bert~Burgemeister}
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 %%%%%%%%%%%%%%%%%%
24 %%%%%%%%%%%%%%%%%%
25 % outsourced hypertext colors
26 \input{color-current}
27 %\newcommand{\linkcolor}{Fuchsia}
28 %\newcommand{\urlcolor}{MidnightBlue}
29 %\newcommand{\bookmarks}{true}
30 %\newcommand{\pdfpagelayout}{TwoColumnLeft}
31 %%%%%%%%%%%%%%%%%%
33 \usepackage{amsmath}
34 \usepackage{amsfonts}
35 \usepackage{amssymb}
36 \usepackage{rotating}
37 \usepackage{graphics}
38 \usepackage{multicol}
39 \usepackage{textcase}
40 \usepackage{ulem}
41 \usepackage[usenames,dvips]{color}
42 \usepackage{ifthen}
43 \usepackage{suffix}
44 \usepackage{makeidx}
45 \definecolor{lightgray}{gray}{.85}
46 \usepackage[pagestyles]{titlesec}
47 \usepackage{titletoc}
49 %%%%%%%%%%%%%%%%%%
50 % Two font alternatives:
51 % (A) All Computer Modern
52 \usepackage{type1cm}
53 \usepackage{exscale}
54 %%%%%%%%%%%%%%%%%%
55 % (B) Times mixed with Helvetica
56 %\usepackage{mathptmx}
57 %\usepackage[scaled]{helvet}
58 %%%%%%%%%%%%%%%%%%
60 % should remain last usepackage:
61 \usepackage%
62 [breaklinks,linktocpage,colorlinks,%
63 bookmarksnumbered,bookmarks=\bookmarks,%
64 linkcolor=\linkcolor,urlcolor=\urlcolor,%
65 pdfpagelayout=\pdfpagelayout,%
66 pdftitle=\maintitle,pdfauthor=\AUTHOR]%
67 {hyperref}
69 \makeindex
70 \titleformat{\section}{\sffamily\mdseries\slshape}
71 {\huge\thesection}{.7em}{\huge}[{\titlerule[0.25pt]}]
73 \titleformat{\subsection}{\sffamily\mdseries\slshape}
74 {\Large\thesubsection}{.7em}{\Large}[{\titlerule[0.25pt]}]
76 % Kill toc header as we want it to span columns
77 \makeatletter
78 \renewcommand{\toc@heading}{}
79 \makeatother
81 \titlecontents{section}
82 [1.5em]
83 {\vspace{.5em plus 1em minus .2em}\sffamily\bfseries\upshape\filright}
84 {\contentslabel{1.5em}}
85 {\hspace*{3em}}
86 {\hfill\contentspage\vspace{.1em}}
88 \titlecontents{subsection}
89 [4em]
90 {\sffamily\mdseries\upshape\filright}
91 {\contentslabel{2.5em}}
92 {\hspace*{5.5em}}
93 {\hspace{1ex}\titlerule*[1.5ex]{.}\contentspage}
95 \newlength{\LISTlinewidth}
96 \newenvironment{LIST}[1]%
98 \LISTlinewidth=\linewidth
99 \begin{flushleft}%
100 \begin{list}{}%
101 {\setlength{\itemindent}{-#1}\setlength{\leftmargin}{#1}}%
102 %\parskip0pt\itemsep0pt
104 {\end{list}%
105 \end{flushleft}%
108 %\renewcommand{\topfraction}{1}
109 \renewcommand{\bottomfraction}{1}
110 \renewcommand*{\figureformat}{}
111 \renewcommand*{\captionformat}{}
112 \renewcommand{\thefootnote}{\fnsymbol{footnote}}
114 \setlength{\parfillskip}{5cm plus1cm minus3cm}
115 \setlength{\arraycolsep}{0pt}
118 \def\startexplanation{$\triangleright$\hskip1.4ex}
119 \newlength{\ITwidth}
120 \newlength{\ITrest}
121 \newlength{\ITtab}\ITtab=3em
123 \def\IT#1 #2 {%
124 \settowidth{\ITwidth}{#1\unskip\hskip1em\hskip\ITtab}%
125 \ITrest=\LISTlinewidth\advance\ITrest by -\ITwidth%
126 \loop\ifdim\ITrest > \ITtab%
127 \advance\ITrest by -\ITtab%
128 \repeat%
130 \settowidth{\ITwidth}{%
131 #1\unskip\hskip1em\hskip\ITrest%
132 \startexplanation#2%
134 \item{}%
135 \ifdim\ITwidth < \LISTlinewidth% Entry fits into a single line
136 #1\unskip\hskip1em\hskip\ITrest%
137 \startexplanation#2%
138 \else%
140 \unskip\penalty-10000%
141 \parbox[t]{\linewidth}{\startexplanation#2}%
142 \fi%
146 \newpagestyle{lispref}[\sffamily\mdseries\slshape]{
147 \headrule\footrule
148 \sethead*{}{}{\maintitle\/}
149 \setfoot*{}{}{\thepage\/}}
150 \pagestyle{lispref}
153 % Literal Text
154 \newcommand{\LIT}[1]{\text{{\fontfamily{cmtt}\selectfont#1}}}
156 % Variable Text
157 \newcommand{\VAR}[1]{\text{{\fontfamily{cmr}\fontshape{it}\selectfont#1\/}}}
159 % Not Evaluated
160 \newcommand{\NEV}[1]{\text{{$\widehat{#1}$}}}
162 % Default Value
163 \newcommand{\DF}[1]{\text{\textsubscript{\setlength{\fboxsep}{.5pt}\setlength{\fboxrule}{.1pt}\fbox{#1}}}}
165 % Optional Part, [], two sizes
166 \newcommand{\OP}[1]{{\text{$\big[$}{#1}\text{$\big]$}}}
167 \newcommand{\Op}[1]{{\text{$[$}{#1}\text{$]$}}}
169 % Or, |
170 \newcommand{\XOR}{\hspace{1pt}\text{\rule[-.9ex]{.25pt}{3ex}}\hspace{1pt}}
171 %\newcommand{\XOR}{\text{$\mid$}\hspace{0pt}}
173 % Optional Parts, *
174 \newcommand{\OPn}[1]{{{#1}\text{${}^{*}$}}}
176 % Required Parts, +
177 \newcommand{\RP}[1]{{{#1}\text{${}^{+}$}}}
180 % Group of Objects {}, three sizes
181 \newcommand{\GOO}[1]{{\text{$\Big\{$}{#1}\text{$\Big\}$}}}
182 \newcommand{\GOo}[1]{{\text{$\big\{$}{#1}\text{$\big\}$}}}
183 \newcommand{\Goo}[1]{{\text{$\{$}{#1}\text{$\}$}}}
184 % Optional Group of Objects, {}*, three sizes
185 \newcommand{\GOOs}[1]{{$\Big\{${#1}$\Big\}^{\!\!*}$}}
186 \newcommand{\GOos}[1]{\text{{$\big\{${#1}$\big\}^{\!\!*}$}}}
187 \newcommand{\Goos}[1]{\text{{$\{${#1}$\}^{\!*}$}}}
188 % Required Group of Objects, {}+, three sizes
189 \newcommand{\GOOp}[1]{{\text{$\Big\{$}{#1}\text{$\Big\}^{\!\!+}$}}}
190 \newcommand{\GOop}[1]{{\text{$\big\{$}{#1}\text{$\big\}^{\!\!+}$}}}
191 \newcommand{\Goop}[1]{{\text{$\{$}{#1}\text{$\}^{\!+}$}}}
193 % Vertically Arranged Group of Alternatives, {
194 % usage: \xorGOO{line1\\ line2...}{closing delimiter}
195 \newcommand{\xorGOO}[2]{\text{\(%
196 \left\{\!%
197 \begin{array}{l}%
199 \end{array}\!%
200 \right#2%
201 \)}}
203 % Vertically Arranged Group of Optional Objects, {|
204 % usage: \orGOO{line1\\line2}{closing delimiter}
205 \newcommand{\orGOO}[2]{\text{\(%
206 \left\{\!\left|%
207 \begin{array}{l}%
209 \end{array}\!%
210 \right.\right#2%
211 \)}}
213 % Vertically Arranged Group of Objects, No Opening {
214 % usage: \arrGOO{line1\\line2}{closing delimiter}
215 \newcommand{\arrGOO}[2]{\text{\(\!%
216 \left.%
217 \begin{array}{l}%
219 \end{array}\!%
220 \right#2%
221 \)}}
223 % Boxed Group of Alternatives
224 % usage: \boxGOO{line1\\ line2...}
225 \newcommand{\boxGOO}[1]{\text{\hspace{1ex}\(%
226 \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{0pt}
227 \boxed{
228 \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{.1pt}
229 \boxed{\;%
230 \begin{array}{l}%
232 \end{array}%
235 \)}}
238 % In a Boxed Group of Alternatives: Replacement for \\ with additional
239 % vspace
240 \newcommand{\boxGOOcr}{\vspace{1ex}\\}
243 % All sorts of keywords
244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246 % Generic Keyword, Lowercase
247 \newcommand{\kwd}[1]{\text{{\sffamily\bfseries\selectfont%
248 \lowercase{#1}}}}
249 % Generic Keyword, Uppercase
250 \newcommand{\KWD}[1]{\text{{\sffamily\bfseries\selectfont%
251 \uppercase{#1}}}}
252 % Macro
253 \newcommand{\MC}[1]{\text{{\sffamily\bfseries\selectfont%
254 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}M}}\lowercase{#1}}}}}
255 % Special Operator
256 \newcommand{\SO}[1]{\text{{\sffamily\bfseries\selectfont%
257 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}SO}}\lowercase{#1}}}}}
258 % Function
259 \newcommand{\FU}[1]{\text{{\sffamily\bfseries\selectfont%
260 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}Fu}}\lowercase{#1}}}}}
261 % Generic Function
262 \newcommand{\GFU}[1]{\text{{\sffamily\bfseries\selectfont%
263 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}gF}}\lowercase{#1}}}}}
264 % Variable
265 \newcommand{\V}[1]{\text{{\sffamily\bfseries\selectfont%
266 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.8em}var}}\lowercase{#1}}}}}
267 % Constant
268 \newcommand{\CNS}[1]{\text{{\sffamily\bfseries\selectfont%
269 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}co}}\lowercase{#1}}}}}
270 % Loop Keyword
271 \newcommand{\LKWD}[1]{\text{{\sffamily\bfseries\selectfont%
272 {\raisebox{1.4ex}[1ex][0pt]{\tiny\sffamily\mdseries\makebox[0pt][l]{\hspace{.5em}}}\lowercase{#1}}}}}
274 % Return values, First, Second, nth, Third
275 \newcommand{\retval}[1]{\uline{#1}}
276 \newcommand{\retvalii}[1]{\uuline{#1}}
277 \newcommand{\retvaln}[2]{{%
278 {\raisebox{-1.7ex}[1ex][0pt]{\tiny\sffamily\upshape\mdseries\makebox[0pt][l]{\hspace{-.1em}#1}}\uline{#2}}}}
279 \newcommand{\retvaliii}[1]{\retvaln{3}{#1}}
281 % T and NIL
282 \newcommand{\T}{\text{\ttfamily T}}
283 \newcommand{\NIL}{\text{\ttfamily NIL}}
285 \newcommand{\TLD}{{\textasciitilde}}
287 % Starred versions send argument into index:
288 \WithSuffix\newcommand\kwd*[1]{\kwd{#1}\uppercase{\index{#1}}}
289 \WithSuffix\newcommand\KWD*[1]{\KWD{#1}\uppercase{\index{#1}}}
290 \WithSuffix\newcommand\MC*[1]{\MC{#1}\uppercase{\index{#1}}}
291 \WithSuffix\newcommand\SO*[1]{\SO{#1}\uppercase{\index{#1}}}
292 \WithSuffix\newcommand\FU*[1]{\FU{#1}\uppercase{\index{#1}}}
293 \WithSuffix\newcommand\GFU*[1]{\GFU{#1}\uppercase{\index{#1}}}
294 \WithSuffix\newcommand\V*[1]{\V{#1}\uppercase{\index{#1}}}
295 \WithSuffix\newcommand\CNS*[1]{\CNS{#1}\uppercase{\index{#1}}}
296 \WithSuffix\newcommand\LKWD*[1]{\LKWD{#1}\uppercase{\index{#1}}}
298 \begin{document}
300 \newlength{\titlepagewidth}
301 \setlength{\titlepagewidth}{8cm}
302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303 %% Front Cover
304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305 \begin{titlepage}
306 \renewcommand{\rmdefault}{ptm} %% Always times font on title
307 \vspace*{15mm}
308 \begin{center}
309 \begin{minipage}{\titlepagewidth}
310 \begin{center}
311 \rmfamily\mdseries\itshape\fontsize{20}{0}\selectfont
312 Quick Reference\\
313 \end{center}
314 \end{minipage}
315 \vfill
316 \begin{minipage}{\titlepagewidth}
317 \begin{center}
318 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont%
319 {\color{lightgray}cl\/}\\
320 \end{center}
321 \end{minipage}
322 \vfill
323 \begin{minipage}{\titlepagewidth}
324 \rmfamily\mdseries\itshape\fontsize{36}{0}\selectfont
325 \hfill Common\/\\[2mm]
326 \rmfamily\mdseries\upshape\fontsize{157}{0}\selectfont
327 \rule[3mm]{\textwidth}{1.5mm}\\
328 lisp\\[-10mm]
329 \rule[15mm]{5.5cm}{1.5mm}\hfill\rule[15mm]{1.77cm}{1.5mm}
330 \end{minipage}
331 \begin{minipage}{\titlepagewidth}
332 \rmfamily\mdseries\upshape\fontsize{14}{0}\selectfont
333 \AUTHOR
334 \vspace*{4mm}
335 \end{minipage}
336 \end{center}
338 \end{titlepage}
340 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341 \section*{\contentsname}
342 \vspace{-3ex}
344 \setlength{\columnsep}{1.5em}%
345 \begin{multicols}{2}
346 \tableofcontents
347 \end{multicols}%
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 \vfill
351 %\begin{flushleft}
352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353 \section*{Typographic Conventions}
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 \begin{LIST}{1cm}
358 \IT{\kwd{NAME}, \FU{NAME}, \MC{NAME}, \SO{NAME}, \GFU{NAME}, \V{*name*},
359 \CNS{name}}
361 Symbol defined in Common Lisp; esp.\ function, macro, special operator, generic function,
362 variable, constant.
365 \IT{\VAR{them}\qquad\qquad\qquad}
367 Placeholder for actual code.
370 \IT{\LIT{me}\qquad\qquad\qquad\qquad}
372 Text to input literally, or output literally.
375 \IT{\Op{\VAR{foo}\DF{\LIT{bar}}}\qquad\qquad}
377 Either one \VAR{foo} or nothing; defaults to \LIT{bar}.
380 \IT{\OPn{\VAR{foo}}; \Goos{\VAR{foo}}}
382 Zero or more \VAR{foo}s.
385 \IT{\RP{\VAR{foo}}; \Goop{\VAR{foo}}}
387 One or more \VAR{foo}s.
390 \IT{\VAR{foos}\qquad\qquad\qquad}
392 English plural denotes a list argument.
395 \IT{\Goo{\VAR{foo}\XOR\VAR{bar}\XOR\VAR{baz}};
396 \xorGOO{
397 \VAR{foo}\\
398 \VAR{bar}\\
399 \VAR{baz}%
400 }{.}}
402 Either \VAR{foo}, or \VAR{bar}, or \VAR{baz}.
405 \IT{\orGOO{
406 \VAR{foo}\\
407 \VAR{bar}\\
408 \VAR{baz}
409 }{.}}
411 Anything from none to each of \VAR{foo}, \VAR{bar}, and \VAR{baz}.
414 \IT{\NEV{\VAR{bar}}\qquad\qquad\qquad}
416 \VAR{bar} is not evaluated.
419 \IT{\retval{\VAR{foo}}; \retvalii{\VAR{bar}};
420 \retvaln{\VAR{n}}{\VAR{baz}}}
422 First, second and \VAR{n}th return value.
425 \IT{\T\qquad\qquad\qquad\qquad}
427 \kwd*{T}, or truth in general.
430 \IT{\NIL\qquad\qquad\qquad}
432 \kwd*{NIL} or \kwd{()}.
435 \end{LIST}
436 \clearpage
437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 %%% Content starts here %%%%%%%%%%%%%%%%%%%%%%%%%%
439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
441 \input{clqr-numbers}
442 \input{clqr-characters}
443 \input{clqr-strings}
444 \input{clqr-conses}
445 \input{clqr-arrays}
446 \input{clqr-sequences}
447 \input{clqr-hash-tables}
448 \input{clqr-structures}
449 \input{clqr-control-structure}
450 \input{clqr-clos}
451 \input{clqr-conditions-and-errors}
452 \input{clqr-input-output}
453 \input{clqr-system-types-and-classes}
454 \input{clqr-packages-and-symbols}
455 \input{clqr-compiler}
456 \input{clqr-environment}
458 %\end{flushleft}
460 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
464 \clearpage % Uncomment/comment this line to save/waste some space
466 \renewcommand{\indexpagestyle}{lispref}
467 \renewenvironment{theindex}%
468 {\begin{list}{}%
469 {\setlength{\itemindent}{-1em}\setlength{\leftmargin}{1em}}%
470 \parskip0pt plus .1pt \itemsep0pt%
471 \raggedright\looseness=-1%
473 {\end{list}}
474 \begin{multicols}{4}
475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
476 [\section*{Index}\vspace{-5ex}]
477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 % Stock \printindex won't do as we want more than two columns.
479 \tiny\sffamily\input{clqr.ind}
480 \end{multicols}
483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
484 % Make (total) page count a multiple of four.
485 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
486 \clearpage
487 \pagestyle{empty}
488 \newcount\currentpage
489 \currentpage=\value{page}
490 \divide\currentpage by 4
491 \multiply\currentpage by 4
492 \advance\currentpage by -\value{page}
493 \ifthenelse{\equal{\the\currentpage}{-3}}{\rule{0pt}{0pt}\clearpage}{}
494 \ifthenelse{\equal{\the\currentpage}{-2}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
495 \ifthenelse{\equal{\the\currentpage}{-1}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
498 %% Back Cover
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
500 \begin{titlepage}
501 \begin{center}
502 \renewcommand{\rmdefault}{ptm} %% Always times font on title
503 \vspace*{20pt}
504 \vfill
505 \begin{minipage}{\titlepagewidth}
506 \begin{center}
507 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont
508 \reflectbox{{\color{lightgray}cl\/}}\\
509 \end{center}
510 \end{minipage}
511 \vfill
512 \vspace*{43mm}% Adjust here if text below changes
513 \begin{minipage}{\titlepagewidth}
514 \hrule
515 \vspace{1.5mm}
516 \rmfamily\small
517 \makebox[\textwidth][l]{\maintitle\ \hfill Revision \input{REVISION}
518 [\input{DATE}\hspace{-.65ex}]}
519 \makebox[\textwidth][l]{Copyright \copyright\ 2008 \AUTHOR\hfill\LaTeX\ source:
520 \href{http://clqr.berlios.de}{http://clqr.berlios.de}}\\[1.5mm]
521 Permission is granted to copy, distribute and/or modify this
522 document under the terms of the GNU Free Documentation License,
523 Version 1.2 or any later version published by the Free Software
524 Foundation; with no Invariant Sections, no Front-Cover Texts and
525 no Back-Cover Texts.\hfill
526 \href{http://www.gnu.org/licenses/fdl.html}{http://www.gnu.org/licenses/fdl.html}\\
527 \vspace{-1mm}
528 \hrule
529 \end{minipage}
530 \end{center}
531 \end{titlepage}
533 \end{document}
534 % -*-latex-*-