-
Notifications
You must be signed in to change notification settings - Fork 1
/
commands.tex
286 lines (222 loc) · 8.34 KB
/
commands.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
% Macros for R^nRS.
\makeatletter
\newcommand{\topnewpage}{\@topnewpage}
\newcommand{\authorsc}[1]{{\scriptsize\scshape #1}}
% Chapters, sections, etc.
\newcommand{\extrapart}[1]{
% \chapter{#1}
\chapter*{#1}
\markboth{#1}{#1}
\vskip 1ex
\addcontentsline{toc}{chapter}{#1}}
\newcommand{\clearchapterstar}[1]{
\clearpage
\topnewpage[
\centerline{\large\bf\uppercase{#1}}
\bigskip]}
\newcommand{\clearextrapart}[1]{
\clearchapterstar{#1}
\markboth{#1}{#1}
\addcontentsline{toc}{chapter}{#1}}
\newcommand{\vest}{}
\newcommand{\dotsfoo}{$\ldots\,$}
\newcommand{\sharpfoo}[1]{{\tt\##1}}
\newcommand{\schfalse}{\sharpfoo{f}}
\newcommand{\schtrue}{\sharpfoo{t}}
\newcommand{\sharpfalse}{\sharpfoo{false}}
\newcommand{\sharptrue}{\sharpfoo{true}}
\newcommand{\singlequote}{{\tt'}} %\char19
\newcommand{\doublequote}{{\tt"}}
\newcommand{\backquote}{{\tt\char18}}
\newcommand{\backwhack}{{\tt\char`\\}}
\newcommand{\atsign}{{\tt\char`\@}}
\newcommand{\comma}{{\tt\char`\,}}
\newcommand{\commaatsign}{{\tt\char`\,}{\tt\char`\@}}
\newcommand{\sharpsign}{{\tt\#}}
\newcommand{\verticalbar}{{\tt|}}
\newcommand{\coerce}{\discretionary{->}{}{->}}
% Knuth's \in sucks big boulders
\def\elem{\hbox{\raise.13ex\hbox{$\scriptstyle\in$}}}
\newcommand{\meta}[1]{{\noindent\hbox{\rm$\langle$#1$\rangle$}}}
\let\hyper=\meta
\newcommand{\hyperi}[1]{\hyper{#1$_1$}}
\newcommand{\hyperii}[1]{\hyper{#1$_2$}}
\newcommand{\hyperj}[1]{\hyper{#1$_i$}}
\newcommand{\hypern}[1]{\hyper{#1$_n$}}
\newcommand{\var}[1]{\noindent\hbox{\it{}#1\/}} % Careful, is \/ always the right thing?
\newcommand{\vari}[1]{\var{#1$_1$}}
\newcommand{\varii}[1]{\var{#1$_2$}}
\newcommand{\variii}[1]{\var{#1$_3$}}
\newcommand{\variv}[1]{\var{#1$_4$}}
\newcommand{\varj}[1]{\var{#1$_j$}}
\newcommand{\varn}[1]{\var{#1$_n$}}
\newcommand{\vr}[1]{{\noindent\hbox{$#1$\/}}} % Careful, is \/ always the right thing?
\newcommand{\vri}[1]{\vr{#1_1}}
\newcommand{\vrii}[1]{\vr{#1_2}}
\newcommand{\vriii}[1]{\vr{#1_3}}
\newcommand{\vriv}[1]{\vr{#1_4}}
\newcommand{\vrv}[1]{\vr{#1_5}}
\newcommand{\vrj}[1]{\vr{#1_j}}
\newcommand{\vrn}[1]{\vr{#1_n}}
\newcommand{\defining}[1]{\mainindex{#1}{\em #1}}
\newcommand{\ide}[1]{{\schindex{#1}\frenchspacing\tt{#1}}}
\newcommand{\lambdaexp}{{\cf lambda} expression}
\newcommand{\Lambdaexp}{{\cf Lambda} expression}
\newcommand{\callcc}{{\tt call-with-current-continuation}}
% \reallyindex{SORTKEY}{HEADCS}{TYPE}
% writes (index-entry "SORTKEY" "HEADCS" TYPE PAGENUMBER)
% which becomes \item \HEADCS{SORTKEY} mainpagenumber ; auxpagenumber ...
%\global\def\reallyindex#1#2#3{%
%\write\@indexfile{"#1" "#2" #3 \thepage}}
\newcommand{\mainschindex}[1]{\label{#1}\index{#1@\tt{#1}}}%main
\newcommand{\mainindex}[1]{\index{#1@\rm{#1}}}%main
\newcommand{\schindex}[1]{\index{#1@\tt{#1}}}%aux
\newcommand{\sharpindex}[1]{\index{#1@\sharpfoo #1}}%aux
\newcommand{\sharpbangindex}[1]{\index{#1@\texttt{\#!#1}}}
%\renewcommand{\index}[1]{\reallyindex{#1}{rm}{aux}}
%\newcommand{\mainschindex}[1]{\label{#1}\index{\tt #1}{tt}}
%\newcommand{\mainindex}[1]{\index{\rm #1}}
%\newcommand{\schindex}[1]{\index{\tt #1}}
%\newcommand{\sharpindex}[1]{\index{#1}}
%\newcommand{\sharpbangindex}[1]{\index{#1@\texttt{\#!#1}}}
%\renewcommand{\index}[1]{\reallyindex{#1}{rm}{aux}}
\newcommand{\domain}[1]{{\small\noindent #1}
}
\newcommand{\nodomain}[1]{}
\newcommand{\todo}[1]{}
% \frobq will make quote and backquote look nicer.
\def\frobqcats{%\catcode`\'=13
\catcode`\`=13{}}
{\frobqcats
\gdef\frobqdefs{%\def'{\singlequote}
\def`{\backquote}}}
\def\frobq{\frobqcats\frobqdefs}
% \cf = code font
% Unfortunately, \cf \cf won't work at all, so don't even attempt to
% nest constructions which use them...
\newcommand{\cf}{\frenchspacing\frobq\tt}
% Same as \obeycr, but doesn't do a \@gobblecr.
{\catcode`\^^M=13 \gdef\myobeycr{\catcode`\^^M=13 \def^^M{\\}}%
\gdef\restorecr{\catcode`\^^M=5 }}
{\catcode`\^^I=13 \gdef\obeytabs{\catcode`\^^I=13 \def^^I{\hbox{\hskip 4em}}}}
{\obeyspaces\gdef {\hbox{\hskip0.5em}}}
\gdef\gobblecr{\@gobblecr}
\def\setupcode{\@makeother\^}
% Scheme example environment
% At 11 points, one column, these are about 56 characters wide.
% That's 32 characters to the left of the => and about 20 to the right.
\newenvironment{schemenoindent}{
% Commands for scheme examples
\newcommand{\ev}{\>\>\evalsto}
\newcommand{\lev}{\\\>\evalsto}
\newcommand{\unspecified}{{\em{}unspecified}}
\newcommand{\scherror}{{\em{}error}}
\setupcode
\small \cf \obeytabs \obeyspaces \myobeycr
\begin{tabbing}%
\qquad\=\hspace*{5em}\=\hspace*{9em}\=\kill% was 16em
\gobblecr}{\unskip\end{tabbing}}
\newenvironment{scheme}{
% Commands for scheme examples
\newcommand{\ev}{\>\>\evalsto}
\newcommand{\lev}{\\\>\evalsto}
\renewcommand{\em}{\rmfamily\itshape}
\newcommand{\unspecified}{{\em{}unspecified}}
\newcommand{\scherror}{{\em{}error}}
\setupcode
\small \cf \obeyspaces \myobeycr
\begin{tabbing}%
\qquad\=\hspace*{5em}\=\hspace*{9em}\=\+\kill% was 16em
\gobblecr}{\unskip\end{tabbing}}
\newcommand{\evalsto}{$\Longrightarrow$}
% Rationale
\newenvironment{rationale}{%
\bgroup\small\noindent{\em Rationale:}\space}{%
\egroup}
% Notes
\newenvironment{note}{%
\bgroup\small\noindent{\em Note:}\space}{%
\egroup}
% Manual entries
\newenvironment{entry}[1]{
\vspace{3.1ex plus .5ex minus .3ex}\noindent#1%
\unpenalty\nopagebreak}{\vspace{0ex plus 1ex minus 1ex}}
\newcommand{\exprtype}{syntax}
\newcommand{\auxiliarytype}{auxiliary syntax}
% Primitive prototype
\newcommand{\pproto}[2]{\unskip%
\hbox{\cf\spaceskip=0.5em#1}\hfill\penalty 0%
\hbox{ }\nobreak\hfill\hbox{\rm #2}\break}
% Parenthesized prototype
\newcommand{\proto}[3]{\pproto{(\mainschindex{#1}\hbox{#1}{\it#2\/})}{#3}}
% Variable prototype
\newcommand{\vproto}[2]{\mainschindex{#1}\pproto{#1}{#2}}
% Extending an existing definition (\proto without the index entry)
\newcommand{\rproto}[3]{\pproto{(\hbox{#1}{\it#2\/})}{#3}}
% Grammar environment
\newenvironment{grammar}{
\def\:{\goesto{}}
\def\|{$\vert$}
\cf \myobeycr
\begin{tabbing}
%\qquad\quad \=
\qquad \= $\vert$ \= \kill
}{\unskip\end{tabbing}}
\newcommand{\unsection}{{\vskip -2ex}}
% Commands for grammars
\newcommand{\arbno}[1]{#1\hbox{\rm*}}
\newcommand{\atleastone}[1]{#1\hbox{$^+$}}
\newcommand{\goesto}{$\longrightarrow$}
% Feature identifiers
\newcommand{\feature}[2]{
\vskip 1em
\hbox{\hfil\cf #1}
\parindent=2em\par{#2}}
% Scheme reports
\newcommand{\rnrs}[1]{R$^{#1}$RS}
\newcommand{\rthreers}{\rnrs 3}
\newcommand{\rfourrs}{\rnrs 4}
\newcommand{\rfivers}{\rnrs 5}
\newcommand{\rsixrs}{\rnrs 6}
\newcommand{\rsevenrs}{\rnrs 7}
% The index
\def\theindex{%\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\clearpage
\@topnewpage[
\centerline{\large\bf\uppercase{Alphabetic index of definitions of concepts,}}
\centerline{\large\bf\uppercase{keywords, and procedures}}
\vskip 1ex \bigskip]
\markboth{Index}{Index}
\phantomsection
\addcontentsline{toc}{chapter}{Alphabetic index of
definitions of concepts,\hfil\penalty0 \hbox{\hspace*{2em} keywords, and procedures}}
\bgroup %\small
\parindent\z@
\parskip\z@ plus .1pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{%\if@restonecol\onecolumn\else\clearpage\fi
\egroup}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
\makeatother
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\newenvironment{DIFnomarkup}{}{}