-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevan.sty
702 lines (646 loc) · 22.1 KB
/
evan.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
% evan.sty
% If you don't know how to use this file, read:
% https://web.evanchen.cc/faq-latex.html#L-4
% %%%%%%%%%%%%%%%%%%%%%%
% %% evan.sty %%
% %%%%%%%%%%%%%%%%%%%%%%
%
% This file is licensed under the BOOST software license 1.0.
% This basically means you can do whatever you want with it,
% as long as any TeX source versions published
% include my name and this copyright notice.
% The compiled PDF itself is NOT required to have an attribution,
% although of course such attributions are greatly appreciated :D
% Here is the text of the license:
%
% Boost Software License - Version 1.0 - August 17th, 2003
%
% Copyright (c) 2020 Evan Chen [evan at evanchen.cc]
% https://web.evanchen.cc/ || github.com/vEnhance
%
% Permission is hereby granted, free of charge, to any person or organization
% obtaining a copy of the software and accompanying documentation covered by
% this license (the "Software") to use, reproduce, display, distribute,
% execute, and transmit the Software, and to prepare derivative works of the
% Software, and to permit third-parties to whom the Software is furnished to
% do so, all subject to the following:
%
% The copyright notices in the Software and this entire statement, including
% the above license grant, this restriction and the following disclaimer,
% must be included in all copies of the Software, in whole or in part, and
% all derivative works of the Software, unless such copies or derivative
% works are solely in the form of machine-executable object code generated by
% a source language processor.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
% SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
% FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
% ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
% DEALINGS IN THE SOFTWARE.
\ProvidesPackage{evan}
%%fakesection Argument processing
% Default Arguments
% We include "Evan" in all of these to make sure
% that they don't collide with anything in external packages
\newif\ifevanfancy\evanfancytrue
\newif\ifevanhdr\evanhdrtrue
\newif\ifevanhref\evanhreftrue
\newif\ifevansetup\evansetuptrue
\newif\ifevanthm\evanthmtrue
\newif\ifevansecthm\evansecthmfalse
\newif\ifevanht\evanhtfalse
\newif\ifevanpkg\evanpkgtrue
\newif\ifevanpdf\evanpdftrue
\newif\ifevanauthor\evanauthortrue
\newif\ifevanchinese\evanchinesefalse
\newif\ifevanmdthm\evanmdthmfalse
\newif\ifevandiagrams\evandiagramsfalse
\newif\ifevanpatchasy\evanpatchasyfalse
\newif\ifevanhints\evanhintsfalse
\newif\ifevanasy\evanasytrue
\newif\ifevancolorsec\evancolorsecfalse
\newif\ifevantitlemark\evantitlemarktrue
\newif\ifevanvonenabled\evanvonenabledfalse
\newif\ifevanbritish\evanbritishtrue
%Receive Arguments
\DeclareOption{chinese}{\evanhreffalse\evanchinesetrue} % Chinese support
% allow href to override this one
\DeclareOption{sexy}{\evansecthmtrue\evanmdthmtrue\evancolorsectrue} % long docs
\DeclareOption{fancy}{\evanfancytrue}
\DeclareOption{nofancy}{\evanfancyfalse}
\DeclareOption{hdr}{\evanhdrtrue}
\DeclareOption{nohdr}{\evanhdrfalse}
\DeclareOption{href}{\evanhreftrue}
\DeclareOption{nohref}{\evanhreffalse}
\DeclareOption{nosetup}{\evansetupfalse}
\DeclareOption{thm}{\evanthmtrue}
\DeclareOption{nothm}{\evanthmfalse}
\DeclareOption{secthm}{\evansecthmtrue}
\DeclareOption{nosecthm}{\evansecthmfalse}
\DeclareOption{ht}{\evanhttrue}
\DeclareOption{nopdf}{\evanpdffalse}
\DeclareOption{nopkg}{\evanpkgfalse}
\DeclareOption{noauthor}{\evanauthorfalse}
\DeclareOption{titlemark}{\evantitlemarktrue} % Sets title in ohead, not \rightmark
\DeclareOption{sectionmark}{\evantitlemarkfalse} % Uses \rightmark not title in ohead
\DeclareOption{mdthm}{\evanmdthmtrue}
\DeclareOption{nomdthm}{\evanmdthmfalse}
\DeclareOption{diagrams}{\evandiagramstrue}
\DeclareOption{nodiagrams}{\evandiagramsfalse}
\DeclareOption{colorsec}{\evancolorsectrue}
\DeclareOption{nocolorsec}{\evancolorsecfalse}
\DeclareOption{patchasy}{\evanpatchasytrue}
\DeclareOption{noasy}{\evanasyfalse}
\DeclareOption{hints}{\evanhintstrue}
\DeclareOption{von}{\evanvonenabledtrue}
\DeclareOption{british}{\evanbritishtrue}
\DeclareOption{american}{\evanbritishfalse}
\ProcessOptions\relax
% if packages not loaded, turn off mdthm and asy
\ifevanpkg\else\evanmdthmfalse\fi
\ifevanpkg\else\evanasyfalse\fi
% If no setup, turn off theorems
\ifevansetup\else\evanthmfalse\fi
%%fakesection Some macros
%Small commands
\ifevanpkg
\usepackage{amsmath,amssymb}
\fi
\newcommand{\cbrt}[1]{\sqrt[3]{#1}}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\ceiling}[1]{\left\lceil #1 \right\rceil}
\newcommand{\mailto}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand{\ol}{\overline}
\newcommand{\ul}{\underline}
\newcommand{\wt}{\widetilde}
\newcommand{\wh}{\widehat}
\newcommand{\eps}{\varepsilon}
%\renewcommand{\iff}{\Leftrightarrow}
%\renewcommand{\implies}{\Rightarrow}
\newcommand{\vocab}[1]{\textbf{\color{blue}\sffamily #1}}
\providecommand{\alert}{\vocab}
\providecommand{\half}{\frac{1}{2}}
\newcommand{\catname}{\mathsf}
\newcommand{\hrulebar}{
\par\hspace{\fill}\rule{0.95\linewidth}{.7pt}\hspace{\fill}
\par\nointerlineskip \vspace{\baselineskip}
}
%For use in author command
\newcommand{\plusemail}[1]{\\ \normalfont \texttt{\mailto{#1}}}
%More commands and math operators
\DeclareMathOperator{\cis}{cis}
\DeclareMathOperator*{\lcm}{lcm}
\DeclareMathOperator*{\argmin}{arg min}
\DeclareMathOperator*{\argmax}{arg max}
%Convenient Environments
\newenvironment{soln}{\begin{proof}[Solution]}{\end{proof}}
\newenvironment{parlist}{\begin{inparaenum}[(i)]}{\end{inparaenum}}
\newenvironment{gobble}{\setbox\z@\vbox\bgroup}{\egroup}
%Inequalities
\newcommand{\cycsum}{\sum_{\mathrm{cyc}}}
\newcommand{\symsum}{\sum_{\mathrm{sym}}}
\newcommand{\cycprod}{\prod_{\mathrm{cyc}}}
\newcommand{\symprod}{\prod_{\mathrm{sym}}}
%From H113 "Introduction to Abstract Algebra" at UC Berkeley
\newcommand{\CC}{\mathbb C}
\newcommand{\FF}{\mathbb F}
\newcommand{\NN}{\mathbb N}
\newcommand{\QQ}{\mathbb Q}
\newcommand{\RR}{\mathbb R}
\newcommand{\ZZ}{\mathbb Z}
\newcommand{\charin}{\text{ char }}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\Inn}{Inn}
\DeclareMathOperator{\Syl}{Syl}
\DeclareMathOperator{\Gal}{Gal}
\DeclareMathOperator{\GL}{GL} % General linear group
\DeclareMathOperator{\SL}{SL} % Special linear group
%From Kiran Kedlaya's "Geometry Unbound"
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}
\newcommand{\dang}{\measuredangle} %% Directed angle
\newcommand{\ray}[1]{\overrightarrow{#1}}
\newcommand{\seg}[1]{\overline{#1}}
\newcommand{\arc}[1]{\wideparen{#1}}
%From M275 "Topology" at SJSU
\newcommand{\id}{\mathrm{id}}
\newcommand{\taking}[1]{\xrightarrow{#1}}
\newcommand{\inv}{^{-1}}
%From M170 "Introduction to Graph Theory" at SJSU
\DeclareMathOperator{\diam}{diam}
\DeclareMathOperator{\ord}{ord}
\newcommand{\defeq}{\overset{\mathrm{def}}{=}}
%From the USAMO .tex files
\newcommand{\ts}{\textsuperscript}
\newcommand{\dg}{^\circ}
\newcommand{\ii}{\item}
% From Math 55 and Math 145 at Harvard
\newenvironment{subproof}[1][Proof]{%
\begin{proof}[#1] \renewcommand{\qedsymbol}{$\blacksquare$}}%
{\end{proof}}
\newcommand{\liff}{\leftrightarrow}
\newcommand{\lthen}{\rightarrow}
\newcommand{\opname}{\operatorname}
\newcommand{\surjto}{\twoheadrightarrow}
\newcommand{\injto}{\hookrightarrow}
\newcommand{\On}{\mathrm{On}} % ordinals
\DeclareMathOperator{\img}{im} % Image
\DeclareMathOperator{\Img}{Im} % Image
\DeclareMathOperator{\coker}{coker} % Cokernel
\DeclareMathOperator{\Coker}{Coker} % Cokernel
\DeclareMathOperator{\Ker}{Ker} % Kernel
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Spec}{Spec} % spectrum
\DeclareMathOperator{\Tr}{Tr} % trace
\DeclareMathOperator{\pr}{pr} % projection
\DeclareMathOperator{\ext}{ext} % extension
\DeclareMathOperator{\pred}{pred} % predecessor
\DeclareMathOperator{\dom}{dom} % domain
\DeclareMathOperator{\ran}{ran} % range
\DeclareMathOperator{\Hom}{Hom} % homomorphism
\DeclareMathOperator{\Mor}{Mor} % morphisms
\DeclareMathOperator{\End}{End} % endomorphism
% Things Lie
\newcommand{\kb}{\mathfrak b}
\newcommand{\kg}{\mathfrak g}
\newcommand{\kh}{\mathfrak h}
\newcommand{\kn}{\mathfrak n}
\newcommand{\ku}{\mathfrak u}
\newcommand{\kz}{\mathfrak z}
\DeclareMathOperator{\Ext}{Ext} % Ext functor
\DeclareMathOperator{\Tor}{Tor} % Tor functor
\newcommand{\gl}{\opname{\mathfrak{gl}}} % frak gl group
\renewcommand{\sl}{\opname{\mathfrak{sl}}} % frak sl group chktex 6
% More script letters etc.
\newcommand{\SA}{\mathcal A}
\newcommand{\SB}{\mathcal B}
\newcommand{\SC}{\mathcal C}
\newcommand{\SF}{\mathcal F}
\newcommand{\SG}{\mathcal G}
\newcommand{\SH}{\mathcal H}
\newcommand{\OO}{\mathcal O}
\newcommand{\SCA}{\mathscr A}
\newcommand{\SCB}{\mathscr B}
\newcommand{\SCC}{\mathscr C}
\newcommand{\SCD}{\mathscr D}
\newcommand{\SCE}{\mathscr E}
\newcommand{\SCF}{\mathscr F}
\newcommand{\SCG}{\mathscr G}
\newcommand{\SCH}{\mathscr H}
% Mathfrak primes
\newcommand{\km}{\mathfrak m}
\newcommand{\kp}{\mathfrak p}
\newcommand{\kq}{\mathfrak q}
%% Napkin commands
\newcommand{\prototype}[1]{
\emph{{\color{red} Prototypical example for this section:} #1} \par\medskip
}
\newenvironment{moral}{%
\begin{mdframed}[linecolor=green!70!black]%
\bfseries\color{green!70!black}}%
{\end{mdframed}}
%%fakesection Asymptote setup
\ifevanasy
\ifevanpatchasy
\usepackage{patch-asy}
\else
\usepackage{asymptote}
\fi
\begin{asydef}
defaultpen(fontsize(10pt));
size(8cm); // set a reasonable default
usepackage("amsmath");
usepackage("amssymb");
settings.tex="pdflatex";
settings.outformat="pdf";
// Replacement for olympiad+cse5 which is not standard
import geometry;
// recalibrate fill and filldraw for conics
void filldraw(picture pic = currentpicture, conic g, pen fillpen=defaultpen, pen drawpen=defaultpen)
{ filldraw(pic, (path) g, fillpen, drawpen); }
void fill(picture pic = currentpicture, conic g, pen p=defaultpen)
{ filldraw(pic, (path) g, p); }
// some geometry
pair foot(pair P, pair A, pair B) { return foot(triangle(A,B,P).VC); }
pair orthocenter(pair A, pair B, pair C) { return orthocentercenter(A,B,C); }
pair centroid(pair A, pair B, pair C) { return (A+B+C)/3; }
// cse5 abbrevations
path CP(pair P, pair A) { return circle(P, abs(A-P)); }
path CR(pair P, real r) { return circle(P, r); }
pair IP(path p, path q) { return intersectionpoints(p,q)[0]; }
pair OP(path p, path q) { return intersectionpoints(p,q)[1]; }
path Line(pair A, pair B, real a=0.6, real b=a) { return (a*(A-B)+A)--(b*(B-A)+B); }
// cse5 more useful functions
picture CC() {
picture p=rotate(0)*currentpicture;
currentpicture.erase();
return p;
}
pair MP(Label s, pair A, pair B = plain.S, pen p = defaultpen) {
Label L = s;
L.s = "$"+s.s+"$";
label(L, A, B, p);
return A;
}
pair Drawing(Label s = "", pair A, pair B = plain.S, pen p = defaultpen) {
dot(MP(s, A, B, p), p);
return A;
}
path Drawing(path g, pen p = defaultpen, arrowbar ar = None) {
draw(g, p, ar);
return g;
}
\end{asydef}
\fi
%%fakesection BEGIN MAIN SETUP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifevansetup
%%fakesection Set up author and date
\ifevanauthor
\title{} % empty title to avoid crashes
\author{Evan Chen}
\date{\today}
\fi
%%fakesection Hyperref
\ifevanpkg
\PassOptionsToPackage{usenames,svgnames,dvipsnames,table}{xcolor}
\usepackage{xcolor}
\ifevanhref
\usepackage[colorlinks=true]{hyperref}
\hypersetup{urlcolor=RubineRed,linkcolor=RoyalBlue,citecolor=ForestGreen}
\fi
\usepackage[nameinlink]{cleveref}
\fi
%%fakesection New Theorem Styles
\ifevanthm
\usepackage{amsthm}
\usepackage{thmtools}
\fi
\ifevanmdthm
\ifevanthm
%% theorem packages loaded already
\else
\usepackage{amsthm}
\usepackage{thmtools}
\fi
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{mdbluebox}{%
roundcorner=10pt,
linewidth=1pt,
skipabove=12pt,
innerbottommargin=9pt,
skipbelow=2pt,
linecolor=blue,
nobreak=true,
backgroundcolor=TealBlue!5,
}
\declaretheoremstyle[
headfont=\sffamily\bfseries\color{MidnightBlue},
mdframed={style=mdbluebox},
headpunct={\\[3pt]},
postheadspace={0pt}
]{thmbluebox}
\mdfdefinestyle{mdredbox}{%
linewidth=0.5pt,
skipabove=12pt,
frametitleaboveskip=5pt,
frametitlebelowskip=0pt,
skipbelow=2pt,
frametitlefont=\bfseries,
innertopmargin=4pt,
innerbottommargin=8pt,
nobreak=true,
backgroundcolor=Salmon!5,
linecolor=RawSienna,
}
\declaretheoremstyle[
headfont=\bfseries\color{RawSienna},
mdframed={style=mdredbox},
headpunct={\\[3pt]},
postheadspace={0pt},
]{thmredbox}
\mdfdefinestyle{mdgreenbox}{%
skipabove=8pt,
linewidth=2pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=ForestGreen,
backgroundcolor=ForestGreen!5,
}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{ForestGreen!70!black},
bodyfont=\normalfont,
spaceabove=2pt,
spacebelow=1pt,
mdframed={style=mdgreenbox},
headpunct={ --- },
]{thmgreenbox}
\mdfdefinestyle{mdblackbox}{%
skipabove=8pt,
linewidth=3pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=black,
backgroundcolor=RedViolet!5!gray!5,
}
\declaretheoremstyle[
headfont=\bfseries,
bodyfont=\normalfont\small,
spaceabove=0pt,
spacebelow=0pt,
mdframed={style=mdblackbox}
]{thmblackbox}
\newcommand{\listhack}{$\empty$\vspace{-2em}}
\fi
%%fakesection Theorem setup
\ifevanthm
\theoremstyle{definition}
%Branching here: the option secthm changes theorems to be labelled by section
\ifevanmdthm
\ifevansecthm
\declaretheorem[%
style=thmbluebox,name=Theorem,numberwithin=section]{theorem}
\else
\declaretheorem[%
style=thmbluebox,name=Theorem]{theorem}
\fi
\declaretheorem[style=thmbluebox,name=Lemma,sibling=theorem]{lemma}
\declaretheorem[style=thmbluebox,name=Proposition,sibling=theorem]{proposition}
\declaretheorem[style=thmbluebox,name=Corollary,sibling=theorem]{corollary}
\declaretheorem[style=thmbluebox,name=Theorem,numbered=no]{theorem*}
\declaretheorem[style=thmbluebox,name=Lemma,numbered=no]{lemma*}
\declaretheorem[style=thmbluebox,name=Proposition,numbered=no]{proposition*}
\declaretheorem[style=thmbluebox,name=Corollary,numbered=no]{corollary*}
\else
\ifevansecthm
\declaretheorem[name=Theorem,numberwithin=section]{theorem}
\else
\declaretheorem[name=Theorem]{theorem}
\fi
\declaretheorem[name=Lemma,sibling=theorem]{lemma}
\declaretheorem[name=Proposition,sibling=theorem]{proposition}
\declaretheorem[name=Corollary,sibling=theorem]{corollary}
\declaretheorem[name=Theorem,numbered=no]{theorem*}
\declaretheorem[name=Lemma,numbered=no]{lemma*}
\declaretheorem[name=Proposition,numbered=no]{proposition*}
\declaretheorem[name=Corollary,numbered=no]{corollary*}
\fi
\ifevanmdthm
\declaretheorem[style=thmgreenbox,name=Algorithm,sibling=theorem]{algorithm}
\declaretheorem[style=thmgreenbox,name=Algorithm,numbered=no]{algorithm*}
\declaretheorem[style=thmgreenbox,name=Claim,sibling=theorem]{claim}
\declaretheorem[style=thmgreenbox,name=Claim,numbered=no]{claim*}
\else
\declaretheorem[name=Algorithm,sibling=theorem]{algorithm}
\declaretheorem[name=Algorithm,numbered=no]{algorithm*}
\declaretheorem[name=Claim,sibling=theorem]{claim}
\declaretheorem[name=Claim,numbered=no]{claim*}
\fi
\ifevanmdthm
\declaretheorem[style=thmredbox,name=Example,sibling=theorem]{example}
\declaretheorem[style=thmredbox,name=Example,numbered=no]{example*}
\else
\declaretheorem[name=Example,sibling=theorem]{example}
\declaretheorem[name=Example,numbered=no]{example*}
\fi
% Remark-style theorems
%\theoremstyle{remark}
\ifevanmdthm
\declaretheorem[style=thmblackbox,name=Remark,sibling=theorem]{remark}
\declaretheorem[style=thmblackbox,name=Remark,numbered=no]{remark*}
\else
\declaretheorem[name=Remark,sibling=theorem]{remark}
\declaretheorem[name=Remark,numbered=no]{remark*}
\fi
\declaretheorem[name=Conjecture,sibling=theorem]{conjecture}
\declaretheorem[name=Conjecture,numbered=no]{conjecture*}
\declaretheorem[name=Definition,sibling=theorem]{definition}
\declaretheorem[name=Definition,numbered=no]{definition*}
\declaretheorem[name=Exercise,sibling=theorem]{exercise}
\declaretheorem[name=Exercise,numbered=no]{exercise*}
\declaretheorem[name=Fact,sibling=theorem]{fact}
\declaretheorem[name=Fact,numbered=no]{fact*}
\declaretheorem[name=Problem,sibling=theorem]{problem}
\declaretheorem[name=Problem,numbered=no]{problem*}
\declaretheorem[name=Question,sibling=theorem]{ques}
\declaretheorem[name=Question,numbered=no]{ques*}
\Crefname{claim}{Claim}{Claims}
\Crefname{conjecture}{Conjecture}{Conjectures}
\Crefname{exercise}{Exercise}{Exercises}
\Crefname{fact}{Fact}{Facts}
\Crefname{problem}{Problem}{Problems}
\Crefname{ques}{Question}{Questions}
\fi
%%fakesection Fancy section and chapter heads
\ifevancolorsec
\@ifundefined{KOMAClassName}{}{
\@ifundefined{chapter}{}{
\addtokomafont{partprefix}{\rmfamily}
\renewcommand*{\partformat}{\color{purple}
\scalebox{2.5}{\thepart}\enlargethispage{2em}}
\addtokomafont{chapterprefix}{\raggedleft}
\RedeclareSectionCommand[beforeskip=0.5em]{chapter}
\renewcommand*{\chapterformat}{\mbox{%
\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{2.718}{\color{purple}\thechapter}\enskip}}
}
\renewcommand*{\sectionformat}%
{\color{purple}\S\thesection\enskip}
\renewcommand*{\subsectionformat}%
{\color{purple}\S\thesubsection\enskip}
\renewcommand*{\subsubsectionformat}%
{\color{purple}\S\thesubsubsection\enskip}
\KOMAoptions{numbers=noenddot}
%\usetocstyle{KOMAlike}
}
\fi
%%fakesection Loads a bunch of useful packages (but allow disabling)
\ifevanpkg
\ifevanvonenabled
\IfFileExists{von.sty}{\usepackage{von}}{}
\fi
\usepackage{listings}
\usepackage{mathrsfs}
\usepackage{textcomp}
\lstset{basicstyle=\ttfamily\scriptsize,
backgroundcolor=\color{green!2!white},
breakatwhitespace=true,
breaklines=true,
commentstyle=\color{green!70!black},
frame=shadowbox,
frame=single,
identifierstyle=\color{green!20!black},
keywordstyle=\bfseries,
keywordstyle=\bfseries\color{blue},
numbers=left,
numbersep=5pt,
numberstyle=\tiny\sffamily\itshape\color{black!60},
rulecolor=\color{blue!70!black},
rulesepcolor=\color{blue!30!black},
showstringspaces=false,
stringstyle=\color{orange},
tabsize=4,
} % chktex 6
\lstdefinelanguage{gitcommit}{
alsoletter={:},
morecomment=[l]{|},
morekeywords={commit,Author:,Date:,chore,doc,edit,feat,fix,polish,style,tests,},
sensitive=true,
}
\lstdefinelanguage{gitlog}{
morekeywords={chore,doc,edit,feat,fix,polish,style,tests,},
morecomment=[s]{[}{]}, % chktex 9
sensitive=true,
}
\usepackage[shortlabels]{enumitem}
\usepackage[obeyFinal,textsize=scriptsize,shadow]{todonotes}
\usepackage{textcomp}
\usepackage{multirow}
% Tiny tiny optimizations:
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{xstring}
\ifevanbritish
% Use day-first date format
\usepackage[cleanlook,british]{isodate}
\fi
% a list I like for walkthrough's --- Drew-style parts
\newlist{walk}{enumerate}{3}
\setlist[walk]{label=\bfseries (\alph*)}
% list item for MO style rubrics
\newcommand{\worth}[1]{\def\hfill{\hskip 20pt plus 1fill}\dotfill%
\IfEq{#1}{0}{\textbf{0~points}}%
{\textbf{\color{blue}#1~point\IfEndWith{#1}{1}{}{s}}}%
\par}
\newcommand{\subworth}[1]{\def\hfill{\hskip 20pt plus 1fill}\dotfill%
\IfEq{#1}{0}{{\footnotesize0~points}}%
{\textbf{\footnotesize#1~point\IfEndWith{#1}{1}{}{s}}}%
\par}
\newlist{rubric}{enumerate}{2}
\setlist[rubric,1]{label=\Roman*.}
\setlist[rubric,2]{label=(\Roman{rubrici}.\alph*)}
\fi
%%fakesection \maketitle configuration
\@ifundefined{KOMAClassName}%
{} % do nothing outside KOMA class
{% If KOMA exists. . .
\addtokomafont{subtitle}{\Large}
\setkomafont{author}{\Large\scshape}
\setkomafont{date}{\Large\normalsize}
}
\providecommand{\thetitle}{\@title}
\providecommand{\theauthor}{\@author}
\providecommand{\thedate}{\@date}
%%fakesection Commutative diagrams support
\ifevandiagrams
\usepackage{tikz-cd}
\usetikzlibrary{decorations.pathmorphing}
\fi
%%fakesection Page Setup
\ifevanfancy
\@ifundefined{KOMAClassName}
{
\usepackage{fancyhdr}
\setlength{\headheight}{0.75in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\voffset}{-1.0in}
\setlength{\headsep}{10pt}
\setlength{\textwidth}{6.5in}
\setlength{\headwidth}{6.5in}
\setlength{\textheight}{8.75in}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\setlength{\footskip}{0.3in}
\ifevanhdr
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.0pt}
\pagestyle{fancy}
\lhead{Evan Chen}
\chead{}
\rhead{\nouppercase{\leftmark}}
\lfoot{}
\cfoot{\thepage}
\rfoot{}
\fi
}
{
\usepackage[headsepline]{scrlayer-scrpage}
\renewcommand{\headfont}{}
\addtolength{\textheight}{3.14cm}
\setlength{\footskip}{0.5in}
\setlength{\headsep}{10pt}
\ihead{\footnotesize\textbf{\theauthor} (\thedate)}
\automark{section}
\chead{}
\ohead{\footnotesize\textbf{\thetitle}}
\cfoot{\pagemark}
}
\fi
%%fakesection Chinese support
\ifevanchinese
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\newenvironment{bsmi}{\begin{CJK}{UTF8}{bsmi}}{\end{CJK}}
\newcommand{\cn}[1]{\begin{bsmi}#1\end{bsmi}}
\AtBeginDocument{\begin{CJK}{UTF8}{bsmi}}
\AtEndDocument{\end{CJK}}
\fi
%%fakesection Hints
\ifevanhints
\usepackage{answers}
\Newassociation{hint}{hintitem}{hints}
\renewcommand{\solutionextension}{out}
\Opensolutionfile{hints}
\newcommand{\makehints}{\Closesolutionfile{hints}\input{hints.out}} % chktex 27
\fi
%%fakesection END MAIN SETUP
\fi