forked from penlu/cs281-scribe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pagesetup.sty
182 lines (157 loc) · 4.78 KB
/
pagesetup.sty
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
\usepackage{amsfonts,graphicx}
\usepackage{amsfonts,latexsym,amsthm,amssymb,amsmath,euscript}
\usepackage{mathrsfs,manfnt,enumitem,stmaryrd}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage{graphics}
\usepackage{placeins}
\usepackage{tikz}
\usetikzlibrary{bayesnet}
\usetikzlibrary{calc, arrows.meta, positioning}
% Use these for theorems, lemmas, proofs, etc.
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{postulate}[theorem]{Postulate}
\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newtheorem*{notation}{Notation}
\newtheorem*{note}{Note}
\newtheorem{exercise}{Exercise}
% \newcommand{\exinline}[1]{(\refstepcounter{exercise}Exercise~\theexercise\label{#1})}
% since we're using the custom \lecture definition, we want to recenter around that
\setcounter{tocdepth}{1}
\newcounter{lecnum}
\renewcommand{\thesubsection}{\thelecnum.\arabic{subsection}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}
% the following macro is used to generate the header.
\newcommand{\lecture}[5]{
\addcontentsline{toc}{section}{#5}
\thispagestyle{plain}
\newpage
\setcounter{lecnum}{#1}
\setcounter{subsection}{0}
\setcounter{exercise}{0}
% \renewcounter{exercise}[lecnum] % Reset counter every chapter
\renewcommand{\theexercise}{\thelecnum.\arabic{exercise}}%
\noindent
\begin{center}
\framebox{
\vbox{\vspace{2mm}
\hbox to 6.28in { {\bf CS281: Advanced ML
\hfill #2, 2017} }
\vspace{4mm}
\hbox to 6.28in { {\Large \hfill Lecture #1: #5 \hfill} }
\vspace{2mm}
\hbox to 6.28in { {\it Lecturer: #3 \hfill Scribes: #4} }
\vspace{2mm}}
}
\end{center}
\markboth{Lecture #1: #5}{Lecture #1: #5}
}
%Use this command for a figure; it puts a figure in wherever you want it.
%usage: \fig{NUMBER}{SPACE-IN-INCHES}{CAPTION}
\newcommand{\fig}[3]{
\vspace{#2}
\begin{center}
Figure \thelecnum.#1:~#3
\end{center}
}
%
% Put custom commands for lectures here
%
\newcommand{\E}{\mathbb{E}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\cov}{\text{cov}}
\renewcommand{\v}[1]{\boldsymbol{#1}}
\newcommand{\on}{\operatorname}
\newcommand{\N}{\mathcal{N}}
% \newcommand{\exp}{\on{exp}}
\setlength{\parindent}{0em}
\usepackage{tikz}
\def\checkmark{\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}
\def\crossmark{\tikz\fill[scale=0.4](0.01,0) -- (0,0.01) -- (.45,.5) -- (0,0.99) -- (0.01,1) -- (.5,.55) -- (0.99,1) -- (1,0.99) -- (0.55,0.5) -- (1,0.01) -- (0.99,0) -- (0.5,0.45) -- cycle;}
\newcommand\encirc[1]{%
\tikz[baseline=(X.base)]
\node (X) [draw, shape=circle, inner sep=0] {\strut #1};}
\usepackage{cancel}
\newcommand\encircshaded[1]{%
\tikz[baseline=(X.base)]
\node (X) [draw, shape=circle, inner sep=0, shade] {\strut #1};}
\usepackage{cancel}
\newcommand{\pa}{\text{pa}}
\newcommand{\ch}{\text{ch}}
\newcommand{\bel}{\text{bel}}
\newcommand{\m}{\text{m}}
\newcommand{\nbr}{\text{nbr}}
\newcommand{\nc}{\newcommand}
\nc{\DMO}{\DeclareMathOperator}
\DMO{\id}{id}
\DMO{\rk}{rank}
\DMO{\sgn}{sgn}
\DMO{\alt}{Alt}
\DMO{\len}{len}
\DMO{\im}{img}
\DMO{\tr}{tr}
\nc{\trm}{\textrm}
% partial derivatives
\nc{\p}[2]{\frac{\partial #1}{\partial #2}}
\nc{\der}[2]{\frac{d #1}{d #2}}
\nc{\dd}[2]{\frac{d^2 #1}{d #2 ^2}}
\nc{\pp}[2]{\frac{\partial^2 {#1}} {\partial {#2} ^2}}
\nc{\pmix}[3]{\frac{\partial^2 {#1}}{\partial {#2} \, \partial {#3}}}
\nc{\rd}{\trm{d}}
\nc{\va}[2]{\frac{\del #1}{\del #2}}
\nc{\f}{\frac}
% probability / expectation / variance
\nc{\Prob}{\mathds{P}}
\nc{\Var}{\trm{Var}}
\nc{\Cov}{\trm{Cov}}
\nc{\Cor}{\trm{Cor}}
\nc{\St}{\mathds{S}}
% important math symbols
\nc{\too}{\longrightarrow}
\nc{\rez}{\Rightarrow}
\nc{\bs}{\ensuremath{\blacksquare}}
\nc{\done}{\hfill\bs}
\nc{\bsh}{\backslash}
\nc{\w}{\wedge}
\nc{\til}{\tilde}
\nc{\xra}{\xrightarrow}
\nc{\xrez}{\xRightarrow}
\nc{\xle}{\xlongequal}
\nc{\union}{\bigcup}
\nc{\intt}{\bigcap}
\nc{\x}{\times}
\nc{\ox}{\otimes}
\nc{\op}{\oplus}
\nc{\floor}[1]{\left\lfloor {#1} \right\rfloor}
\nc{\ceil}[1]{\left\lceil {#1} \right\rceil}
% greek letters
\nc{\al}{\alpha}
\nc{\be}{\beta}
\nc{\eps}{\varepsilon}
\nc{\del}{\delta}
\nc{\D}{\Delta}
\nc{\Del}{\nabla}
\nc{\ph}{\varphi}
\nc{\Lam}{\Lambda}
\nc{\lam}{\lambda}
\nc{\G}{\Gamma}
\nc{\g}{\gamma}
\nc{\sig}{\sigma}
\nc{\tta}{\theta}
\nc{\Tta}{\Theta}
\nc{\kap}{\kappa}
\nc{\om}{\omega}
\nc{\lie}{\pounds}
\nc{\contr}{%
\begin{tikzpicture}[rotate=45,x=0.5ex,y=0.5ex]
\draw[line width=.2ex] (0,2) -- (3,2) (0,1) -- (3,1) (1,3) -- (1,0) (2,3) -- (2,0);
\end{tikzpicture}
}
\usetikzlibrary{automata,chains}