-
Notifications
You must be signed in to change notification settings - Fork 1
/
preamble.tex
141 lines (127 loc) · 4.94 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
\documentclass[10pt,aspectratio=1610,table]{beamer}
\usepackage{hyperref} % Create hyperlinks in your document
% Use author-title-year bibstyle, copied from:
% https://tex.stackexchange.com/questions/249762/biblatex-verbose-style-adding-year-to-the-author-title-format
\usepackage[backend=bibtex, bibstyle=authoryear, citestyle=verbose-trad1, indexing=cite, giveninits=true, citepages=omit]{biblatex}
\newbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[parens]{%
\printtext[bibhyperref]{%
\printlabeldateextra}}}}
\renewbibmacro*{cite:name}{%
\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}%
\setunit*{\printdelim{nametitledelim}}}
\renewbibmacro*{cite:idem}{%
\bibstring[\mkibid]{idem\thefield{gender}}%
\setunit{\printdelim{nameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}%
\setunit{\printdelim{nametitledelim}}}
% \renewcommand*{\bibfont}{\tiny}
\addbibresource{bibliography.bib}
%\usepackage{newtxmath} % Use New TX font for math
%\usepackage{stix2} % Use stix2 font for math
\usepackage[no-math]{fontspec}
\usepackage{xeCJK} % Chinese font setting
\usepackage{tcolorbox} % Coloured boxes, for LATEX examples and theorems, etc
\tcbuselibrary{skins, breakable, theorems}
\usepackage{url} % Inserting urls
\usepackage{caption} % Customising captions in floating environments
\usepackage{verbatim}
\usepackage{multicol} % Multi-columns
\usepackage{multirow} % Multi-rows
\usepackage{booktabs} % Better tables
\usepackage{tikz} % For plot
\usepackage{pgf-pie} % For plotting pie chart
\usetikzlibrary{angles, arrows.meta, quotes, calc, intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{soul} % For smallcaps/striking out/highlighting
\sethlcolor{cuhklightyellow}
\usepackage{listings} % For source code
\usepackage{minted} % For source code
\usepackage{sourcecodepro} % For using source code pro as the default typewriter font
\usepackage{ifplatform} % For identifying OS platforms
\usepackage[vlined, ruled, linesnumbered]{algorithm2e} % For algorithms
\usepackage{algorithmic}
\usepackage{amsmath} % For math symbols
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{pifont}
\usepackage{varwidth}
\usepackage{braket} % For quantum Dirac notation
\usepackage{derivative} % For derivatives
\usepackage{microtype} % For typographical perfection
% Some packages and configurations for math
\usepackage{bm}
\renewcommand{\vec}[1]{\bm{#1}}
\DeclareMathOperator*{\E}{\mathbb{E}}
\DeclareMathOperator*{\Var}{\mathrm{Var}}
\DeclareMathOperator*{\Cov}{\mathrm{Cov}}
\DeclareMathOperator*{\argmin}{\mathrm{arg\,min\;}}
\DeclareMathOperator*{\argmax}{\mathrm{arg\,max\;}}
\def\ZZ{{\mathbb Z}}
\def\NN{{\mathbb N}}
\def\RR{{\mathbb R}}
\def\CC{{\mathbb C}}
\def\QQ{{\mathbb Q}}
\def\FF{{\mathbb F}}
\def\EE{{\mathbb E}}
\newcommand{\tr}{{\rm tr}}
\newcommand{\sign}{{\rm sign}}
\usepackage{bbm}
\usepackage{physics}
\let\div\divisionsymbol
\usepackage{blkarray}
\newcommand{\1}{\mathbbm{1}}
\newcommand{\inprod}[2]{\left\langle #1, #2 \right\rangle}
% \newcommand{\set}[1]{\left\{#1\right\}}
% Set minted style and font size, used for displaying source code
\setminted{frame=lines, breaklines, xleftmargin=16pt, linenos, fontsize=\fontsize{7}{7}, style=friendly, baselinestretch=1.2}
% For inline code, use the current font size
\makeatletter
\newcommand{\currentfontsize}{\fontsize{\f@size}{\f@baselineskip}\selectfont}
\makeatother
\setmintedinline{fontsize=\currentfontsize}
% Define CUHK theme colors
\definecolor{cuhkpurple}{RGB}{117,15,109}
\definecolor{cuhkyellow}{RGB}{221,163,0}
\definecolor{cuhkblackyellow}{RGB}{153,102,0}
\definecolor{cuhklightyellow}{RGB}{244,223,176}
% Define Theorem box style
\newtcbtheorem{theo}{Theorem}%
{enhanced, breakable,
colback = white, colframe = cuhkpurple, colbacktitle = cuhkpurple,
attach boxed title to top left = {yshift = -2mm, xshift = 5mm},
boxed title style = {sharp corners},
fonttitle = \sffamily\bfseries}{th}
% Define Chinese fonts
\setCJKmainfont{Noto Sans CJK TC}
\setCJKsansfont{Noto Sans CJK TC}
\setCJKmonofont{Noto Sans Mono CJK TC}
% Define English fonts
\usefonttheme{professionalfonts}
\setmainfont[Mapping=tex-text]{Lato}
\setsansfont{Lato}
\setmonofont{Source Code Pro}
% Template theme
\useoutertheme{infolines}
\setbeamertemplate{navigation symbols}{}
\usetheme[height=10mm]{Rochester}
\usecolortheme[named=cuhkpurple]{structure}
\setbeamercolor{block title example}{use=structure,fg=white, bg=cuhkyellow}
\setbeamercolor{block body example}{use=structure,fg=black, bg=cuhklightyellow}
\setbeamercolor{alerted text}{fg=cuhkpurple, bg=cuhklightyellow}
\setbeamercolor{frametitle}{fg=white, bg=cuhkpurple}
% Some useful definitions
\newcommand{\boxalert}[1]{{
\usebeamercolor{alerted text}\colorbox{bg}{\alert{#1}}
}}
\newcommand{\cmark}{\ding{51}}
\newcommand{\xmark}{\ding{55}}
%% Logo
\titlegraphic{
\includegraphics[width=4cm]{The-Chinese-University-of-Hong-Hong-logo.eps}
}