-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacros.tex
172 lines (141 loc) · 4.9 KB
/
macros.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
\renewcommand{\baselinestretch}{1} % for squeezing the draft into the page limit, do not use
% Note
% Use \textsc{Name} to separate images, videos, dataset names from the main texts.
% =============================================================================
% Commonly used packages
% =============================================================================
% For removing Package ifpdf Error
%%%%%%\let\ifpdf\relax
% For removing LaTeX Font Warning
\usepackage{lmodern}
% Add Reference in Contents
\usepackage[nottoc]{tocbibind}
% Figures
%\usepackage{subcaption}
\usepackage{float}
%\usepackage[justification=raggedright]{caption} % makes captions ragged right - thanks to Bryce Lobdell
\usepackage{lscape} % Useful for wide tables or figures.
\usepackage{makecell}
\usepackage{sidecap}
% Algorithm
\usepackage[lined,ruled,linesnumbered]{algorithm2e}
\usepackage{algorithmic}
% Table and list
\usepackage{booktabs} % Publication quality tables
\usepackage{multirow}
\usepackage{rotating} % sideways
\newcommand{\vergap}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand{\horgap}[1]{\setlength{\tabcolsep}{#1}}
%\specialrule{width}{abovespace}{belowspace}
\newcommand{\dtoprule}{\specialrule{2pt}{0pt}{2pt}}
\newcommand{\dbottomrule}{\specialrule{2pt}{0pt}{\belowrulesep}}
\usepackage{paralist}
\usepackage{caption}
\usepackage{enumitem}
% Math
\usepackage{bm} % Make bold, italic math symbols
\usepackage{epsfig} % for figures
\usepackage{graphicx} % another package that works for figures
\graphicspath{{figure/}}
\usepackage{times}
%\usepackage{mathptmx}
\usepackage{mathtools}
\usepackage{textcomp, gensymb} % math symbol
\usepackage{amssymb,amsmath,amsfonts} % Short math guide for LaTeX ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
\usepackage{siunitx} % SI units
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\cp}[1]{\left[#1\right]_{\times}}
% Fonts
\usepackage{units}
\usepackage{color}
% Comments
\usepackage{comment}
% for adding NTU logo
\usepackage{eso-pic}
% Hyperlinks
\usepackage{url} % Hyphenation of URLs.
\usepackage{xcolor}
\usepackage[backref=page]{hyperref}
\hypersetup{colorlinks,breaklinks,
urlcolor=[rgb]{0.918,0,0.545},
linkcolor=[rgb]{0.710,0.180,0.141},
citecolor=[rgb]{0,0.545,0.447}}
\usepackage{bookmark}
%\usepackage[pagebackref=true,breaklinks=true,colorlinks,bookmarks=false]{hyperref} % remove letterpaper=true,
%
\usepackage{xspace}
%\usepackage[table,caption=false]{xcolor}
%\usepackage{setspace}
% Better hyphenation
\usepackage{microtype}
% Appendix
\usepackage[toc,page]{appendix}
% =========================================
% Useful macros
% =========================================
% Latin abbreviations
\newcommand{\etal}{\emph{et al}.} % ``and others'', ``and co-workers''; NOTE: use \etal{} for correct spacing
\newcommand{\eg}{\emph{e.g.},~} % ``for example''
\newcommand{\ie}{\emph{i.e.},~} % ``that is'', ``in other words''
% Math related
\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\argmax}{\arg\!\max}
\DeclareMathOperator{\avg}{avg}
\DeclareMathOperator{\Tr}{Tr}
% Paragraph
\let\originalparagraph\paragraph
\renewcommand{\paragraph}[2][.]{\originalparagraph{#2#1}}
% Consistent margin adjustment for paragraphs, figures, and sections
\newlength\paramargin
\newlength\figmargin
\newlength\secmargin
\setlength{\secmargin}{0.0mm}
\setlength{\paramargin}{0.0mm}
\setlength{\figmargin}{0.0mm}
\renewcommand{\arraystretch}{0.8}
\setlength{\tabcolsep}{4.5pt}
\captionsetup[table]{skip=5pt}
\let\oldtabular\tabular
\renewcommand{\tabular}{\footnotesize\oldtabular}
% References for figures, tables, equations, chapters, and sections
\newcommand{\chref}[1]{Chapter~\ref{ch:#1}}
\newcommand{\secref}[1]{Section~\ref{sec:#1}}
\newcommand{\figref}[1]{Figure~\ref{fig:#1}}
\newcommand{\tabref}[1]{Table~\ref{tab:#1}}
\newcommand{\eqnref}[1]{\eqref{eq:#1}}
\newcommand{\thmref}[1]{Theorem~\ref{#1}}
\newcommand{\prgref}[1]{Program~\ref{#1}}
\newcommand{\algref}[1]{Algorithm~\ref{#1}}
\newcommand{\clmref}[1]{Claim~\ref{#1}}
\newcommand{\lemref}[1]{Lemma~\ref{#1}}
\newcommand{\ptyref}[1]{Property~\ref{#1}}
% Comments
\long\def\ignorethis#1{}
\newcommand {\sychien}[1]{{\color{blue}\textbf{Po-Chen: }#1}\normalfont}
\newcommand {\coauthorA}[1]{{\color{red}\textbf{Co-author A: }#1}\normalfont}
\newcommand {\coauthorB}[1]{{\color{magenta}\textbf{Co-author B: }#1}\normalfont}
\newcommand {\todo}{{\textbf{\color{red}[TO-DO]\_}}}
\def\newtext#1{\textcolor{blue}{#1}}
\def\modtext#1{\textcolor{red}{#1}}
%\usepackage{ifthen}
%\ifthenelse{\equal{\final}{1}}
%{
% \renewcommand{\sychien}[1]{}
%}
%{}
\newcommand{\tb}[1]{\textbf{#1}}
\newcommand{\mb}[1]{\mathbf{#1}}
\newcommand{\Paragraph}[1]{\noindent\textbf{#1}}
\newcommand{\jbox}[2]{
\fbox{%
\begin{minipage}{#1}%
\hfill\vspace{#2}%
\end{minipage}%
}
}
\newcommand{\jblock}[2]{%
\begin{minipage}[t]{#1}\vspace{0cm}\centering%
#2%
\end{minipage}%
}
% Customized definition