Fix bugs reported by Fengjing Xiao
[clqr.git] / clqr.tex
blobc8d2fe4ac54a211c6bb6d8ac430feed46d5a27a0
1 % Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2018
2 % Bert Burgemeister
4 % Permission is granted to copy, distribute and/or modify this
5 % document under the terms of the GNU Free Documentation License,
6 % Version 1.2; 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 %%%%%%%%%%%%%%%%%%
14 % pdf info
15 \newcommand{\SUBJECT}{Common\ Lisp}
16 \newcommand{\KEYWORDS}{{clqr cheatsheet lisp reference booklet}}
18 %%%%%%%%%%%%%%%%%%
19 % To be reset in paper-*.tex if there is plenty of room
20 \newcommand{\clearpagebeforeindex}{}
23 \documentclass[fontsize=8pt,DIV=24,BCOR=3mm,pagesize,twoside,
24 footinclude=false,headinclude=true,
25 footsepline=.25pt,headsepline=.25pt,
26 toc=flat]{scrartcl}
29 %%%%%%%%%%%%%%%%%%
30 % outsourced page dimensions
31 \input{paper-current}
32 %\setlength{\paperwidth}{10.5cm}
33 %\setlength{\paperheight}{29.7cm}
34 %\renewcommand{\clearpagebeforeindex}{\clearpage}
35 %%%%%%%%%%%%%%%%%%
37 \recalctypearea
39 %%%%%%%%%%%%%%%%%%
40 % outsourced hypertext colors
41 \input{color-current}
42 %\newcommand{\linkcolor}{Fuchsia}
43 %\newcommand{\urlcolor}{MidnightBlue}
44 %\newcommand{\bookmarks}{true}
45 %\newcommand{\pdfpagelayout}{TwoColumnLeft}
46 %%%%%%%%%%%%%%%%%%
48 \input{clqr.packages}
49 % should remain last usepackage:
50 \usepackage[%
51 breaklinks,linktocpage,colorlinks,%
52 bookmarksnumbered,bookmarks=\bookmarks,%
53 linkcolor=\linkcolor,urlcolor=\urlcolor,%
54 pdfpagelayout=\pdfpagelayout,%
55 pdftitle=\maintitle,pdfauthor=\AUTHOR,%
56 pdfsubject=\SUBJECT,pdfkeywords=\KEYWORDS]%
57 {hyperref}
59 \makeindex
61 \setkomafont{pageheadfoot}{\sffamily\mdseries\slshape}
62 \setkomafont{pagenumber}{\sffamily\mdseries\slshape}
63 \setkomafont{section}{\sffamily\mdseries\slshape\huge}
64 \setkomafont{subsection}{\sffamily\mdseries\slshape\Large}
66 \makeatletter
67 \renewcommand{\sectionlinesformat}[4]{%
68 \ifstr{#1}{section}{%
69 \parbox[t]{\linewidth}{%
70 \raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
71 \kern-1\ht\strutbox\rule{\linewidth}{.25pt}%
73 }{%
75 \ifstr{#1}{subsection}{%
76 \parbox[t]{\linewidth}{%
77 \raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
78 \kern-1\ht\strutbox\rule{\linewidth}{.25pt}%
80 }{%
81 \@hangfrom{\hskip #2#3}{#4}}}}%
83 \makeatother
85 \RedeclareSectionCommand[beforeskip=-2.5\baselineskip plus -1ex]{section}
86 \RedeclareSectionCommand[beforeskip=-2.5\baselineskip plus -1ex,afterskip=.4\baselineskip]{subsection}
87 \DeclareTOCStyleEntry[beforeskip=1.5ex plus 1pt]{tocline}{section}
88 \DeclareTOCStyleEntry[entryformat=\sffamily\mdseries,pagenumberformat=\sffamily\mdseries]{tocline}{subsection}
90 % Kill toc header as we want it to span columns
91 \deftocheading{toc}{}
93 \input{clqr.macros}
95 \pagestyle{scrheadings}
98 \begin{document}
101 \markboth{\sffamily\mdseries\slshape\maintitle}{\sffamily\mdseries\slshape\maintitle}
102 \newlength{\titlepagewidth}
103 \setlength{\titlepagewidth}{8cm}
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 %% Front Cover
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 \begin{titlepage}
108 \renewcommand{\rmdefault}{ptm} %% Always times fonts on title
109 \advance\oddsidemargin by 1.5mm
110 \vspace*{15mm}
111 \begin{center}
112 \begin{minipage}{\titlepagewidth}
113 \begin{center}
114 \rmfamily\mdseries\itshape\fontsize{20}{0}\selectfont
115 Quick Reference\index{CLQR}\\
116 \end{center}
117 \end{minipage}
118 \vfill
119 \begin{minipage}{\titlepagewidth}
120 \begin{center}
121 \rmfamily\mdseries\itshape%
122 \fontsize{300}{0}\selectfont{\color{frontcovergray}cl\/}\\
123 \end{center}
124 \end{minipage}
125 \vfill
126 \begin{minipage}{\titlepagewidth}
127 \rmfamily\mdseries\itshape\fontsize{36}{0}\selectfont
128 \hfill Common\/\\[2mm]
129 \rmfamily\mdseries\upshape\fontsize{157}{0}\selectfont
130 \rule[3mm]{\textwidth}{1.5mm}\\
131 lisp\\[-10mm]
132 \rule[15mm]{5.5cm}{1.5mm}\hfill\rule[15mm]{1.77cm}{1.5mm}
133 \end{minipage}\\
134 \begin{minipage}{\titlepagewidth}
135 \rmfamily\mdseries\upshape\fontsize{14}{0}\selectfont
136 \AUTHOR
137 \vspace*{4mm}
138 \end{minipage}
139 \end{center}
141 \end{titlepage}
143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 % TOC
145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 \section*{\contentsname}
147 \vspace{-3ex}
149 \setlength{\columnsep}{1.5em}%
150 \begin{multicols}{2}
151 \tableofcontents
152 \end{multicols}%
154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155 \vfill
156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 %%% CONTENT STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%
159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 \input{clqr-typographic-conventions}
162 \clearpage
163 \input{clqr-numbers}
164 \input{clqr-characters}
165 \input{clqr-strings}
166 \input{clqr-conses}
167 \input{clqr-arrays}
168 \input{clqr-sequences}
169 \input{clqr-hash-tables}
170 \input{clqr-structures}
171 \input{clqr-control-structure}
172 \input{clqr-clos}
173 \input{clqr-conditions-and-errors}
174 \input{clqr-types-and-classes}
175 \input{clqr-input-output}
176 \input{clqr-packages-and-symbols}
177 \input{clqr-compiler}
178 \input{clqr-external-environment}
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184 \clearpagebeforeindex % \clearpage dependent on paper size
186 \renewenvironment{theindex}%
187 {\begin{list}{}%
188 {\setlength{\itemindent}{-1em}\setlength{\leftmargin}{1em}}%
189 \parskip0pt plus .1pt \itemsep0pt%
190 \raggedright\looseness=-1%
192 {\end{list}}
193 \begin{multicols}{4}
194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195 [\section*{Index}\vspace{-3ex}]
196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
197 % Stock \printindex won't do as we want more than two columns.
198 \tiny\sffamily\mdseries\input{clqr.ind}
199 \end{multicols}
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203 % Make (total) page count a multiple of four.
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205 \clearpage
206 \pagestyle{empty}
207 \newcount\currentpage
208 \currentpage=\value{page}
209 \divide\currentpage by 4
210 \multiply\currentpage by 4
211 \advance\currentpage by -\value{page}
213 \ifnum\the\currentpage=-3
214 \rule{0pt}{0pt}\clearpage
215 \else\ifnum\the\currentpage=-2
216 \rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage
217 \else\ifnum\the\currentpage=-1
218 \rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage\rule{0pt}{0pt}\clearpage
219 \fi\fi\fi
221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
222 %% Back Cover
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
224 \begin{titlepage}
225 \advance\evensidemargin by -1.5mm
226 \begin{center}
227 \renewcommand{\rmdefault}{ptm} %% Always times fonts on title
228 \vspace*{20pt}
229 \vfill
230 \begin{minipage}{\titlepagewidth}
231 \begin{center}
232 \rmfamily\mdseries\itshape\fontsize{300}{0}\selectfont
233 \reflectbox{{\color{backcovergray}cl\/}}\\
234 \end{center}
235 \end{minipage}
236 \vfill
237 \vspace*{40.5mm}% Adjust here if text below changes
238 \begin{minipage}{\titlepagewidth}
239 \hrule
240 \vspace{1.5mm}
241 \rmfamily\small
242 \makebox[\textwidth][l]{\maintitle\
243 \hfill
244 Revision \input{REVISION}
245 [\input{DATE}\hspace{-.65ex}]}
246 \makebox[\textwidth][l]{Copyright \copyright\ 2008--2018
247 \AUTHOR\hfill}
248 \makebox[\textwidth][l]{\LaTeX\ source:
249 \href{http://clqr.boundp.org}{http://clqr.boundp.org}
250 \hfill
251 \raisebox{-1mm}[0mm][0mm]{\includegraphics[origin=c,height=5mm,keepaspectratio,angle=-40]{housefly.eps}}
252 }\\[1mm]
253 Permission is granted to copy, distribute and/or modify this
254 document under the terms of the GNU Free Documentation License,
255 Version 1.2; with no Invariant Sections, no Front-Cover Texts and
256 no Back-Cover Texts.\\
257 \href{http://www.gnu.org/licenses/fdl.html}{http://www.gnu.org/licenses/fdl.html}\\
258 \vspace{-1mm}
259 \hrule
260 \end{minipage}
261 \end{center}
262 \end{titlepage}
264 \end{document}
265 % -*-latex-*-
267 % LocalWords: ptm lightgray cl lispref theindex pt
269 %%% Local Variables:
270 %%% mode: latex
271 %%% TeX-master: t
272 %%% End: