-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathpreamble.tex
More file actions
111 lines (90 loc) · 3.42 KB
/
preamble.tex
File metadata and controls
111 lines (90 loc) · 3.42 KB
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
\usepackage[UKenglish]{babel}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage[colorlinks]{hyperref}
\usepackage[dvipsnames]{xcolor}
\usepackage{ amssymb, dsfont }
\usepackage{tikz}
\usepackage{dsfont}
\usepackage{mathrsfs}
\hypersetup{
linkcolor = Magenta,
citecolor = Aquamarine,
urlcolor = Periwinkle,
linktoc = page
}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{amsmath,amssymb,bm}
\usepackage{enumitem}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{minted} % Code embedding in document
\usepackage[none]{hyphenat}
\usepackage{mathtools}
\usepackage{verbatim}
\usepackage[export]{adjustbox}
\makeatletter
\newcommand\RedeclareMathOperator{%
\@ifstar{\def\rmo@s{m}\rmo@redeclare}{\def\rmo@s{o}\rmo@redeclare}%
}
% this is taken from \renew@command
\newcommand\rmo@redeclare[2]{%
\begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup
\expandafter\@ifundefined\@gtempa
{\@latex@error{\noexpand#1undefined}\@ehc}%
\relax
\expandafter\rmo@declmathop\rmo@s{#1}{#2}}
% This is just \@declmathop without \@ifdefinable
\newcommand\rmo@declmathop[3]{%
\DeclareRobustCommand{#2}{\qopname\newmcodes@#1{#3}}%
}
\@onlypreamble\RedeclareMathOperator
\makeatother
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\DeclareMathOperator*{\argmax}{arg\,max} % in your preamble
\DeclareMathOperator*{\argmin}{arg\,min} % in your preamble
\usepackage[nameinlink,noabbrev]{cleveref}
\newcommand*{\fullref}[1]{\hyperref[{#1}]{\Cref*{#1} -- \nameref*{#1}}}
% multiline comment
\renewcommand{\comment}[1]{}
% Number sets
\newcommand{\N}{\mathbb{N}} % Natural Numbers
\newcommand{\Z}{\mathbb{Z}} % Integers
\newcommand{\Q}{\mathbb{Q}} % Quotient
\newcommand{\R}{\mathbb{R}} % Real Numbers
\newcommand{\C}{\mathbb{C}} % Complex Numbers
% Probability
\newcommand{\freq}[1]{\text{Freq}\left(#1\right)} % Frequency
\newcommand{\pr}[1]{\mathbb{P}\left(#1\right)} % Probability
\newcommand{\expectation}[1]{\mathbb{E}_{#1}}
\newcommand{\E}[2][]{\expectation{#1}\left[#2\right]} % Expectation
\newcommand{\var}[1]{\mathbb{V}{\left(#1\right)}} % Variance
\newcommand{\cov}[1]{\text{Cov}{\left(#1\right)}} % Covariance
\newcommand{\corr}[1]{\rho{\left(#1\right)}} % Correlation
% Probability Distributions
\newcommand{\dber}[1]{\mathrm{Bern}(#1)} %Bernoulli
\newcommand{\dbeta}[1]{\mathrm{Beta}(#1)} %Beta
\newcommand{\dbin}[1]{\mathrm{Bin}(#1)} %Binomial
\newcommand{\dpoi}[1]{\mathrm{Poi}(#1)} %Poisson
\newcommand{\ddir}[1]{\mathrm{Dir}(#1)} %Dirichlet
\newcommand{\dgamma}[1]{\mathrm{Gam}(#1)} %Gamma
\newcommand{\dnorm}[1]{\mathcal{N}(#1)} %Normal/Gaussian
\newcommand{\dst}[1]{\mathrm{St}(#1)} %Student t
\newcommand{\duni}[1]{\mathrm{U}(#1)} %Uniform
\newcommand{\dwis}[1]{\mathcal{W}(#1)} %Wishart
% Linear Algebra
\newcommand{\vect}[1]{\bm{#1}} % vectors
\newcommand{\matr}[1]{\bm{#1}} % matrices and tensors
\newcommand{\tr}[1]{#1^{\top}} % transpose
\renewcommand{\sp}[2]{#1^{\top}#2} %scalar product
% Analysis
\let\dbar\d \renewcommand{\d}{\mathrm{d}}
\newcommand{\D}{\,\mathrm{d}} % differential
\newcommand{\deriv}[2]{\frac{\d #1}{\d #2}} % derivative
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} % partial derivative
\newcommand{\set}[1]{\left\lbrace #1 \right\rbrace} % set
\newcommand{\where}{\ \middle\vert\;} % where
\newcommand{\abs}[1]{\left\vert #1 \right\vert} % absolute value
\newcommand{\norm}[2][]{{\left\Vert #2 \right\Vert}_{#1}} % norm