-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathpreamble.sty
More file actions
151 lines (131 loc) · 4.39 KB
/
preamble.sty
File metadata and controls
151 lines (131 loc) · 4.39 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
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
\usepackage{natbib}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{mathtools,amsthm,amssymb}
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{nicefrac}
\usepackage[colorlinks=true]{hyperref}
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage{manfnt} %for the dangerous bend
\usepackage{fontawesome} % for the linux hint symbol
\newcommand{\hintsymbol}{\marginpar{\center{\faLinux}}}
\newcommand{\tbdsymbol}{\marginpar{\center{\dbend}}}
\newcommand{\recallsymbol}{\marginpar{\center{\bomb}}}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,positioning,arrows.meta}
\usetikzlibrary{decorations.markings}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots}
% \usepackage{fancyhdr}
% \pagestyle{fancy}
% \fancyhead{} % clear all header fields
% \fancyhead[LO, LE]{\rightmark}
% \fancyfoot{} % clear all footer fields
% \fancyfoot[C]{\thepage}
% \setlength{\headheight}{14pt}
\usepackage{xcolor}
\usepackage{cprotect}
\usepackage{listings}
\lstdefinestyle{customc}{
belowcaptionskip=1\baselineskip,
breaklines=true,
%frame=L,
%xleftmargin=\parindent,
language=Python,
showstringspaces=false,
basicstyle=\footnotesize\ttfamily,
keywordstyle=\bfseries\color{green!40!black},
commentstyle=\itshape\color{purple!40!black},
identifierstyle=\color{blue},
stringstyle=\color{orange},
morekeywords={lambda},
tabsize=4,
formfeed=newpage
}
\lstset{style=customc}
\usepackage{exsheets}
\DeclareQuestionProperty{hint}
\SetupExSheets{
headings = runin,
question/print = true,
solution/print = false,
counter-format = ch.se.qu,
counter-within = section
}
% Get question references ok.
\renewcommand\thequestion{\thesection.\arabic{question}}
\setlist[enumerate,1]{label=\alph*),ref=\thequestion\alph*)}
% a command to print all given hints
\NewDocumentCommand\printquestionhints{}{%
\ForEachQuestion
{%
\IfQuestionPropertyT{hint}{##1}{%
\ExSheetsHeading
{runin} % headings style
{Hint} % heading
{\QuestionNumber{##1}}% number
{0} % points -- need to be zero here
{0} % bonus points -- need to be zero here
{##1}% % ID
\GetQuestionProperty{hint}{##1}%
\par
\medskip
}%
}%
}
\newcommand{\hint}[1]{\hintsymbol\SetQuestionProperties{ hint = {#1}}}
\theoremstyle{definition} % font type for theorems and related environments
\newtheorem{theorem}{Theorem}[section]
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newcommand*{\fullref}[1]{\hyperref[{#1}]{\autoref*{#1} \nameref*{#1}}} % One single link
\newcommand{\tbd}{\tbdsymbol}
\newcommand{\TBD}{\tbdsymbol}
\newcommand{\argmin}{\operatornamewithlimits{argmin}}
\newcommand{\argmax}{\operatornamewithlimits{arg\,max}}
\newcommand{\alt}[2]{\underline{#1}\marginpar{#2}}
\newcommand{\B}{\mathbb{B}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Nn}{\mathbb{N}_{0}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\p}{\mathbb{P}}
\newcommand{\abs}[1]{\left\vert#1\right\vert}
\newcommand{\given}{\,\middle|\,}
\renewcommand{\P}[1]{\,\mathbb{P}\left\{#1\right\}}
\newcommand{\V}[1]{\,\mathbb{V}\left\{#1\right\}}
\newcommand{\var}{\ensuremath{\textrm{Var}}}
\newcommand{\PP}[2]{\,\mathbb{P}_{#1}\left\{#2\right\}}
%\newcommand{\E}[1]{\,\mathbb{E}\left[#1\right]}
\newcommand{\E}[1]{\,\mathbb{E}\left\{#1\right\}}
\newcommand{\EE}[2]{\,\mathbb{E}_{#1}\left\{#2\right\}}
\renewcommand{\d}[1]{\,\text{d}#1}
\newcommand{\1}[1]{\,\mathbb{1}_{#1}} % indicator
\newcommand{\2}[2]{\,\mathbb{1}_{#1}\left(#2\right)} % indicator
%\newcommand{\1}[1]{\,\left[#1\right]} % iverson's notation
%\newcommand{\2}[2]{\,\left[#2\right]\left(#1\right)} % indicator
\newcommand{\wip}{\text{WIP}}
\newcommand{\WIP}{\text{WIP}}
\newcommand{\ct}{\text{CT}}
\newcommand{\CT}{\text{CT}}
\renewcommand{\TH}{\text{TH}}
\renewcommand{\th}{\text{TH}}
\newcommand{\scv}{\text{SCV}}
\newcommand{\recall}[1]{\emph{#1}\recallsymbol}
\newcommand{\nvf}[1]{\tbdsymbol}
\setcounter{tocdepth}{1}
% handle indentation below figure captions
%\setcapwidth[c]{.8\textwidth}
\setcapwidth{0.95\textwidth}
\setcapindent{0pt}
%\addtokomafont{caption}{\centering}
\graphicspath{{figures/}}