-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
134 lines (104 loc) · 3.54 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
% Codification of the document
\usepackage[utf8]{inputenc}
% Page size and margins
\usepackage{geometry}
% Hyperlink
\usepackage{color}
\usepackage[svgnames]{xcolor}
\usepackage[colorlinks,citecolor=DarkGreen,linkcolor=FireBrick,linktocpage,unicode]{hyperref}
% Bibtex (load after hyperref)
\usepackage[sort&compress,numbers]{natbib}
\usepackage{doi}
% Inline citation
\usepackage{bibentry}
\nobibliography*
% Mathematical features
\usepackage{amsmath, amssymb}
\usepackage{mathtools}
% Theorems
% https://tex.stackexchange.com/questions/45817/theorem-definition-lemma-problem-numbering
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{them}{Theorem}[section] % Reset numbering for each section
\theoremstyle{definition}
\newtheorem{defn}[them]{Definition}
\newtheorem{prop}[them]{Proposition}
\usepackage{bm}
% Font: Times-like
\usepackage{lmodern}
%
% \usepackage{newtxtext,newtxmath}
%
%\usepackage{libertine}
%\usepackage{libertinust1math}
%\usepackage[T1]{fontenc}
% URL
\usepackage{url}
% Images
\usepackage{graphicx}
% Chemical formula
\usepackage[version=3]{mhchem}
% Copyright symbol
\usepackage{textcomp}
% Sideway table
\usepackage{rotating}
% Tikz
\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,shapes}
% Appendix
\usepackage[titletoc,toc]{appendix}
% Add bibliography in TOC
\usepackage[nottoc]{tocbibind}
% Align table columns on decimal points
\usepackage{dcolumn}
% Screen
\usepackage{ascmac}
% Relative import
\usepackage{import}
% Subfigures and subtables
\usepackage{caption}
\usepackage{subcaption}
% pseudocode
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
% https://tex.stackexchange.com/questions/480600/representing-objects-classes-in-latex
\algdef{SE}% flags used internally to indicate we're defining a new block statement
[STRUCT]% new block type, not to be confused with loops or if-statements
{Struct}% "\Struct{name}" will indicate the start of the struct declaration
{EndStruct}% "\EndStruct" ends the block indent
[1]% There is one argument, which is the name of the data structure
{\textbf{struct} \textsc{#1}}% typesetting of the start of a struct
{\textbf{end struct}}% typesetting the end of the struct
% https://tex.stackexchange.com/questions/32598/force-latex-image-to-appear-in-the-section-in-which-its-declared
% \usepackage[section]{placeins}
% https://stackoverflow.com/questions/1061112/eliminate-space-before-beginitemize
\usepackage{enumitem}
\setlist{nolistsep}
% Misc
\usepackage[normalem]{ulem}
% Rename bibliography section
% https://latex.org/forum/viewtopic.php?t=28709
\renewcommand{\bibname}{References}
% https://tex.stackexchange.com/questions/22191/forcing-a-figure-strictly-on-a-separate-page
\usepackage{afterpage}
% Japanese with pdflatex
\usepackage{CJKutf8}
% Codeblock
\usepackage{listings}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
% https://zrbabbler.hatenablog.com/entry/20120411/1334151482
\newcommand{\relmiddle}[1]{\mathrel{}\middle#1\mathrel{}}
\newcommand{\set}[2]{\left\{ #1 \relmiddle| #2 \right\}}
\DeclareMathOperator{\morethan}{>}
\newcommand{\software}[1]{\textsc{#1}}
\newcommand{\term}[1]{\textit{#1}}
\newcommand{\todo}[1]{\textcolor{red}{TODO: #1}}
\newcommand{\onlinecite}[1]{\cite{#1}} % Just for backward compatibility
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}