-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tex
255 lines (222 loc) · 12.4 KB
/
main.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
\title{Quake III DeFRaG Physics}
\author{}
\date{\today}
\documentclass[10pt]{article}
\usepackage[a4paper,margin=27.5mm]{geometry}
\usepackage[english]{babel}
\usepackage{appendix}
\usepackage[nottoc]{tocbibind} % add bibliography to toc
\usepackage{mathtools} % updates and extends amsmath
\usepackage{amssymb} % blacksquare
\usepackage{siunitx} % units
\usepackage[normalem]{ulem} % uline
\usepackage{cases} % for numcases environment
\usepackage{fontspec}
% https://tex.stackexchange.com/questions/570548/suppress-warning-by-unicode-math-regarding-mathtools
\usepackage[bold-style=ISO]{unicode-math} % ISO keeps italic, symbb, symbf
\setmainfont{Erewhon}
\setmathfont{Erewhon Math}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18} % latest version on 2021-12-25
\usepackage{subcaption} % subfigure
\usepackage[pdfusetitle,colorlinks=true]{hyperref} % recommended to load last
\usepackage[all]{tcolorbox} % listing (requires hyperref)
\usepgfplotslibrary{fillbetween} % lets you fill area between curves
\usepgfplotslibrary{external}
\usetikzlibrary{
3d, % plot 3D shapes
arrows.meta, % arrow tip library
calc, % allows advanced coordinate calculations
decorations.pathreplacing, % replace to-be-decorated path by another path
patterns, % patterns for filling areas
spy, % magnified area
}
\tikzexternalize
\newcommand*{\includetikz}[1]{
\tikzsetnextfilename{#1} % changes filename of next externalized figure
\input{#1.tikz}
}
\pgfdeclarepatternformonly{north east lines wide}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{10pt}{10pt}}{\pgfqpoint{9pt}{9pt}}%
{
\pgfsetlinewidth{0.4pt}
\pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
\pgfpathlineto{\pgfqpoint{9.1pt}{9.1pt}}
\pgfusepath{stroke}
}
\tikzset{
body/.style={inner sep=0pt,outer sep=0pt,shape=rectangle,draw,thick,pattern=north east lines wide},
dimen/.style={<->,>=latex,thin,every rectangle node/.style={fill=white,midway}},
symmetry/.style={dashed,thin},
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\inserteqstrut}[1]{%
\rlap{$\displaystyle#1$}%
\phantom{\biggesteq}}
\newcommand*{\inserteqstrutt}[1]{%
\rlap{$\displaystyle#1$}%
\phantom{\biggesteqq}}
\newlength{\letterwidth}
\newcommand*{\mathmakeboxlargestof}[3]{%
% #1 = first symbol
% #2 = second symbol
% #3 = what is printed
\setlength{\letterwidth}{\maxof{\widthof{$#1$}}{\widthof{$#2$}}}%
\mathmakebox[\letterwidth]{\vphantom{#1}\vphantom{#2}#3}%
}
\newcommand*{\lcr}[3]{%
\mathmakebox[\textwidth][s]{\mathrlap{#1}\hfill#2\hfill\mathllap{#3}}%
}
% vertical centering of inline tikz with [baseline=-\the\dimexpr\fontdimen22\textfont2\relax]
% https://tex.stackexchange.com/questions/59658/use-of-tikzpicture-matrix-in-align-or-gather-environment/59660#comment126261_59660
\DeclareRobustCommand{\blueline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor1,solid,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\bluedash}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor1,dashed,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\orangeline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor2,solid,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\greyline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor0,solid,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\greenline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor5,solid,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\blackline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[black,solid,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\thickblueline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor1,solid,line width=2.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\thickCPMorangeline}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor2,solid,line width=2.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\greydash}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[mycolor0,dashed,line width=1.0pt](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\yellowdenselydottedarrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor3,densely dotted,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\bluearrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor1,solid,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\orangearrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor2,solid,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\yellowarrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor3,solid,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\purplearrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor4,solid,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\greenarrow}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]{\draw[->,mycolor5,solid,very thick](0,0) -- (5mm,0);}\tikzexternalenable}
\DeclareRobustCommand{\greyarea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor0!10,draw=mycolor0] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\bluearea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor1!40,draw=black!40!mycolor1] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\orangearea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor2!40,draw=black!40!mycolor2] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\greenarea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor5!40,draw=black!40!mycolor5] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\darkbluearea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor1,draw=black] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\lightorangearea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor2!10,draw=mycolor2] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\darkorangearea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor2,draw=black] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclareRobustCommand{\darkgreyarea}{\tikzexternaldisable\tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax+1.25mm]{\draw[fill=mycolor0!60,draw=mycolor0] (0mm, 0mm) rectangle (5mm, 2.5mm);}\tikzexternalenable}
\DeclarePairedDelimiter{\round}\lfloor\rceil % https://tex.stackexchange.com/questions/433101/rounding-to-nearest-integer-symbol-in-latex/433108#433108
\DeclarePairedDelimiter{\floor}\lfloor\rfloor % old: \newcommand*{\round}[1]{\ensuremath{\left\lfloor#1\right\rceil}}
\DeclarePairedDelimiter{\ceil}\lceil\rceil
\DeclarePairedDelimiter{\abs}\lvert\rvert
\DeclarePairedDelimiter{\norm}\lVert\rVert
\DeclarePairedDelimiter{\set}\{\}
\newcommand{\diff}{d}
\renewcommand*{\vec}[1]{\symbf{#1}}
\newcommand*{\nuvec}[1]{\vec{\hat{#1}}} % "normal" unit vector
\newcommand*{\wuvec}[1]{\vec{\widehat{#1}}} % "wide-hat" unit vector
\newcommand*{\uvec}{\@ifstar\wuvec\nuvec}
\newcommand*{\tvec}[1]{\boldsymbol{#1}} % "text" vector, allows things like \fmove to be bolded
\newcommand*{\tnuvec}[1]{\tvec{\hat{#1}}} % text normal unit vector
\newcommand*{\twuvec}[1]{\tvec{\widehat{#1}}} % text wide-hat unit vector
\newcommand*{\tuvec}{\@ifstar\twuvec\tnuvec}
%\renewcommand{\vec}{\@ifstar\boldsymbol\symbf} % lets bold work on fm,rm,etc. if * used. can't combine with \uvec* though
\newcommand*{\conj}[1]{\overline{#1}}
\newcommand*{\mat}[1]{\symbf{#1}}
\newcommand*{\projmat}[1]{\mat{P}_{\vec{#1}}}
\newcommand*{\resprojmat}[1]{\mat{M}_{\vec{#1}}}
\makeatletter
\newcommand*{\inlinemat}[2][~]{%
\left(%
\def\nextitem{\def\nextitem{#1}}%
\@for \el:=#2\do{\nextitem\el}%
\right)%
}
\makeatother
\AtBeginDocument{\renewcommand*{\flat}[1]{\uline{#1}}} % overwrite macro from unicode-math
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\acos}{acos}
\DeclareMathOperator{\asin}{asin}
\DeclareMathOperator{\atan}{atan}
\DeclareMathOperator{\opt}{opt}
\DeclareMathOperator{\proper}{proper}
\DeclareMathOperator{\new}{new}
\DeclareMathOperator{\maxphi}{max\_phi}
\DeclareMathOperator{\yaw}{yaw}
\DeclareMathOperator{\cmd}{cmd}
\DeclareMathOperator{\fmove}{fm}
\DeclareMathOperator{\rmove}{rm}
\DeclareMathOperator{\umove}{um}
\DeclareMathOperator{\fumove}{fum}
\DeclareMathOperator{\frmove}{frm}
\newlength\figureheight
\newlength\figurewidth
\definecolor{mycolor0}{rgb}{.4,.4,.4}%
\definecolor{mycolor1}{rgb}{0.00000,0.44700,0.74100}%
\definecolor{mycolor2}{rgb}{0.85000,0.32500,0.09800}%
\definecolor{mycolor3}{rgb}{0.92900,0.69400,0.12500}%
\definecolor{mycolor4}{rgb}{0.49400,0.18400,0.55600}%
\definecolor{mycolor5}{rgb}{0.46600,0.67400,0.18800}%
\definecolor{cgazgreen}{rgb}{0,1,0}%
\definecolor{cgazdarkgreen}{rgb}{0,0.25,0.25}%
\definecolor{cgazyellow}{rgb}{1,1,0}%
\definecolor{cgazgrey}{rgb}{0.25,0.25,0.25}%
\newcommand*{\highlightcgazgreen}[1]{\colorbox{cgazgreen!50}{$\displaystyle#1$}}
\newcommand*{\highlightcgazdarkgreen}[1]{\colorbox{cgazdarkgreen!50}{$\displaystyle#1$}}
\newcommand*{\highlightcgazyellow}[1]{\colorbox{cgazyellow!50}{$\displaystyle#1$}}
\newcommand*{\highlightcgazgrey}[1]{\colorbox{cgazgrey!50}{$\displaystyle#1$}}
\definecolor{bgcolor}{rgb}{0.047058824,0.047058824,0.058823529}
\definecolor{commentcolor}{rgb}{0.364705882,0.352941176,0.4}
\definecolor{fgcolor}{rgb}{0.541176471,0.541176471,0.576470588}
\definecolor{identifiercolor}{rgb}{0.266666667,0.635294118,0.862745098}
\definecolor{keywordcolor}{rgb}{0.764705882,0.231372549,0.270588235}
\definecolor{stringcolor}{rgb}{0.792156863,0.623529412,0.37254902}
% https://tex.stackexchange.com/questions/20890/define-an-escape-underscore-environment
\makeatletter
\DeclareRobustCommand*{\escapeus}[1]{%
\begingroup\@activeus\scantokens{#1\endinput}\endgroup}
\begingroup\lccode`\~=`\_\relax
\lowercase{\endgroup\def\@activeus{\catcode`\_=\active \let~\_}}
\makeatother
% https://tex.stackexchange.com/questions/486102/problems-with-tcolorbox-and-tikz-external
%\tcbset{shield externalize}
\tcbsetforeverylayer{shield externalize}% <--- interim solution before bug fix
\renewcommand{\theFancyVerbLine}{\ttfamily \textcolor[rgb]{0,0,0}{\scriptsize \arabic{FancyVerbLine}}}
\newtcbinputlisting[]{\codeFromFile}[3][]{%
listing engine=minted,
listing file={#3},
listing only,
listing remove caption=false,
minted language=C,
colframe=mycolor0!30,
colback=mycolor0!10,
borderline west={8mm}{-4mm}{mycolor0!30},
breakable,
enhanced,
top=0mm,
bottom=0mm,
before skip=.75\baselineskip,
after skip=.75\baselineskip,
attach boxed title to bottom center={yshift=-.75\baselineskip},
minipage boxed title,
boxed title style={blanker},
title={\captionof{listing}{Code snippet from \href{https://github.com/id-Software/Quake-III-Arena/blob/master/#3}{\texttt{\escapeus{#3}}}.}}, % TODO: URL with line range
minted options={
%frame=single,
%rulecolor=\color{mycolor0!10},
fontsize=\footnotesize,
linenos=true,
stripall=true,
numbersep=2mm,
#2},
arc=0pt,
outer arc=0pt,
boxrule=1pt,
#1}
\begin{document}
\maketitle
\tableofcontents
\include{sections/fundamentals}
\include{sections/cgaz}
\include{sections/snap}
\include{sections/misc}
\include{sections/CPM}
\include{sections/weapons}
\include{sections/ranking}
\include{sections/TODO}
\begin{appendices}
\include{appendices/definitions}
\include{appendices/code}
\include{appendices/derivations}
\include{appendices/fov}
\end{appendices}
\bibliographystyle{alpha}
\bibliography{references}
\end{document}