-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathagony-note.tex
172 lines (160 loc) · 6.29 KB
/
agony-note.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
\RequirePackage{chngcntr}
\newcommand{\setsectiontitle}[1]{
\titleformat{\section}{\normalfont\large\bfseries}{#1~\thesection}{1em}{}
\settowidth{\cftsecnumwidth}{#1~0000~}
\renewcommand\cftsecpresnum{#1~}
\addtocontents{toc}{\protect\renewcommand*{\protect\cftsecpresnum}{#1~}}
}
\bookmarksetup{numbered}
\setlength\topsep{6pt}
% Theorem boxes (taken from vEnhance/napkin)
\mdfdefinestyle{mdround}{
roundcorner=10pt,
linewidth=1pt,
skipabove=12pt,
innertopmargin=12pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
}
\mdfdefinestyle{mdsquare}{
linewidth=0.5pt,
skipabove=12pt,
innertopmargin=12pt,
innerbottommargin=9pt,
skipbelow=2pt,
nobreak=true,
}
\mdfdefinestyle{mdquote}{
skipabove=8pt,
innertopmargin=12pt,
innerbottommargin=9pt,
linewidth=2pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
}
% Results (purple)
\declaretheoremstyle[
headfont=\bfseries\color{Purple},
mdframed={style=mdround,linecolor=Mulberry,backgroundcolor=Orchid!5},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmroundresult}
\declaretheoremstyle[
headfont=\bfseries\color{Violet},
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=Violet,backgroundcolor=Periwinkle!5},
]{thmquotestrongresult}
\declaretheoremstyle[
headfont=\bfseries\color{Violet},
mdframed={style=mdsquare,linecolor=Violet,backgroundcolor=Periwinkle!5},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmsquareresult}
\declaretheoremstyle[
headfont=\bfseries\color{MidnightBlue},
mdframed={style=mdsquare,linecolor=RoyalBlue,backgroundcolor=CornflowerBlue!5},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmprop}
\declaretheoremstyle[
headfont=\bfseries\color{MidnightBlue},
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=RoyalBlue,backgroundcolor=CornflowerBlue!5},
]{thmquoteresult}
\declaretheorem[Refname={Theorem,Theorems},refname={thm.,thms.},style=thmroundresult,numberwithin=section]{theorem}
\declaretheorem[Refname={Fact,Facts},refname={fact,facts},style=thmquotestrongresult,sibling=theorem]{fact}
\declaretheorem[Refname={Lemma,Lemmas},refname={lem.,lems.},style=thmsquareresult,sibling=theorem]{lemma}
\declaretheorem[name=Proposition,Refname={Proposition,Propositions},refname={prop.,props.},style=thmprop,sibling=theorem]{prop}
\declaretheorem[Refname={Corollary,Corollaries},refname={cor.,cors.},style=thmquoteresult,sibling=theorem]{corollary}
% Problems (red)
\declaretheoremstyle[
headfont=\bfseries\color{RawSienna},
mdframed={style=mdround,linecolor=Red,backgroundcolor=CarnationPink!5},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmroundred}
\declaretheoremstyle[
headfont=\bfseries\color{RedViolet},
mdframed={style=mdround,linecolor=Magenta,backgroundcolor=CarnationPink!5},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmroundpink}
\declaretheoremstyle[
headfont=\bfseries\color{RawSienna},
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=Red,backgroundcolor=CarnationPink!5},
]{thmquotered}
\declaretheorem[Refname={Conjecture,Conjectures},refname={conj.,conjs.},style=thmroundpink,sibling=theorem]{conjecture}
\declaretheorem[Refname={Problem,Problems},refname={prob.,probs.},style=thmroundred,sibling=theorem]{problem}
\declaretheorem[name=Exercise,Refname={Exercise,Exercises},refname={exercise,exercises},style=thmquotered,sibling=theorem]{xca}
% Definitions (green)
\declaretheoremstyle[
headfont=\bfseries\color{OliveGreen},
bodyfont=\normalfont,
headpunct={\\[3pt]},
postheadspace={0pt},
mdframed={style=mdsquare,linecolor=ForestGreen,backgroundcolor=ForestGreen!5},
]{thmsquaregreen}
\declaretheoremstyle[
headfont=\bfseries\color{OliveGreen},
mdframed={style=mdround,linecolor=ForestGreen,backgroundcolor=ForestGreen!5},
headpunct={\\[3pt]},
postheadspace={0pt},
]{thmroundgreen}
\declaretheoremstyle[
headfont=\bfseries\color{OliveGreen},
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=ForestGreen,backgroundcolor=ForestGreen!5},
]{thmquotegreen}
\declaretheorem[refname={def.,defs.},Refname={Definition,Definitions},style=thmsquaregreen,sibling=theorem]{definition}
\NewDocumentEnvironment{defn}{oO{#1}}{\IfNoValueTF{#1}{\definition}{\definition[#1]\index{#2}}}{\enddefinition}
\NewDocumentEnvironment{defn*}{o}{\IfNoValueTF{#1}{\definition}{\definition[#1]}}{\enddefinition}
\declaretheorem[refname={notation,notations},style=thmquotegreen,unnumbered]{notation}
\declaretheorem[refname={convention,conventions},style=thmquotegreen,unnumbered]{convention}
% Misc (black)
\declaretheoremstyle[
headfont=\bfseries,
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=black,backgroundcolor=RedViolet!5!gray!5}
]{thmquoteblack}
\declaretheoremstyle[
headfont=\bfseries\color{Brown},
notefont=\mdseries,
bodyfont=\normalfont,
mdframed={style=mdquote,linecolor=Goldenrod,backgroundcolor=Goldenrod!5}
]{thmquoteyellow}
\declaretheorem[Refname={Remark,Remarks},refname={rem.,rems.},style=thmquoteyellow,sibling=theorem]{remark}
\declaretheorem[refname={claim,claims},style=thmquoteblack,sibling=theorem]{claim}
\declaretheorem[Refname={Example,Examples},refname={ex.,exs.},style=thmquoteblack,sibling=theorem]{example}
% \RequirePackage[hybrid,underscores=false]{markdown}
% Use inside of definitions: "a \term{thing} is a whatever"
\makeindex[columns=3, title=Index of Defined Terms, intoc]
\indexsetup{level=\chapter*,toclevel=section}
% [tex.se/41100] For thmbox
\RequirePackage{tablefootnote}
\newcommand{\spewnotes}{\tfn@tablefootnoteprintout\global\let\tfn@tablefootnoteprintout\relax\gdef\tfn@fnt{0}}
% List of lectures (marked in margin)
\RequirePackage{multicol,xpatch}
\RequirePackage{marginnote}
\newlistof{lecture}{lec.toc}{Lectures}
\xpatchcmd{\listoflecture}{\chapter*}{\section*}{}{}
\settowidth{\cftlecturenumwidth}{Lecture~0000~}
\newcommand{\lecture}[1]{%
\refstepcounter{lecture}%
\addcontentsline{lec.toc}{lecture}{\protect\numberline{Lecture~\thelecture}#1}%
\marginnote{\normalsize{\textit{Lecture \thelecture\\#1}}}}
% [tex.se/347893] ------ Text rule -------
\def\rulefill{\leavevmode\leaders\hrule height .7ex width 1ex depth -0.6ex\hfill\kern\z@}
\newcommand{\textrule}[1]{\noindent\rulefill\quad{\small\emph{#1}}\quad\rulefill}
% Default to 1., (a), (i)
\setlist[enumerate,1]{label={\arabic*.}}
\setlist[enumerate,2]{label={(\alpha*)}}
\setlist[enumerate,3]{label={(\roman*)}}