-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
155 lines (116 loc) · 3.78 KB
/
preamble.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
% Font support (Xelatex)
\usepackage{fontspec}
% Langeuage support (replaces babel)
\usepackage{polyglossia}
\setmainlanguage{english}
% Basic math support
\usepackage[fleqn]{mathtools} % Fixes amsmath + other goodness
\usepackage{amsmath,amssymb,amsthm}
\mathtoolsset{centercolon}
% Multiline comment (\begin{comment}...\end{comment})
\usepackage{comment}
% Colors
\usepackage[svgnames,dvipsnames]{xcolor}
% xcolor -> usenames option is obsolete
% Nice lists
\usepackage{enumerate}
\usepackage{enumitem}
% Things To-Do. -> \todo, \missingfigure
%\usepackage[textsize=scriptsize,shadow]{todonotes}
% finicky micro-typography
\usepackage{microtype}
% Underline support -> \ul
\usepackage[normalem]{ulem}
% Lorem ipsum -> \blindtext
\usepackage{blindtext}
% Alternative:
% \usepackage{lipsum}
% -> \stackrel
\usepackage{stackrel}
% Links and cross-refrences
\usepackage{hyperref}
\usepackage[nameinlink]{cleveref}
\hypersetup{
colorlinks=true,
urlcolor=blue,
}
% Source code blocks with highlighting
% TODO: test if tectonic and if so enable
% DOC: https://ctan.javinator9889.com/macros/latex/contrib/minted/minted.pdf
%\usepackage[cache=false]{minted}
\usepackage[outputdir=./tmp/]{minted}
% https://tex.stackexchange.com/questions/343494/
\usepackage{xpatch}
\makeatletter
\AtBeginEnvironment{minted}{\dontdofcolorbox}
\def\dontdofcolorbox{\renewcommand\fcolorbox[4][]{##4}}
\xpatchcmd{\inputminted}{\minted@fvset}{\minted@fvset\dontdofcolorbox}{}{}
\xpatchcmd{\mintinline}{\minted@fvset}{\minted@fvset\dontdofcolorbox}{}{} % see https://tex.stackexchange.com/a/401250/
\makeatother
% Bibliography
% ... not worth the trouble for notes ...
% but watch: https://github.com/tectonic-typesetting/tectonic/issues/35
% Symbols
% See: https://www.math.utk.edu/~finotti/sm14/m504/symbols.pdf
% Only include some symbols
\usepackage[only,varoplus,varotimes]{stmaryrd}
\usepackage{wasysym}
% --> \mathbbm{1} (characteristic function)
\usepackage{bbm}
\usepackage{bm}
% Bra-ket notation
\usepackage{braket}
%\pdfminorversion=7
\usepackage{nicematrix}
\usepackage{tikz}
%%%%%%%%%%%%%%%%%%%
%%% PAGE LAYOUT %%%
%%%%%%%%%%%%%%%%%%%
% \newcommand{\mysep}{\vspace{.2in} \hrule \vspace{-.1in}}
% Horizontal rule that disappears if at the top of the page
\newcommand\disappearingrule{%
\par % make sure we end a paragraph
\leaders\vrule width \textwidth\vskip0.6pt % rule thickness
\nointerlineskip % disable interline glue here
\vskip10pt % space below the rule
}
% Add a rule before the section titles.
\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
\Ifstr{#1}{section}{
\disappearingrule
\textbf{}\@hangfrom{\hskip #2#3}{#4}%
}{%else (not a section; use default definition)
\textbf{}\@hangfrom{\hskip #2#3}{#4}%
}
}
\makeatother
\usepackage[open,openlevel=1]{bookmark}
\bookmarksetup{}
% KOMA-script options [should be after setting fonts, etc.]
% TODO: try margins etc with \areaset (KOMA)
\KOMAoptions{
% page layout using DIV-part division (do NOT use geometry except for showframe)
% with selected font: 11 -> 80 ch/line, 12 -> 90 ch/line, 13 -> 100 ch/line
DIV=13,
%twoside=semi, % ->
% -> two-sided printing with one-sided margins and one-sided marginal notes
numbers=noenddot % Sections without a dot
}
% KOMA page options
% \pagestyle{myheadings}
\usepackage{scrlayer-scrpage}
\renewcommand{\headfont}{\normalfont} % No italics
% \clearpairofpagestyles % Clear all defaults
\setkomafont{author}{\titlefont\normalfont}
\setkomafont{date}{\titlefont\normalfont}
\KOMAoptions{headsepline = true, footsepline = true}
\makeatletter
% \ihead{\protect\@title}
% \ohead{\protect\studentname}
\ohead{\protect\@title}
\cfoot{\pagemark}
\makeatother
% TODO: redo this more elegantly...
\setlength{\parindent}{0pt}
\setlength{\parskip}{3pt}