-
Notifications
You must be signed in to change notification settings - Fork 0
/
prreamble.sty
1480 lines (1313 loc) · 48.5 KB
/
prreamble.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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Ryan Rueger, 2022
%
% Slogan: Preamble by Ryan Rueger, hence "pRReamble"
%
% Originally adopted from Manfred Einsiedler and Andreas Wieser's Analysis
% script. Many changes and features have come since then, and so is perhaps not
% so recognisable any more.
%
% For a not very up-to-date version of the documentation visit
%
% https://rueg.re/prreamble.pdf
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{prreamble}[2022/11/18 A preamble for mathematics]
% Options {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% These packages are required for managing the options within this package.
% Provides \ifdef, \*toggle* commmmands
\RequirePackage{etoolbox}
% Provides \ifluatex, \ifxetex
\RequirePackage{iftex}
% Provides \NewDocumentCommand
\RequirePackage{xparse}
\newtoggle{debug}
\DeclareOption{debug}{\toggletrue{debug}}
\newtoggle{nobreaks}
\DeclareOption{nobreaks}{\toggletrue{nobreaks}}
\newtoggle{printlinks}
\DeclareOption{printlinks}{\toggletrue{printlinks}}
\newtoggle{print}
\DeclareOption{print}{%
\PassOptionsToPackage{draft}{hyperref}
\toggletrue{print}
\toggletrue{printlinks}
}
\newtoggle{centertitles}
\DeclareOption{centertitles}{%
\toggletrue{centertitles}
\PassOptionsToPackage{center}{titlesec}
}
\newtoggle{centerstacktitles}
\DeclareOption{centerstacktitles}{\toggletrue{centerstacktitles}}
\newtoggle{concroman}
\DeclareOption{concroman}{\toggletrue{concroman}}
\newtoggle{concmath}
\DeclareOption{concmath}{\toggletrue{concmath} \toggletrue{concroman}}
\newtoggle{concbold}
\DeclareOption{concbold}{\toggletrue{concbold} \toggletrue{concroman}}
\newtoggle{euler}
\DeclareOption{euler}{\toggletrue{euler}}
\newtoggle{scdefs}
\DeclareOption{scdefs}{\toggletrue{scdefs}}
\newtoggle{scdefobjs}
\DeclareOption{scdefobjs}{\toggletrue{scdefobjs}}
\newtoggle{uldefs}
\DeclareOption{uldefs}{\toggletrue{uldefs}}
\newtoggle{uldefobjs}
\DeclareOption{uldefobjs}{\toggletrue{uldefobjs}}
\newtoggle{scthms}
\DeclareOption{scthms}{\toggletrue{scthms}}
\newtoggle{ulthms}
\DeclareOption{ulthms}{\toggletrue{ulthms}}
\newtoggle{scemph}
\DeclareOption{scemph}{\toggletrue{scemph}}
\newtoggle{milne}
\DeclareOption{milne}{\toggletrue{milne}}
% Original
\newtoggle{original}
\DeclareOption{original}{%
\toggletrue{original}
\toggletrue{concroman}
\toggletrue{euler}
}
% Classic
\newtoggle{classic}
\DeclareOption{classic}{%
\toggletrue{classic}
\toggletrue{concbold}
\toggletrue{concroman}
\toggletrue{concmath}
\toggletrue{scdefobjs}
\toggletrue{scemph}
\toggletrue{uldefs}
\toggletrue{ulthms}
\toggletrue{centertitles}
\PassOptionsToPackage{center}{titlesec}
}
% Modern
\newtoggle{modern}
\DeclareOption{modern}{%
\toggletrue{modern}
\toggletrue{concroman}
\toggletrue{concmath}
}
\newtoggle{beamer}
\DeclareOption{beamer}{\toggletrue{beamer}}
\newtoggle{nomath}
\DeclareOption{nomath}{\togglefalse{nomath}}
\newtoggle{noletters}
\DeclareOption{noletters}{\toggletrue{noletters}}
\DeclareOption*{\PackageWarning{prreamble}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
\iftoggle{ulthms}{\iftoggle{scthms}{%
\PackageWarning{prreamble}{Both ulthms and scthms was specified}
}{}}{}
\iftoggle{uldefs}{\iftoggle{scdefs}{%
\PackageWarning{prreamble}{Both uldefs and scdefs was specified}
}{}}{}
\iftoggle{uldefobjs}{\iftoggle{scdefobjs}{%
\PackageWarning{prreamble}{Both uldefobjs and scdefobjs was specified}
}{}}{}
\iftoggle{concmath}{\iftoggle{euler}{%
\PackageWarning{prreamble}{Cannot use concmath and euler together}
}{}}{}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Context {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This preamble was initially developed by Andreas Wieser, Prof. Manfred
% Einsiedler and a host of others
%
% To generate a ``clean'' version of this preamble, it can be piped through
% `sed`
%
% This clean version will not have any comments
%
% $ sed -e '/^%/d' -e '/^\s*$/d' -e 's/\s*%.*$//' preamble.tex > clean-preamble.tex
%
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% How to use this package {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Here is a boilerplate example for using this preamble.
%
% The \documentclass is purposely _not_ defined in this preamble, and thus must
% be defined in the document before \inputting the preamble.
%
% \documentclass[11pt,a4paper,oneside]{article}
% \input{preamble}
% \begin{document}
% ...
% \end{document}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Default packages and configurations {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Descriptions obtained from CTAN
\newtoggle{geometryloadedbefore}
\ifdef{\newgeometry}{\toggletrue{geometryloadedbefore}}{}
\AtEndPreamble{%
% If geometry is loaded
\ifdef{\newgeometry}{%
% But it wasn't loaded before prreamble
\nottoggle{geometryloadedbefore}{%
\PackageWarning{prreamble}{geometry was loaded after prreamble}
}{}
}{}
}
\ifluatex \else \ifxetex \else
\RequirePackage[utf8]{inputenc}
% Standard package for selecting font encodings
% https://www.ctan.org/pkg/fontenc
% Including Cyrllic encodings (T2{A,B,C}) later comes into conflict with the
% \C command.
\RequirePackage[T1]{fontenc}
\fi \fi
% Standard mathematics packages
\RequirePackage{amsmath}
\RequirePackage{amscd}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
% Pre-defined colors
% https://www.ctan.org/pkg/xcolor
\RequirePackage{xcolor}
\definecolor{maroon}{cmyk}{0, 0.87, 0.68, 0.32}
\colorlet{ochre}{brown}
\newcommand{\purple}[1]{{\color{violet} #1}}
\newcommand{\violet}[1]{{\color{violet} #1}}
\newcommand{\green}[1]{{\color{teal} #1}}
\newcommand{\teal}[1]{{\color{teal} #1}}
\newcommand{\red}[1]{{\color{red} #1}}
\newcommand{\ochre}[1]{{\color{ochre} #1}}
\newcommand{\maroon}[1]{{\color{maroon} #1}}
\newcommand{\blue}[1]{{\color{blue} #1}}
\nottoggle{beamer}{%
% Hyperref - Extensive support for hypertext in LaTeX
% Needs to be included _before_ amsrefs!
\RequirePackage[
hidelinks,
colorlinks=true,
allcolors=maroon,
unicode,
]{hyperref}
}{}
% AMS alternative to bibtex. Allows for bibliography in the same source file as
% the main file.
\RequirePackage[lite,backrefs]{amsrefs}
% Mathtools - Mathematical tools to use with amsmath
% Must be loaded _before_ unicode-math
% Provides: \hookrightarrow, ...
% https://www.ctan.org/pkg/mathtools
\RequirePackage{mathtools}
\PassOptionsToPackage{warnings-off={mathtools-colon,mathtools-overbracket}}{unicode-math}
% Fontspec - Advanced font selection in XeLaTeX and LuaLaTeX
% https://ctan.org/pkg/fontspec
\iftoggle{milne}{%
\RequirePackage{newtx}
}{%
\RequirePackage{fontspec}
}
\iftoggle{concroman}{%
% concroman
\iftoggle{concmath}{%
\iftoggle{concbold}{%
% concmath and concbold
\RequirePackage[math-style=ISO]{concmath-otf}
}{%
% concmath and !concbold
\RequirePackage{unicode-math}
\setmathfont{Concrete Math}[math-style=ISO]
\setmainfont{cmunorm.otf}[
BoldFont=lmroman9-bold.otf,
ItalicFont=cmunoti.otf,
BoldItalicFont=cmunobi.otf
]
}
% Steal the \setminus command from Asana-Math
% Needs to come after getting concmath font from concmath-otf
\setmathfont{Asana-Math.otf}[range={"029F5}]
}{%
\iftoggle{concbold}{%
% !concmath and concbold
\setmainfont{cmunorm.otf}[
BoldFont=cmunobx.otf,
ItalicFont=cmunoti.otf,
BoldItalicFont=cmunobi.otf
]
}{%
% !concmath and !concbold
\setmainfont{cmunorm.otf}[
BoldFont=lmroman9-bold.otf,
ItalicFont=cmunoti.otf,
BoldItalicFont=cmunobi.otf
]
}
}
\newcommand{\graffito}[1]{%
\marginpar{\fontspec{ccslc9.tfm}\raggedright\footnotesize\color{maroon}#1}
}
}{%
% !concroman
\newcommand{\graffito}[1]{%
\marginpar{\fontspec{lmmonoltcond10-oblique.otf}\raggedright\footnotesize\color{maroon}#1}
}
\nottoggle{milne}{%
\RequirePackage{amssymb}
}{}
}
\iftoggle{euler}{%
\RequirePackage{euler-math}
\setmathfont{STIXTwoMath-Regular.otf}[range=sfup,Scale=MatchUppercase]
}{}
% If the scemph option is configured, use schape instead of bold.
\iftoggle{scemph}{%
\renewcommand{\textbf}{\textsc}
}{}
% Macros supporting the Mathematics of Physics
% Provides: \evaluated
\RequirePackage{physics}
% Typeset mathematical double stroke symbols
% Provides: \mathbb, \mathds
% https://www.ctan.org/tex-archive/fonts/doublestroke
\RequirePackage{dsfont}
% Enumerate with redefinable labels
% Provides: \enumerate
% https://www.ctan.org/pkg/enumerate
\RequirePackage{enumerate}
% Extensive control of page headers and footers
% https://www.ctan.org/pkg/fancyhdr
\nottoggle{beamer}{%
\RequirePackage{fancyhdr}
\AtBeginDocument{\addtolength{\headheight}{1ex}}
% Indent first paragraph after section header
% (Default is to indent all but the first)
% https://www.ctan.org/pkg/indentfirst
% \RequirePackage{indentfirst}
% Print text verbatim (useful for code snippet)
% https://ctan.org/pkg/indentfirst?lang=en
}{}
\RequirePackage{verbatim}
\nottoggle{beamer}{%
% Enhanced support for graphics
% https://www.ctan.org/pkg/graphicx
\RequirePackage[final]{graphicx}
}{}
% Create PostScript and PDF graphics
% Include after: graphicx, xcolor
% https://www.ctan.org/pkg/pgf
\RequirePackage{tikz}
\usetikzlibrary{angles,arrows,calc,decorations.pathmorphing,matrix,shapes}
% Create commutative diagrams with TikZ
% https://ctan.org/pkg/tikz-cd
\RequirePackage{tikz-cd}
% Select any font size in LaTeX
% https://ctan.org/pkg/anyfontsize
% This essentially fixes 'Font shape ... not available in size ...' errors
\RequirePackage{anyfontsize}
\nottoggle{beamer}{%
% A package for producing multiple indexes
\RequirePackage{imakeidx}
\indexsetup{firstpagestyle=empty}
% Change index for larger index items
\renewcommand{\@idxitem}{\par\hangindent 10\p@}
% Ensure the index is created
\makeindex
}{}
% Force footnotes to the bottom of the page
% https://www.ctan.org/pkg/footmisc
\RequirePackage[bottom]{footmisc}
% https://www.ctan.org/pkg/soul
% Hyphenation for letterspacing, underlining, and more
\RequirePackage{soul}
% Override \underline with more robust underlining
% Standard \underline cannot perform line breaks
\let\defaultunderline\underline
\renewcommand{\underline}{\ul}
% Intermix single and multiple columns
% https://www.ctan.org/pkg/multicol
% For breaking long calculations into columns
\RequirePackage{multicol}
% Typeset source code listings using LaTeX
% https://www.ctan.org/pkg/listings
\RequirePackage{listings}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.98,0.98,0.98}
\lstdefinestyle{mystyle}{%
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
}
\lstset{style=mystyle}
% Framed environments that can split at page boundaries
% Used for defining new environments
% https://www.ctan.org/pkg/mdframed
\RequirePackage{mdframed}
\newmdenv[
topline=false,
bottomline=false,
rightline=false,
skipabove=\topsep,
skipbelow=\topsep,
innertopmargin=1pt,
innerbottommargin=1pt,
]{siderules}
\newmdenv[
topline=true,
bottomline=true,
rightline=true,
leftline=true,
skipabove=\topsep,
skipbelow=\topsep,
innertopmargin=1ex,
innerbottommargin=1ex,
]{fullrules}
% Honourable mentions for packages which have been used in this preamble at some
% point in time.
%
% \RequirePackage{caption}
% \RequirePackage{comment}
% \RequirePackage{faktor}
% \RequirePackage{float}
% \RequirePackage{import}
% \RequirePackage{pdfpages}
% \RequirePackage{subcaption}
% \RequirePackage{transparent}
% \RequirePackage{url}
% \RequirePackage{xifthen}
% \RequirePackage{xspace}
% \RequirePackage{pgfplots}
% \pgfplotsset{width=12cm,compat=1.9}
% \usepgfplotslibrary{external}
% \RequirePackage{wasysym}
% The 'quotes' tikzlibrary, i.e. \usetikzlibrary{...,quotes}.
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout: Setting white space {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{setspace}
\iftoggle{concroman}{%
\iftoggle{classic}{%
\setstretch{1.75}
}{%
\setstretch{1.15}
}
}{%
\setstretch{1.1}
}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout: Geometry (deprecated) {{{{{
% Dynamically set margins for different page sizes.
% \newcommand\papersize[1]{%
% TT\fi
% \uppercase{\ifdim\csname #1@PAPER\endcsname}=\paperheight
% }
%
% \makeatletter
% \@namedef{A4@PAPER}{297mm}
% \@namedef{A5@PAPER}{210mm}
% \@namedef{B5@PAPER}{250mm}
% \@namedef{LETTER@PAPER}{11in}
% \@namedef{LEGAL@PAPER}{14in}
% \@namedef{EXECUTIVE@PAPER}{10.5in}
% \makeatother
% \if\papersize{a4}
% % Required to be able to set the page size
% \RequirePackage[
% left=1.35in,
% right=1.35in,
% top=1.35in,
% bottom=1.35in,
% headheight=20pt,
% headsep=0.3in,
% footskip=0.5in
% ]{geometry}
% \fi
% \if\papersize{a5}
% % Required to be able to set the page size
% \RequirePackage[
% left=0.6in,
% top=0.575in,
% right=.6in,
% bottom=0.55in,
% headheight=20pt,
% headsep=0.1in,
% footskip=0.15in
% ]{geometry}
% \fi
% }}}}}
% Page Layout: Title page {{{{{
% horizontal double rule top
\newcommand{\hdrulet}{\vspace{3ex}\rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt}\newline\rule{\textwidth}{0.4pt} \\ \vspace{1ex}}
% horizontal double rule bottom
\newcommand{\hdruleb}{\vspace{1ex}\rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt}\newline\rule{\textwidth}{1.6pt} \\ \vspace{3ex}}
% horizontal (single) rule top
\newcommand{\hrulet}{\vspace{3ex}\rule{\textwidth}{1.6pt} \\ \vspace{1ex}}
% horizontal (single) rule bottom
\newcommand{\hruleb}{\vspace{1ex}\rule{\textwidth}{1.6pt} \\ \vspace{3ex}}
% Double ruled title
\newcommand{\dTitle}[1]{~\\\hdrulet{\Large\textbf{#1}\\}\hdruleb~\\}
\newcommand{\PlainTitleLogo}[5]{%
\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
\includegraphics{#1} \\
\vspace{27.1728ex}
\iftoggle{concroman}{ { \MakeUppercase{#2} \\ } }{ #2 }
\vspace{12ex}
\, #3 \\
\vspace{10ex}
\iftoggle{concroman}{ {\large \MakeUppercase{#4} \\ } }{ {\large #4 \\ } }
\end{center}
\vfill
{\large \raggedright \parindent0pt #5 \vspace{10ex}}
}
}
\newcommand{\PlainTitleLogoExtra}[6]{%
\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
\includegraphics{#1} \\
\vspace{12.1728ex}
\iftoggle{concroman}{ { \MakeUppercase{#2} \\ } }{ #2 }
\vspace{12.1728ex}
#5
\vspace{12ex}
\, #3 \\
\vspace{10ex}
\iftoggle{concroman}{ {\large \MakeUppercase{#4} \\ } }{ {\large #4 \\ } }
\end{center}
\vfill
{\large \raggedright \parindent0pt #6 \vspace{6ex}}
}
}
\newcommand{\PlainTitleName}[5]{%
\iftoggle{concroman}{%
\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
{\LARGE #1} \\
\vspace{12.1728ex}
{\Huge #2 \\ }
\vspace{12ex}
\, #3 \\
\vspace{10ex}
{\LARGE #4\\ }
\end{center}
\vfill
{\large \parindent0pt \begin{flushleft} \iftoggle{concroman}{\iftoggle{classic}{\setstretch{1.75}}{\setstretch{1.1}}}{\setstretch{1.1}} #5 \end{flushleft} \vspace{10ex}}
}
}{}
}
\newcommand{\PlainTitle}[4]{%
\iftoggle{concroman}{%
\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
\vspace{12.1728ex}
{\Huge #1 \\ }
\vspace{12ex}
\, #2 \\
\vspace{10ex}
{\LARGE #3\\ }
\end{center}
\vfill
{\large \parindent0pt \begin{flushleft} \iftoggle{concroman}{\iftoggle{classic}{\setstretch{1.75}}{\setstretch{1.1}}}{\setstretch{1.1}} #4 \end{flushleft} \vspace{10ex}}
}
}{}
}
\newcommand{\PlainTitleShort}[4]{%
\AtBeginDocument{%
\thispagestyle{empty}
\begin{center}
\vspace{10.36ex}
#1
\vspace{3.456ex}
{\bfseries #2}
\vspace{3.456ex}
#3
\vspace{5.184ex}
#4
\end{center}
}
}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout: Justification rules {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \doublehyphendemerits=10000 % No consecutive line hyphens.
% \brokenpenalty=10000 % No broken words across columns/pages.
% \widowpenalty=9999 % Almost no widows at bottom of page.
% \clubpenalty=9999 % Almost no orphans at top of page.
% \interfootnotelinepenalty=9999 % Almost never break footnotes.
% \binoppenalty=9999 % Almost never break binary operators.
% \relpenalty=9999 % Almost never break binary relations.
\iftoggle{nobreaks}{}{%
\let\defaultldots\ldots
\renewcommand{\ldots}{\allowbreak\defaultldots\allowbreak}
}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\nottoggle{beamer}{%
% Page Layout: Headers and footers {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set pagestyle to be fancy as default in whole of document
\pagestyle{fancy}
% Clear old settings for headers and footers
\fancyhf{}
% Set headers and footers in document with
% \lhead{} \chead{} \rhead{}
% \lfoot{} \cfoot{} \rfoot{}
% Set line width for header and footer
\AtBeginDocument{\renewcommand{\headrulewidth}{0.5pt}}
\AtBeginDocument{\renewcommand{\footrulewidth}{0.5pt}}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{}
% Page Layout: Titles {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\nottoggle{beamer}{%
\RequirePackage{titlesec}
\iftoggle{centerstacktitles}{%
\titleformat{\section}[display]{\Large\filcenter}{\thesection}{0.5ex}{\bfseries}
}{}
}{}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout: Whitespace around align (display) environments {{{{{
\AtBeginDocument{\addtolength{\abovedisplayskip}{-1.25ex}}
\AtBeginDocument{\addtolength{\belowdisplayskip}{-1ex}}
\AtBeginDocument{\addtolength{\abovedisplayshortskip}{-1.25ex}}
\AtBeginDocument{\addtolength{\belowdisplayshortskip}{-1ex}}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout: Whitespace around center environments {{{{{
\let\defaultcenter\center
\let\defaultendcenter\endcenter
\renewenvironment{center}{\setlength\topsep{0.2em}\defaultcenter}{\defaultendcenter}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Generic tools {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% When referencing lists, often we need two write things such as
% "\textit{(iii)}" which is long. This macro "enumerated reference" makes it
% easier.
% Usage: \eref{<n>}
% Example: \eref{3}
\newcommand{\eref}[1]{(\romannumeral#1)}
% Using this macro allows us to change our mind on the style of definitions
% after the fact. For example, one could easily switch from italic to bold text.
% Usage: \define[[index]]{<text>}
% Example: A map is \define{continuous} if ...
% Example: A polynomial is \define[homogeneous polynomial]{homogeneous} if ...
\iftoggle{uldefobjs}{%
\NewDocumentCommand\define{o m}{%
\IfNoValueTF{#1}{\underline{#2}\index{#2}}{\underline{#2}\index{#1}}}
}{%
\iftoggle{scdefobjs}{%
\NewDocumentCommand\define{o m}{%
\IfNoValueTF{#1}{{\normalfont \textsc{#2}}\index{#2}}{\textsc{#2}\index{#1}}}
}{%
\iftoggle{milne}{%
\NewDocumentCommand\define{o m}{%
\IfNoValueTF{#1}{\textbf{\emph{#2}}\index{#2}}{\textbf{\emph{#2}}\index{#1}}}
}{%
\NewDocumentCommand\define{o m}{%
\IfNoValueTF{#1}{\emph{#2}\index{#2}}{\emph{#2}\index{#1}}}
}
}
}
% Middle Text Ascii Tilde. The default is too high, an appears above the
% character.
\iftoggle{concroman}{%
\newcommand{\mtextasciitilde}{\raisebox{-0.75ex}{\textasciitilde}}
}{%
\newcommand{\mtextasciitilde}{\textasciitilde}
}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\nottoggle{beamer}{%
% Maths Environments {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1. \newtheorem{<Internal name>}{<External name>}[<env>]
% Is counted after <env>. e.g.
% \newtheorem{corollary}{Corollary}[theorem]
% Theorem 1 is succeeded by Corollary 1.2
% 2. \newtheorem{<Internal name>}[<env>]{<External name>}[<env>]
% \newtheorem{corollary}[theorem]{Corollary}
% Is shares counter with <env>. i.e. Theorem 1 is succeeded by Corollary 2
% Declare a new theoremstyle
% \newtheoremstyle{mystyle}%
% {3pt} % Space above
% {3pt} % Space below
% {\itshape\color{red}} % Body font
% {} % Indent amount
% {\bfseries\color{blue}} % Theorem head font
% {.} % Punctuation after theorem head
% {.5em} % Space after theorem head
% {} % Theorem head spec (can be left empty, meaning 'normal')
%
% Numbering of environments example
% If we define
%
% \newtheorem*{proposition*}{Proposition}
% \newtheorem{proposition-extra}{Proposition*}
%
% then calling
%
% \begin{proposition*}
% ...
% \end{proposition*}
%
% Will create a non-numbered proposition (e.g. for a famous named theorem that
% will never be referenced to by a number: When 'The Heine-Borel' theorem will
% always be said, and not 'Theorem 3.14').
%
% and calling
%
% \begin{proposition-extra}
% ...
% \end{proposition-extra}
%
% will create a numbered proposition that is printed with a star (e.g. for
% extracurricular material).
% \underline is actually \ul from the soul package
% soul does not allow expanding text as an argument, unless it is wrapped in an
% \mbox call
\newtheoremstyle{ultheorem}%
{3pt} % Space above
{3pt} % Space below
{\itshape} % Body font
{} % Indent amount
{} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{\underline{\mbox{\thmname{#1}\thmnumber{ #2}}}\thmnote{ (#3)}} % Theorem head spec (can be left empty, meaning 'normal')
\newtheoremstyle{sctheorem}%
{3pt} % Space above
{3pt} % Space below
{\itshape} % Body font
{} % Indent amount
{\scshape} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning 'normal')
% \underline is actually \ul from the soul package
% soul does not allow expanding text as an argument, unless it is wrapped in an
% \mbox call
\newtheoremstyle{uldefinition}%
{3pt} % Space above
{3pt} % Space below
{} % Body font
{} % Indent amount
{} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{\underline{\mbox{\thmname{#1}\thmnumber{ #2}}}\thmnote{ (#3)}} % Theorem head spec (can be left empty, meaning 'normal')
\newtheoremstyle{scdefinition}%
{3pt} % Space above
{3pt} % Space below
{} % Body font
{} % Indent amount
{\scshape} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning 'normal')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Theorems
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iftoggle{ulthms}{%
\theoremstyle{ultheorem}
}{%
\iftoggle{scthms}{%
\theoremstyle{sctheorem}
}{%
\theoremstyle{plain}
}
}
% Base number off chapter if documentclass 'book' is selected, else use
% sections.
% This is crudely done by checking if the command '\chapter' exists.
% For some reason, if one tries to do this via
% \ifdef{\chapter} ...
% the compilation fails
\ifundef{\chapter}{%
\newtheorem{theorem}{Theorem}[section]
\numberwithin{equation}{section}
\numberwithin{figure}{section}
}{%
\newtheorem{theorem}{Theorem}[chapter]
\numberwithin{equation}{chapter}
\numberwithin{figure}{chapter}
}
\newtheorem*{theorem*}{Theorem}
\newtheorem{theorem-extra}{Theorem*}
% Number propositions after theorems
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{counterexample}[theorem]{Counterexample}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{generic-corollary}[theorem]{Corollary}
\newtheorem{important-exercise}[theorem]{Important Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{construction}[theorem]{Construction}
\newtheorem{propose}[theorem]{Propose}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{reminder}[theorem]{Reminder}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{important-remark}[theorem]{Remark}
% Numbered, but starred
\newtheorem{propose-extra}[theorem]{Propose*}
\newtheorem{proposition-extra}[theorem]{Proposition*}
\newtheorem{lemma-extra}[theorem]{Lemma*}
% Non-numbered
\newtheorem*{corollary*}{Corollary}
\newtheorem*{counterexample*}{Counterexample}
\newtheorem*{example*}{Example}
\newtheorem*{exercise*}{Exercise}
\newtheorem*{fact}{Fact}
\newtheorem*{fact*}{Fact}
\newtheorem*{lemma*}{Lemma}
\newtheorem*{propose*}{Propose}
\newtheorem*{proposition*}{Proposition}
\newtheorem*{construction*}{Construction}
\newtheorem*{important-remark*}{Remark}
% Always return to plain
\theoremstyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Remarks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{remark}
% Numbered remark (for referencing)
\newtheorem{nremark}[theorem]{Remark}
\newtheorem*{remark}{Remark}
\newtheorem*{Metaremark}{Thesis remark}
% Always return to plain
\theoremstyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iftoggle{uldefs}{%
\theoremstyle{uldefinition}
}{%
\iftoggle{scdefs}{%
\theoremstyle{scdefinition}
}{%
\theoremstyle{definition}
}
}
% Numbered after theorem
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{defining}[theorem]{Defining}
\newtheorem{definition-define}[theorem]{Define}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{definition-extra}[theorem]{Definition*}
\newtheorem{notation}[theorem]{Notation}
% Non-numbered
\newtheorem*{definition*}{Definition}
\newtheorem*{definition-extra*}{Definition*}
% Always return to plain
\theoremstyle{plain}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lecture counter {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create a lecture counter that can be invoked to create a note in the margin
% listing the lecture number and the date.
% Usage: \lecture{<Date>}
% Example: \lecture{1970.01.01}
\newcounter{lecture}
\newcommand{\lecture}[1]{%
\stepcounter{lecture}
\marginpar{\color{orange}\flushleft{\footnotesize Lecture: \thelecture{} #1}}
}
% }}}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{}
% Printable links {{{{{
\newcommand{\phref}[2]{\iftoggle{printlinks}{\href{#1}{#2}\footnote{#1}}{\href{#1}{#2}}}
% }}}}}
% Mathematical notation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\nottoggle{noletters}{
% Special Letters {{{{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For faster typesetting of the blackboard letters
\newcommand{\bA}{\mathbb{A}}
\newcommand{\bB}{\mathbb{B}}
\newcommand{\bC}{\mathbb{C}}
\newcommand{\bD}{\mathbb{D}}
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bF}{\mathbb{F}}
\newcommand{\bG}{\mathbb{G}}
\newcommand{\bH}{\mathbb{H}}
\newcommand{\bI}{\mathbb{I}}
\newcommand{\bJ}{\mathbb{J}}
\newcommand{\bK}{\mathbb{K}}
\newcommand{\bL}{\mathbb{L}}
\newcommand{\bM}{\mathbb{M}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bO}{\mathbb{O}}
\newcommand{\bP}{\mathbb{P}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bT}{\mathbb{T}}
\newcommand{\bU}{\mathbb{U}}
\newcommand{\bV}{\mathbb{V}}
\newcommand{\bW}{\mathbb{W}}
\newcommand{\bX}{\mathbb{X}}
\newcommand{\bY}{\mathbb{Y}}
\newcommand{\bZ}{\mathbb{Z}}
% For faster typesetting of the calligraphic letters
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cD}{\mathcal{D}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cG}{\mathcal{G}}
\newcommand{\cH}{\mathcal{H}}
\newcommand{\cI}{\mathcal{I}}
\newcommand{\cJ}{\mathcal{J}}
\newcommand{\cK}{\mathcal{K}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cM}{\mathcal{M}}
\newcommand{\cN}{\mathcal{N}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cQ}{\mathcal{Q}}
\newcommand{\cR}{\mathcal{R}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\cU}{\mathcal{U}}
\newcommand{\cV}{\mathcal{V}}
\newcommand{\cW}{\mathcal{W}}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\cY}{\mathcal{Y}}
\newcommand{\cZ}{\mathcal{Z}}
% For faster typesetting of the fraction letters
\newcommand{\fa}{\mathfrak{a}}
\newcommand{\fb}{\mathfrak{b}}
\newcommand{\fc}{\mathfrak{c}}
\newcommand{\fd}{\mathfrak{d}}
\newcommand{\fe}{\mathfrak{e}}
\newcommand{\ff}{\mathfrak{f}}
\newcommand{\fg}{\mathfrak{g}}
\newcommand{\fh}{\mathfrak{h}}
% \newcommand{\fi}{\mathfrak{i}}
\newcommand{\fj}{\mathfrak{j}}
\newcommand{\fk}{\mathfrak{k}}
\newcommand{\fl}{\mathfrak{l}}
\newcommand{\fm}{\mathfrak{m}}
\newcommand{\fn}{\mathfrak{n}}