rearragements, changes in layout
[clqr.git] / clqr.tex
blobb8cf116ecc303a6f3c19585fb697efc6f8d3d484
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 \begin{flushleft}
287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 \section*{Typographic Conventions}
289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 \begin{LIST}{1cm}
293 \IT{\kwd{NAME}, \FU{NAME}, \SF{NAME}, \GFU{NAME}, \V{*name*},
294 \CNS{name}}
295 Symbol defined in Common Lisp; esp. function, special form, generic function,
296 variable, constant.
298 \IT{\VAR{them}\DF{\LIT{foo}}}
299 Placeholder for actual code. Defaults to \LIT{foo}.
301 \IT{\LIT{me}}
302 Text to input literally, or output literally.
304 \IT{\Op{\VAR{foo}}}
305 Either one \VAR{foo} or nothing.
307 \IT{\OPn{\VAR{foo}}; \Goos{\VAR{foo}}}
308 Zero or more \VAR{foo}s.
310 \IT{\RP{\VAR{foo}}; \Goop{\VAR{foo}}}
311 One or more \VAR{foo}s.
313 \IT{\VAR{foos}}
314 English plural denotes a list argument.
316 \IT{\Goo{\VAR{foo}\XOR\VAR{bar}\XOR\VAR{baz}};
317 \xorGOO{
318 \VAR{foo}\\
319 \VAR{bar}\\
320 \VAR{baz}%
321 }{.}}
322 Either \VAR{foo}, or \VAR{bar}, or \VAR{baz}.
324 \IT{\orGOO{
325 \VAR{foo}\\
326 \VAR{bar}\\
327 \VAR{baz}
328 }{.}}
329 Anything from none to all of \VAR{foo}, \VAR{bar}, and \VAR{baz}.
331 \IT{\retval{\VAR{foo}}; \retvalii{\VAR{bar}}; \retvaliii{\VAR{baz}}}
332 \VAR{foo}, \VAR{bar}, \VAR{baz} are 1st, 2nd, and 3rd return value.
334 \IT{\T}
335 \kwd*{T}, or truth.
337 \IT{\NIL}
338 \kwd*{NIL}, falsehood, or \kwd{()}.
340 \end{LIST}
341 \clearpage
342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343 %%% Content starts here %%%%%%%%%%%%%%%%%%%%%%%%%%
344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346 \input{clqr-numbers}
347 \input{clqr-characters}
348 \input{clqr-strings}
349 \input{clqr-conses}
350 \input{clqr-arrays}
351 \input{clqr-sequences}
352 \input{clqr-hash-tables}
353 \input{clqr-structures}
354 \input{clqr-control-structure}
355 \input{clqr-clos}
356 \input{clqr-conditions-and-errors}
357 \input{clqr-input-output}
358 \input{clqr-system-types-and-classes}
359 \input{clqr-packages-and-symbols}
360 \input{clqr-compiler}
361 \input{clqr-environment}
363 \end{flushleft}
365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
369 %\clearpage % Uncomment this line to save some space
371 \renewcommand{\indexpagestyle}{lispref}
372 \renewenvironment{theindex}%
373 {\begin{list}{}%
374 {\setlength{\itemindent}{-1em}\setlength{\leftmargin}{1em}}%
375 \parskip0pt\itemsep0pt}%
376 {\end{list}}
377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
378 \section*{Index}
379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
380 \vspace{-3ex}
381 \begin{multicols}{4}
382 % Stock \printindex won't do as we want three-column.
383 \tiny\sffamily\input{clqr.ind}
384 \end{multicols}
387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388 % Make (total) page count a multiple of four.
389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390 \clearpage
391 \pagestyle{empty}
392 \newcount\currentpage
393 \currentpage=\value{page}
394 \divide\currentpage by 4
395 \multiply\currentpage by 4
396 \advance\currentpage by -\value{page}
397 \ifthenelse{\equal{\the\currentpage}{-3}}{\rule{0pt}{0pt}\clearpage}{}
398 \ifthenelse{\equal{\the\currentpage}{-2}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
399 \ifthenelse{\equal{\the\currentpage}{-1}}{\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage}{}
401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
402 %% Back Cover
403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404 \begin{titlepage}
405 \begin{center}
406 \renewcommand{\rmdefault}{ptm} %% Always times font on title
407 \vspace*{15mm}
408 \vfill
409 \begin{minipage}{\titlepagewidth}
410 \begin{center}
411 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont
412 \reflectbox{{\color{lightgray}cl\/}}\\
413 \end{center}
414 \end{minipage}
415 \vfill
416 \rule{1.75cm}{0pt}
417 \vfill
418 \begin{minipage}{\titlepagewidth}
419 \hrule
420 \vspace{1.5mm}
421 \rmfamily\small
422 \makebox[\textwidth][l]{\maintitle\ \hfill Revision \input{REVISION}
423 [\input{DATE}\hspace{-.65ex}]}
424 \makebox[\textwidth][l]{Copyright \copyright\ 2008 Bert
425 Burgemeister\hfill\LaTeX\ source:
426 http://clqr.berlios.de}\\[1.5mm]
427 Permission is granted to copy, distribute and/or modify this
428 document under the terms of the GNU Free Documentation License,
429 Version 1.2 or any later version published by the Free Software
430 Foundation; with no Invariant Sections, no Front-Cover Texts and
431 no Back-Cover Texts.\hfill
432 http://www.gnu.org/licenses/fdl.html\\
433 \vspace{-1mm}
434 \hrule
435 \end{minipage}
436 \end{center}
437 \end{titlepage}
439 \end{document}
440 % -*-latex-*-