-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
290 lines (233 loc) · 8.53 KB
/
preamble.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
287
288
289
290
\usepackage[intlimits]{amsmath}
\usepackage{amsfonts,amssymb}
\DeclareSymbolFontAlphabet{\mathbb}{AMSb}
\usepackage{natbib}
\usepackage{float}
\usepackage[bf]{caption}
\captionsetup{margin=0.5in}
\usepackage{fancyhdr}
%\usepackage{fancyheadings}
\usepackage{fancybox}
\usepackage{ifthen}
\usepackage{bu_ece_thesis}
\usepackage{url}
\usepackage{lscape,afterpage}
\usepackage{xspace}
\usepackage{epstopdf}
\usepackage{subfig}
\usepackage[figuresleft]{rotating}
% \usepackage{bigfoot}
% from lyx.
\usepackage{xcolor}
\usepackage{array}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{cancel}
\usepackage{listings}
\renewcommand{\lstlistingname}{Listing}
\usepackage{amsthm}
\usepackage{wasysym}
\usepackage{makecell}
\usepackage{datetime2}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
% \usepackage[printonlyused,withpage]{acronym}
\usepackage{acro}
% graphicx and pdf creation
\usepackage{graphicx}
\usepackage{appendix}
% keep text from breaking the margins
\sloppy
% % keep footnotes from splitting across pages?
% \interfootnotelinepenalty=10000
% some voodoo from https://tex.stackexchange.com/questions/2651/should-i-use-center-or-centering-for-figures-and-tables
\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}[chapter] % this is consitent with the figures at least
\theoremstyle{plain}
\newtheorem{lem}[thm]{\protect\lemmaname}
\theoremstyle{plain}
\newtheorem{fact}[thm]{\protect\factname}
\theoremstyle{plain}
\newtheorem{cor}[thm]{\protect\corollaryname}
\newlist{casenv}{enumerate}{4}
\setlist[casenv]{leftmargin=*,align=left,widest={iiii}}
\setlist[casenv,1]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
\setlist[casenv,2]{label={{\itshape\ \casename} \roman*.},ref=\roman*}
\setlist[casenv,3]{label={{\itshape\ \casename\ \alph*.}},ref=\alph*}
\setlist[casenv,4]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
\theoremstyle{definition}
\newtheorem{example}[thm]{\protect\examplename}
\theoremstyle{plain}
\newtheorem{conjecture}[thm]{\protect\conjecturename}
\theoremstyle{remark}
\newtheorem{claim}[thm]{\protect\claimname}
% why isn't this bold?
\usepackage{xcolor}
\usepackage{tikz-cd}
\tikzcdset{%
triple line/.code={\tikzset{%
double equal sign distance, % replace by double distance = 'measure'
double=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}},
quadruple line/.code={\tikzset{%
double equal sign distance, % replace by double distance = 'measure'
double=\pgfkeysvalueof{/tikz/commutative diagrams/background color}}},
Rrightarrow/.code={\tikzcdset{triple line}\pgfsetarrows{tikzcd implies cap-tikzcd implies}},
RRightarrow/.code={\tikzcdset{quadruple line}\pgfsetarrows{tikzcd implies cap-tikzcd implies}}
}
\newcommand*{\tarrow}[2][]{\arrow[Rrightarrow, #1]{#2}\arrow[dash, shorten >= 0.5pt, #1]{#2}}
\newcommand*{\tarrows}[2][]{\arrow[Rrightarrow, shorten >= 2.5pt, #1]{#2}\arrow[dash, shorten >= 3pt, #1]{#2}}
\newcommand*{\deqs}[2][]{\arrow[Rrightarrow, no head, #1]{#2}\arrow[dash, no head #1]{#2}}
\newcommand*{\qarrow}[2][]{\arrow[RRightarrow, #1]{#2}\arrow[equal, double distance = 0.25pt, shorten >= 1.28pt, #1]{#2}}
\makeatother
\usepackage{babel}
\providecommand{\conjecturename}{Conjecture}
\providecommand{\claimname}{Claim}
\providecommand{\casename}{Case}
\providecommand{\corollaryname}{Corollary}
\providecommand{\examplename}{Example}
\providecommand{\factname}{Fact}
\providecommand{\lemmaname}{Lemma}
\providecommand{\theoremname}{Theorem}
%TODO make these clickable
\newcommand{\Fref}[1]{Figure~\ref{fig:#1}}
\newcommand{\rulename}[1]{\ensuremath{\operatorname{#1}}}
\newcommand{\Blame}{\ensuremath{\textbf{Blame}}}
\newcommand{\blame}[3]{\ensuremath{#1\,\Blame{}_{#2,\,#3}}} % todo rename blame 3?
% as in \blame{a}{\ell}{o}
\newcommand{\Ch}[1]{Chapter #1} %TODO non breaking space
\newcommand{\ch}[1]{Chapter #1}
\newcommand{\ccnote}[1]{\todo[color=blue]{#1}} % responses to Chris's comments that I don't know that I want to completely change
\newcommand{\chp}{Chapter}
% TODO clickable link, chapter without number
% TODO also colon and spacing?
\newcommand{\tasys}{\vdash_{\mathrm{TAS}}}
% TODO delete?
\newcommand{\tasysr}{\vdash}
% constants that may need to be renamed/refonted...
% standardize use of terms
\newcommand{\Tit}{Type-in-type}
\newcommand{\tit}{type-in-type}
\newcommand{\bidir}{bidirectional}
\newcommand{\Bidir}{Bidirectional}
\newcommand{\cbv}{call-by-value}
\newcommand{\Cbv}{Call-by-value}
\newcommand{\CbV}{Call-by-Value} % for use in Headings
\newcommand{\whnf}{weak-head-normal-form}
\newcommand{\MartinL}{Martin-L{\"o}f}
\newcommand{\fullSp}{full spectrum}
% todo apply to prev chapters
% since spell check has issues with these
\newcommand{\scrut}{scrutinee}
\newcommand{\Scrut}{Scrutinee}
\newcommand{\scruts}{scrutinees}
\newcommand{\Sruts}{Scrutinees}
\newcommand{\slang}{surface language}
\newcommand{\Slang}{Surface language}
\newcommand{\SLang}{Surface Language} % for use in Headings
\newcommand{\clang}{cast language}
\newcommand{\Clang}{Cast language}
\newcommand{\CLang}{Cast Language}
\newcommand{\csys}{cast system}
\newcommand{\Csys}{Cast system}
\newcommand{\CSys}{Cast System} % for use in Headings
\newcommand{\case}{\ensuremath{\mathsf{case}}}
\newcommand{\maxRed}{\textbf{max}} % todo full replace
% standardize some fonts, captitalizarions
% also can take an optional number of params?
\newcommand{\Nat}{\ensuremath{\mathtt{Nat}}}
\newcommand{\Suc}{\ensuremath{\mathtt{S}}}
\newcommand{\Bool}{\ensuremath{\mathtt{Bool}}}
\newcommand{\True}{\ensuremath{\mathtt{True}}}
\newcommand{\False}{\ensuremath{\mathtt{False}}}
\newcommand{\Vect}{\ensuremath{\mathtt{Vec}}}
\newcommand{\Nil}{\ensuremath{\mathtt{Nil}}}
\newcommand{\Cons}{\ensuremath{\mathtt{Cons}}}
\newcommand{\Id}{\ensuremath{\mathtt{Id}}}
% \newcommand{\Refl}{\ensuremath{\mathtt{Refl}}}
% TODO could use texttt
% https://tex.stackexchange.com/questions/102483/subscript-and-superscript-in-lstlisting
\lstset{
mathescape,
literate={=>}{$\Rightarrow$}{3}
{->}{$\rightarrow$}{2}
}
% jargon
%TODO perhaps something that will handle capitalization and pluralization better?
% \newcommand{\slang}{surface language}
\acsetup{first-style=short}
\DeclareAcronym{TAS}{
short=TAS,
long=Type Assignment System
}
\DeclareAcronym{CC}{
short=CC,
long=Calculus of Constructions
}
\DeclareAcronym{ECC}{
short=ECC,
long=Extended Calculus of Constructions
}
\DeclareAcronym{ICC}{
short=ICC,
long=Implicit Calculus of Constructions
}
\DeclareAcronym{PTS}{
short=PTS,
long=Pure Type Systems
}
\DeclareAcronym{MLTT}{
short=MLTT,
long=Martin L{\"o}f Type Theory
}
\DeclareAcronym{ITT}{
short=ITT,
long=Intensional Type Theory % or intuitionistic?
}
\DeclareAcronym{ETT}{
short=ETT,
long=Extensional Type Theory
}
\DeclareAcronym{UTT}{
short=UTT,
long=Unified Type Theory
}
% TODO how should the acronym be capitalized
\DeclareAcronym{CIC}{
short=CIC,
long=Calculus of Inductive Constructions
}
% from https://tex.stackexchange.com/questions/277758/typesetting-a-calculus-grammar
% todo would need to figure out how to line up multiple grammars, and specify identifiers
\newenvironment{grammar}[2]
{\begin{tabular}{@{\qquad}>{$}l<{$}@{\qquad}l@{}}
\multicolumn{1}{@{}l@{}}{$#1$}&\multicolumn{1}{l@{}}{\hspace{-2em}#2}\\}
{\end{tabular}}
\renewcommand{\arraystretch}{1.2}
% TODO will probly need to do this on a case by case basis
%\usepackage{psfrag}
%\DeclareGraphicsExtensions{.eps} % extension for included graphics
%\usepackage{thumbpdf} % thumbnails for ps2pdf
%\usepackage[ps2pdf, % hyper-references for ps2pdf
%bookmarks=true,% % generate bookmarks ...
%bookmarksnumbered=true,% % ... with numbers
%hypertexnames=false,% % needed for correct links to figures !!!
%breaklinks=true,% % breaks lines, but links are very small
%linkbordercolor={0 0 1},% % blue frames around links
%pdfborder={0 0 112.0}]{hyperref}% % border-width of frames
% % will be multiplied with 0.009 by ps2pdf
%\hypersetup{
% pdfauthor = {Joe Graduate <[email protected]>},
% pdftitle = {dissertation.pdf},
% pdfsubject = {doctoral dissertations},
% pdfkeywords = {mathematics, science, technology},
% pdfcreator = {LaTeX with hyperref package},
% pdfproducer = {dvips + ps2pdf}
%}
% customized commands can be placed here
%\newcommand{\figref}[1]{Figure~\ref{#1}}
%\newcommand{\chapref}[1]{Chapter~\ref{#1}}
%\newcommand{\latex}{\LaTeX\xspace}