-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypography.tex.preamble
More file actions
142 lines (125 loc) · 5.55 KB
/
Copy pathtypography.tex.preamble
File metadata and controls
142 lines (125 loc) · 5.55 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
% vim: ft=tex
% ------------------------------------------------------------
%
% MATH
%
% ------------------------------------------------------------
\usepackage{amsmath}
\everymath{\displaystyle}
\renewcommand{\arcsin}{\sin^{-1}}
\renewcommand{\arccos}{\cos^{-1}}
\renewcommand{\arctan}{\tan^{-1}}
% ------------------------------------------------------------
%
% FONTS
%
% ------------------------------------------------------------
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{fontawesome5}
\setmainfont{TeX Gyre Pagella}
\setmonofont{Iosevka Term}
\setmathfont{STIX Two Math}
\setmathfont[range="20D0-"20FF]{TeX Gyre Pagella Math}
\setmathfont[range=bb]{TeX Gyre Termes Math}
\setmathfont[range=\int]{Latin Modern Math}
\setmathfont[range=\underbrace]{Latin Modern Math}
\newfontface{\emojifont}{Noto Color Emoji}[Renderer=Harfbuzz]
% ------------------------------------------------------------
%
% COLOUR SCHEME
%
% ------------------------------------------------------------
\usepackage[dvipsnames]{xcolor}
% ============================================================
% Western University brand colours
% Source: https://brand.westernu.ca/visual-identity/colours.html
% ============================================================
% Primary colours
\definecolor{WesternPurple}{HTML}{4F2683} % PMS 268 C | CMYK 82/100/0/12 | RGB 79/38/131
\definecolor{WesternWhite}{HTML}{FFFFFF} % RGB 255/255/255
% Secondary colours
\definecolor{WesternOrchid}{HTML}{8F55E0} % PMS 265 C | RGB 154/100/246
\definecolor{WesternDeepFocus}{HTML}{201436}% PMS 275 C | CMYK 85/90/45/60 | RGB 32/20/54
\definecolor{WesternBlack}{HTML}{000000} % PMS Black 6C
\definecolor{WesternGrey}{HTML}{818284} % PMS Cool Gray 6C | CMYK 0/0/0/60 | RGB 129/130/132
% Accent colours (use sparingly for small graphic elements only)
\definecolor{WesternSky}{HTML}{7DEAFB} % CMYK 40/0/0/0 | RGB 125/234/250
\definecolor{WesternSpring}{HTML}{B9F876} % CMYK 40/0/80/0 | RGB 185/248/118
\definecolor{WesternVivid}{HTML}{FCF05E} % CMYK 5/0/75/0 | RGB 252/240/94
\definecolor{WesternTiger}{HTML}{F0A757} % CMYK 0/20/80/0 | RGB 240/167/87
\definecolor{main}{HTML}{007355} % teal
\definecolor{supp}{HTML}{82218B} % purple
\definecolor{attn}{HTML}{B8860B} % dark gold
\definecolor{warn}{HTML}{D20000} % red
\definecolor{link}{HTML}{1A5C9A} % blue
% highlight commands
\newcommand{\hlmain}[1]{{\color{main}#1}}
\newcommand{\hlsupp}[1]{{\color{supp}#1}}
\newcommand{\hlattn}[1]{{\color{attn}#1}}
\newcommand{\hlwarn}[1]{{\color{warn}#1}}
\newcommand{\emmain}[1]{{\color{main}\emph{#1}}}
\newcommand{\emsupp}[1]{{\color{supp}\emph{#1}}}
\newcommand{\emattn}[1]{{\color{attn}\emph{#1}}}
\newcommand{\emwarn}[1]{{\color{warn}\emph{#1}}}
\newcommand{\ulmain}[1]{{\color{main}\underline{#1}}}
\newcommand{\ulsupp}[1]{{\color{supp}\underline{#1}}}
\newcommand{\ulattn}[1]{{\color{attn}\underline{#1}}}
\newcommand{\ulwarn}[1]{{\color{warn}\underline{#1}}}
% update notes -- single source for main.tex, slides.tex and polls.tex
\newcommand{\updatenote}[1]{{\textcolor{magenta}{Updated. #1}}}
% URL
\NewDocumentCommand{\link}{O{}m}{%
\IfBlankTF{#1}%
{\href{#2}{{\footnotesize\ttfamily\color{link}{#2}\;\faExternalLink*}}}%
{\href{#2}{{\footnotesize\ttfamily\color{link}{#1}\;\faExternalLink*}}}%
}
% A figure set beside the text rather than above it. The body is the text;
% the figure is the argument, set flush right in an \rlap so it takes no
% horizontal space and \smash'ed so it takes none vertically, while
% \rightskip narrows the text column for as long as the environment lasts.
% Deliberately not a minipage: a minipage would impose its own list
% parameters, and the enumerate/itemize inside would lose the document's
% spacing.
%
% \begin{sidefigure}{\includestandalone[page=3, width=\sidefigwidth]{...}}
% text, lists, whatever
% \end{sidefigure}
%
% The optional argument is the fraction of \textwidth the figure gets
% (default 0.38); \sidefigwidth is that width, for sizing the graphic, and
% \sidefiggutter is the space kept between the two columns. If the figure
% is taller than the text beside it, the environment adds the difference as
% vertical space, so what follows starts below the figure.
\newlength{\sidefigwidth}
\newlength{\sidefiggutter}
\setlength{\sidefiggutter}{1.5em}
\newsavebox{\sidefigbox}
\NewDocumentEnvironment{sidefigure}{O{0.38} m}
{\par
\setlength{\sidefigwidth}{#1\textwidth}%
\sbox{\sidefigbox}{#2}%
\edef\sidefigystart{\the\pagetotal}%
\begingroup
% Narrow the writing column: \hsize carries the paragraphs and the list
% items, \linewidth and \columnwidth carry anything that measures the
% column for itself, such as \blanks. Narrowing \rightskip instead
% would not survive a list -- every \item resets it, and the items would
% then run under the figure.
\dimen0=\dimexpr\sidefigwidth+\sidefiggutter\relax
\advance\hsize-\dimen0
\advance\linewidth-\dimen0
\advance\columnwidth-\dimen0
\noindent\rlap{\hspace*{\dimexpr\textwidth-\sidefigwidth\relax}%
\smash{\raisebox{-\height}{\usebox{\sidefigbox}}}}%
\ignorespaces}
{\par
\endgroup
% How much vertical space the text took; pad out to the figure's height
% if it took less. Capped at the figure height so a page break inside
% the environment cannot turn this into a runaway skip.
\dimen0=\dimexpr\ht\sidefigbox+\dp\sidefigbox-\pagetotal+\sidefigystart\relax
\ifdim\dimen0>\dimexpr\ht\sidefigbox+\dp\sidefigbox\relax
\dimen0=\dimexpr\ht\sidefigbox+\dp\sidefigbox\relax
\fi
\ifdim\dimen0>0pt\relax\vspace*{\dimen0}\fi}