summaryrefslogtreecommitdiffstats
path: root/preamble.tex
blob: 9f724684db92125b2d8c1368957286e38d0412a3 (plain) (blame)
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
%! TeX program = lualatex
\documentclass[UKenglish,12pt,BCOR=10mm]{scrartcl}

\usepackage[defaultfeatures={%
    Ligatures={TeX,Common,Discretionary}
  },nomath]{libertinus}
\usepackage{xcolor}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{selnolig}
\usepackage{amsmath,amsthm}
\usepackage{mathtools}
\usepackage[colon=literal]{unicode-math}
\usepackage{enumitem}
\usepackage{tcolorbox}
\usepackage[style=ext-numeric]{biblatex}
\usepackage[intoc]{nomencl}
\usepackage{makeidx}
\usepackage{idxlayout}
\usepackage{hyperref}
\usepackage{bookmark}
\usepackage{hypdestopt}
\usepackage[capitalise]{cleveref}
%\usepackage{refcheck}

% ---------- fontspec
\setfontfamily\fausansoffice{FAUSansOffice}
\setmathfont[Scale=MatchLowercase]{New Computer Modern Math}
% restore traditional bb and cal glyphs
\let\mathbb\relax\DeclareMathAlphabet\mathbb{U}{msb}{m}{n}
\let\mathcal\relax\DeclareMathAlphabet\mathcal{OMS}{cmsy}{m}{n}

% ---------- xcolor
\definecolor{faunat}{RGB}{29,134,73}
\definecolor{linkcolor}{RGB}{134,29,38} % split complementary method

% ---------- koma-script
\KOMAoptions{%
  numbers=noenddot,
  index=totoc
}
\addtokomafont{sectioning}{\fausansoffice\color{faunat}}
% keep layout when removing BCOR=10mm
%\areaset{426.8pt}{635.5pt}

% ---------- selnolig
\nolig{tz}{t|z}
%\debugon

% ---------- amsmath
\numberwithin{equation}{section}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\dom}{dom}
% extend amsmath's proof environment
\NewDocumentEnvironment{myproof}{Ob}{\IfNoValueTF{#1}{\begin{proof}}{\begin{proof}[\proofname\ of \Cref{#1}]}}{\end{proof}}

% ---------- mathtools
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\DeclarePairedDelimiter\parens{\lparen}{\rparen}
\DeclarePairedDelimiter\bracks{\lbrack}{\rbrack}
\DeclarePairedDelimiter\braces{\lbrace}{\rbrace}
\DeclarePairedDelimiter\angles{\langle}{\rangle}
\DeclarePairedDelimiter\bra{\lvert}{\rangle}
\DeclarePairedDelimiter\ket{\langle}{\rvert}
\DeclarePairedDelimiterX\innerp[2]{\langle}{\rangle}{#1,#2}

% ---------- tcolorbox
\tcbuselibrary{skins,theorems} % add breakable library?
\tcbset{%
  beforeafter skip balanced=0.4\baselineskip,
  mythmstyle/.style={%
    enhanced,
    sharp corners=all,
    interior hidden,
    borderline west={3pt}{0pt}{#1},
    colframe=#1!25,
    coltitle=black,
    fonttitle=\bfseries,
    toptitle=0.6ex,
    left=3pt+0.6ex,
    bottom=0.6ex,
    top=0.6ex,
    theorem style=break,
    separator sign={\ \mdseries---},
    description delimiters none,
    terminator sign none,
  }
}
\newcounter{mythmcounter}
\counterwithin{mythmcounter}{section}
\newcommand{\mynewthm}[2]{%
  \newtcbtheorem[%
    use counter*=mythmcounter,
    Crefname={\MakeTitlecase{#1}}{\MakeTitlecase{#1s}}
    ]{#1}{\MakeTitlecase{#1}}{mythmstyle=#2}{#1}
}
\mynewthm{definition}{gray}
\mynewthm{example}{gray}
\mynewthm{remark}{gray}
\mynewthm{theorem}{faunat}
\mynewthm{lemma}{faunat}
\mynewthm{proposition}{faunat}
\mynewthm{corollary}{faunat}

% ---------- biblatex
\addbibresource[glob]{bib/*.bib}
\ExecuteBibliographyOptions{%
  refsegment=section,
  sorting=none,
  defernumbers,
  giveninits,
  backref,
}
\defbibheading{subbibliography}{%
  \bookmarksetupnext{level=subsection,italic}
  \pdfbookmark{\refname}{refbm:\arabic{refsegment}}
  \subsection*{\refname\ for \Cref*{refsegment:\therefsection\therefsegment}}
}
\DefineBibliographyStrings{english}{%
  backrefpage={ref.\ on p.},
  backrefpages={ref.\ on pp.}
}
\DeclareFieldFormat[article]{volume}{\textbf{#1}}
\DeclareFieldFormat[article]{title}{\textit{#1}}
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\renewcommand{\mkbibnamegiven}[1]{\textsc{#1}}
\renewcommand{\mkbibnameprefix}[1]{\textsc{#1}}
\renewcommand{\mkbibnamesuffix}[1]{\textsc{#1}}
% https://tex.stackexchange.com/questions/574292
\renewcommand*{\subtitlepunct}{\addcolon\space}
\DeclarePunctuationPairs{colon}{*}

% ---------- nomencl
\makenomenclature
\def\pagedeclaration#1{, \hyperlink{page.#1}{page\nobreakspace#1}}

% ---------- makeidx
\makeindex

% ---------- hyperref
\hypersetup{%
  colorlinks,
  allcolors=linkcolor,
  linktoc=all,
  bookmarksnumbered,
  bookmarksopen,
  bookmarksopenlevel=2,
  hypertexnames=false,
  pdftitle={Title},
  pdfauthor={Justin Gassner},
  pdfsubject={Subject},
  pdfkeywords={Keyword1, Keyword2},
}

% ---------- more pdf stuff
\pdfvariable minorversion 6
\pdfvariable suppressoptionalinfo \numexpr
        0
    +   1   % PTEX.FullBanner
    +   2   % PTEX.FileName
    +   4   % PTEX.PageNumber
    +   8   % PTEX.InfoDict
    +  16   % Creator
    +  32   % CreationDate
    +  64   % ModDate
    + 128   % Producer
    + 256   % Trapped
    + 512   % ID
\relax

% ---------- misc
\renewcommand\phi\varphi
\renewcommand\epsilon\varepsilon
% number systems
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\CC}{\mathbb{C}}
% emphasis for defined terms
\newcommand{\defn}[1]{\textbf{\textit{#1}}}
% Hilbert spaces
\newcommand{\hilb}[1]{\mathcal{#1}}
% Fourier transformation
\newcommand{\ft}[1]{\hat{#1}}
\newcommand{\FT}[1]{\mathcal{F}\parens*{#1}}
\newcommand{\iFT}[1]{\mathcal{F}^{-1}\parens*{#1}}
% normal ordering (aka Wick ordering)
\newcommand{\normord}[1]{{\vcentcolon\mathrel{#1}\vcentcolon}}