-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblupaper.sty
More file actions
205 lines (168 loc) · 5.7 KB
/
blupaper.sty
File metadata and controls
205 lines (168 loc) · 5.7 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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
\ProvidesPackage{blupaper}[2023/04/06]
\newif\ifbirddate \birddatetrue
\newif\ifbirdserif \birdseriffalse
\newif\ifbirdfancy \birdfancytrue
\newif\ifbirdcolor \birdcolortrue
\newif\ifbirdcode \birdcodefalse
\DeclareOption{nodate}{\birddatefalse}
\DeclareOption{nosans}{\birdseriftrue}
\DeclareOption{nofancy}{\birdfancyfalse}
\DeclareOption{nocolor}{\birdcolorfalse}
\DeclareOption{code}{\birdcodetrue}
\ProcessOptions\relax
% STYLING PACKAGES
\usepackage{blubase}
%\KOMAoptions{numbers = noendperiod}
\usepackage[nodisplayskipstretch, onehalfspacing]{setspace}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{multicol}
\usepackage{titling}
\usepackage{biblatex}
% links
\usepackage{hyperref}
\usepackage{cleveref} % must be loaded after hyperref
\usepackage{float}
\usepackage{endnotes}
\usepackage{amsmath}
\usepackage{thmtools}
\usepackage[margin=1in, head=18pt \relax]{geometry}
\PassOptionsToPackage{svgnames, dvipsnames, usenames}{xcolor}
\usepackage[framemethod = TikZ]{mdframed}
\usepackage{silence} % for suppressing warnings :)
% TITLE CUSTOMIZATION
\setlength{\droptitle}{-2cm}
\pretitle{\begin{center}\Large \bfseries}
\posttitle{\par\end{center}}
\preauthor{\vspace{-1.25em} \begin{center} \large \rmfamily \scshape}
\postauthor{\par\end{center}}
\predate{\vspace{-1.5em} \begin{center} \large \rmfamily \scshape}
\postdate{\par\end{center}}
% SETUP
\ifbirddate\else
\date{~\vspace{-5ex}}
\fi
\ifbirdserif
\addtokomafont{disposition}{\rmfamily}
\else
\renewcommand{\familydefault}{\sfdefault}
\fi
\ifbirdcolor \else
\renewcommand{\vocab}[1]{\textbf{\boldmath #1}}
\fi
%\RedeclareSectionCommand[
% beforeskip = .4\baselineskip
%]{paragraph}
\ifbirdfancy
\usepackage{scrlayer-scrpage}
\setkomafont{pageheadfoot}{\normalcolor}
\fi
%Section heading numbers in the margin
%\renewcommand{\sectionlinesformat}[4]{\makebox[0pt][r]{#3}#4}
\allowdisplaybreaks
\AtBeginDocument{
\setlength{\belowdisplayskip}{0.5em}
\setlength{\belowdisplayshortskip}{0.2em}
\setlength{\abovedisplayskip}{0.5em}
\setlength{\abovedisplayshortskip}{0.2em}
}
% Make itemize bullets smaller
\setlist{noitemsep, topsep = 0.4em}
\renewcommand\labelitemi{\raisebox{0.15em}{\tiny$\bullet$}}
\renewcommand{\arraystretch}{0.8}
% theorem box setup
\mdfsetup{
roundcorner = 2pt,
linewidth = 1pt,
innertopmargin = 0.5em,
innerbottommargin = 1em,
frametitlefont = \bfseries
}
\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}
% THEOREM BOX COLORS - need some love
\ifbirdcolor
\colorlet{defforeground}{red!70!black}
\colorlet{defbackground}{red!5}
\colorlet{thmforeground}{blue}
\colorlet{thmbackground}{blue!5}
\colorlet{exforeground}{green!50!black}
\colorlet{exbackground}{green!5}
\else
\colorlet{defforeground}{black}
\colorlet{defbackground}{white}
\colorlet{thmforeground}{black}
\colorlet{thmbackground}{white}
\colorlet{exforeground}{black}
\colorlet{exbackground}{white}
\fi
\mdfdefinestyle{mdredbox}{
linecolor = defforeground,
backgroundcolor = defbackground,
}
\declaretheoremstyle[
headfont = \sffamily\bfseries\color{defforeground},
mdframed = {style = mdredbox},
headpunct = {\\[0.4pt]},
postheadspace = {0pt}
]{defbox}
\mdfdefinestyle{mdbluebox}{
linecolor = thmforeground,
backgroundcolor = thmbackground,
}
\declaretheoremstyle[
headfont = \sffamily\bfseries\color{thmforeground},
mdframed = {style = mdbluebox},
headpunct = {\\[3pt]},
postheadspace = {0pt}
]{thmbox}
\mdfdefinestyle{mdgreenbox}{
linecolor = exforeground,
backgroundcolor = exbackground,
}
\declaretheoremstyle[
headfont = \sffamily\bfseries\color{exforeground},
mdframed = {style = mdgreenbox},
headpunct = {\\[3pt]},
postheadspace = {0pt},
preheadhook = {~\vspace{-6pt}},
]{exbox}
\declaretheoremstyle[
bodyfont = \normalfont
]{plain}
\declaretheoremstyle[
bodyfont = \normalfont,
qed = $\lozenge$
]{example}
\newcommand{\boxhack}{~\vspace{-2em}}
% THEOREM STYLES - need some love
\declaretheorem[name = Definition, numberwithin=section]{definition}
\declaretheorem[name = Theorem, numberwithin=section,
sibling = definition]{theorem}
\declaretheorem[name = Lemma, sibling = theorem]{lemma}
\declaretheorem[name = Proposition, sibling = theorem]{proposition}
\declaretheorem[name = Corollary, sibling = theorem]{corollary}
\declaretheorem[name = Conjecture, sibling = theorem]{conjecture}
%\declaretheorem[style = thmbox, name = Algorithm, sibling = theorem]{algorithm}
\declaretheorem[name = Fact, sibling = theorem]{fact}
\declaretheorem[style = plain, name = Exercise, numbered = no]{exercise}
\declaretheorem[style = plain, name = Problem, numbered = no]{problem}
\declaretheorem[style = plain, name = Question, numbered = no]{question}
\declaretheorem[style = plain, name = Answer, numbered = no]{answer}
\declaretheorem[style = plain, name = Remark, numbered = no]{remark}
\declaretheorem[style = plain, name = Case, numberwithin = theorem]{case}
\declaretheorem[style = plain, name = Claim, numberwithin = theorem]{claim}
\declaretheorem[style = exbox, name = Example, sibling = theorem]{example}
\declaretheorem[style = example, name = Example, sibling = theorem]{pexample}
\declaretheorem[style = exbox, name = Example, numbered = no]{example*}
\declaretheorem[style = plain, name = Definition, numberwithin=section,
sibling = definition]{pdefinition}
\declaretheorem[style = plain, name = Lemma, sibling = theorem]{plemma}
% Suppress mdframed warnings
\WarningFilter{mdframed}{You got a bad break} % 'Cause you've had a bad day...
\ifbirdcode
\usepackage{minted}
\setminted{linenos = true, breaklines = true, tabsize = 4}
\usepackage{accsupp} % prevents selection of line numbers
\let\oldfancyVerbLine\theFancyVerbLine
\renewcommand{\theFancyVerbLine}{\BeginAccSupp{ActualText={}}\oldfancyVerbLine\EndAccSupp{}}
\fi