-
Notifications
You must be signed in to change notification settings - Fork 43
/
preamble.tex
108 lines (95 loc) · 3.08 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
\documentclass{article}
\usepackage{listings}
\usepackage{amsmath}
\usepackage{subfig}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mdwlist}
\usepackage{geometry}
\usepackage{titlesec}
\usepackage{palatino}
\usepackage{mathrsfs}
\usepackage{fancyhdr}
\usepackage{paralist}
\usepackage{todonotes}
\usepackage{tikz}
\usepackage{float} % Place figures where you ACTUALLY want it
\usepackage{comment} % A hack to toggle sections
\usepackage{ifthen}
\usepackage{mdframed}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{bbm}
\usepackage{upquote} % Prevents backticks replacing single-quotes in verbatim
\usepackage[strings]{underscore}
\usepackage[colorlinks=true]{hyperref}
\usetikzlibrary{positioning,shapes,backgrounds}
\geometry{margin=1in}
\geometry{headheight=2in}
\geometry{top=2in}
\setlength{\marginparwidth}{2.15cm}
\setlength{\parindent}{0em}
\setlength{\parskip}{0.6\baselineskip}
\rhead{}
\lhead{}
% Spacing settings.
\titlespacing\section{0pt}{12pt plus 2pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\renewcommand{\baselinestretch}{1.15}
% Shortcuts for commonly used operators.
\newcommand{\E}{\mathbb{E}}
\newcommand{\Var}{\operatorname{Var}}
\newcommand{\Cov}{\operatorname{Cov}}
\newcommand{\Bias}{\operatorname{Bias}}
\DeclareMathOperator{\argmin}{arg\,min}
\DeclareMathOperator{\argmax}{arg\,max}
% Do not number subsections and below.
\setcounter{secnumdepth}{1}
% Custom format subsection.
\titleformat*{\subsection}{\large\bfseries}
% Set up the problem environment.
\newcounter{problem}[section]
\newenvironment{problem}[1][]
{\begingroup
\setlength{\parskip}{0em}
\refstepcounter{problem}\par\addvspace{1em}\textbf{Problem~\Alph{problem}\!
\ifthenelse{\equal{#1}{}}{}{ [#1 points]}:}
\endgroup}
% Set up the subproblem environment.
\newcounter{subproblem}[problem]
\newenvironment{subproblem}[1][]
{\begingroup
\setlength{\parskip}{0em}
\refstepcounter{subproblem}\par\medskip\textbf{\roman{subproblem}.\!
\ifthenelse{\equal{#1}{}}{}{ [#1 points]:}}
\endgroup}
% Set up the teachers and materials commands.
\newcommand\teachers[1]
{\begingroup
\setlength{\parskip}{0em}
\vspace{0.3em} \textit{\hspace*{2em} TAs responsible: #1} \par
\endgroup}
\newcommand\materials[1]
{\begingroup
\setlength{\parskip}{0em}
\textit{\hspace*{2em} Relevant materials: #1} \par \vspace{1em}
\endgroup}
% Set up the hint environment.
\newenvironment{hint}[1][]
{\begin{em}\textbf{Hint: }}
{\end{em}}
% Set up the solution environment.
\ifshowsolutions
\newenvironment{solution}[1][]
{\par\medskip \begin{mdframed}\textbf{Solution~\Alph{problem}#1:} \begin{em}}
{\end{em}\medskip\end{mdframed}\medskip}
\newenvironment{subsolution}[1][]
{\par\medskip \begin{mdframed}\textbf{Solution~\Alph{problem}#1.\roman{subproblem}:} \begin{em}}
{\end{em}\medskip\end{mdframed}\medskip}
\else
\excludecomment{solution}
\excludecomment{subsolution}
\fi