-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.tex
213 lines (182 loc) · 6.52 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
% !TEX root = oa-sampling.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Additional packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% extra options for table
% remove this if thing looks different
% \usepackage{colortbl}
\usepackage{xcolor}
\usepackage{xfrac}
% \usepackage{float}
\usepackage{paralist}
\usepackage{url}
% \usepackage[usenames,dvipsnames]{xcolor}
\hypersetup{
% colorlinks=true,
% linkcolor=black,
% citecolor=black,
% urlcolor=black,
breaklinks=true
}
% \hypersetup{draft}% include if you get errors about a link spanning page breaks
\usepackage[sharp]{easylist}
\let\proof\relax
\let\endproof\relax
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{bm}
% \usepackage{pdfpages}
\usepackage{wrapfig}
\usepackage{adjustbox}
% \usepackage{subfig}
% \usepackage{subcaption}
\usepackage{units}
\usepackage{siunitx}
%\sisetup{output-exponent-marker=\ensuremath{\mathrm{e}}}
\sisetup{exponent-product=\!\!\times\!\!}
\usepackage{soul}
\usepackage{array}
% \usepackage{calc}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{xspace}
% \usepackage[percent]{overpic}
\usepackage{enumitem}
% \usepackage{afterpage}
\usepackage[normalem]{ulem} % for strike-through (\sout)
% \usepackage{multirow}
% \usepackage[makeroom]{cancel}
% \usepackage{bm}
\usepackage[utf8]{inputenc}
% % for commenting
% \usepackage[final]{pdfcomment} % for Final draft
\usepackage[outline]{contour}
%\contourlength{0.5em}
% \usepackage{tcolorbox}
\usepackage{datatool} % for reading CSV files
\usepackage{readarray}
% \usepackage{inconsolata}
% \usepackage[scaled=0.9]{FiraMono}
\usepackage{listings}
%\usepackage[capitalize]{cleveref}
%New colors defined below
\definecolor{codegreen}{rgb}{0,0.5,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{codered}{rgb}{0.9,0,0}
% \definecolor{codeblue}{rgb}{0.13,0.13,1}
\definecolor{codeblue}{rgb}{0.15,0.2,.83}
% \definecolor{otherkeywords}{rgb}{0.07,0.22,.48}
%Code listing style named "mystyle"
\makeatletter
\lstdefinestyle{mystyle}{
captionpos=t,
keepspaces=true,
numbers=left,
numbersep=1em,
tabsize=4,
showspaces=false,
showtabs=false,
breaklines=true,
frame=lines,
showstringspaces=false,
breakatwhitespace=true,
escapeinside={(*@}{@*)},
commentstyle=\color{codegreen},
keywordstyle=\color{codeblue}\bfseries,
stringstyle=\color{codered},
numberstyle=\ttfamily\fontsize{6.65}{7.5}\selectfont\color{codegray}\bfseries,
basicstyle=\ttfamily\lst@ifdisplaystyle\fontsize{6.65}{7.5}\else\fontsize{8.65}{9.5}\fi\selectfont
}
%"mystyle" code listing set
\lstset{style=mystyle}
\lstset{
emph={randfloat,permute,boseOA,bushOA,offset,pow,evalPoly,toBaseS,allBut1,allButJ},
emphstyle=\ttfamily\lst@ifdisplaystyle\fontsize{6.65}{7.5}\else\fontsize{8.65}{9.5}\fi\selectfont\color{codepurple}
}
\makeatother
% \def\inline{\lstinline[basicstyle=\ttfamily\fontsize{8.65}{9.5}\selectfont]}
% \lstset{emph={vector},emphstyle=\ttfamily\fontsize{6.65}{7.5}\selectfont\color{codeblue}\bfseries}
\newtheorem{mydef}{Definition}
%Comments
% Select the type of commenting you want to use: none, pdf margin comments, or in-text comments
% \newcommand{\COMMENT}[3]{} % for Final draft, removes comments
% \newcommand{\COMMENT}[3]{\pdfcomment[avatar=#1]{#1: #3}} % For work in progress using PDF annotations
\newcommand{\COMMENT}[3]{\textcolor{#2}{{\footnotesize[\textsc{#1}: #3}]}} % For work in progress using in-text comments
%\titlespacing*{\paragraph}{0pt}{0.2\baselineskip}{\baselineskip}
\newcommand{\TODO}[1]{\COMMENT{TODO}{red}{#1}}
\newcommand{\WJ}[1]{\COMMENT{WJ}{blue}{#1}}
\renewcommand{\AE}[1]{\COMMENT{AE}{orange}{#1}}
\newcommand{\PC}[1]{\COMMENT{PC}{teal}{#1}}
\newcommand{\AK}[1]{\COMMENT{AK}{olive}{#1}}
\newcommand{\CK}[1]{\COMMENT{CK}{purple}{#1}}
\newcommand{\IGNORE}[1]{}
\definecolor{DarkGreen}{rgb}{0.0,0.6,0.2}
\newcommand{\REMOVE}[1]{{\color{red}\sout{#1}}} % for work in progress
\newcommand{\ADD}[1]{{\textcolor{DarkGreen}{#1}}} % for work in progress
% \newcommand{\ADD}[1]{#1} % for work in progress
\newcommand{\REPLACE}[2]{\ADD{#2}} % for work in progress, showing the old text
% \definecolor{CancelColor}{rgb}{0.7,0.7,0.7}
% \renewcommand{\CancelColor}{\color{CancelColor}}
% \crefname{lstlisting}{listing}{listings}
% \Crefname{lstlisting}{Listing}{Listings}
% \crefname{lstnumber}{line}{line}
% \crefname{lstnumber}{Line}{Line}
\newcommand{\crefrangeconjunction}{--}
%\crefname{chapter}{Chapter}{Chapters}
%\crefname{section}{Sec.}{Secs.}
%\crefname{subsection}{Sec.}{Secs.}
%\crefname{subsubsection}{Sec.}{Secs.}
%\crefname{figure}{Fig.}{Figs.}
%\crefname{table}{Table}{Tables}
%\crefname{listing}{Listing}{Listings}
%%Math
\newcommand{\dif}{\mathrm{d}}
\newcommand{\OA}[1]{OA$(#1)$}
\newcommand{\sIndex}{\lambda}
\newcommand{\sStrength}{t}
\newcommand{\sDimension}{d}
\newcommand{\sNumSamples}{N}
\newcommand{\sLevels}{s}
\newcommand{\bigO}{\mathcal{O}}
\let\oldabs\abs % Store original \abs as \oldabs
\let\abs\undefined % "Undefine" \abs
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand\dropshadowlabelcolor[5]{
\node at (#3, #4) {\fontsize{9pt}{2pt}\selectfont\contour{#2}{\color{#1}#5}};
\node at (#3, #4) {\fontsize{9pt}{2pt}\selectfont\color{#1}#5};
}
% Wojciech Jarosz:
% Don't use small caps for author names in citations, only in the bibliography
\providecommand{\mkbibnamefamily}[1]{#1}
\newcommand\lastnameformat[1]{\textsc{#1}}
\newcommand\givennameformat[1]{\textsc{#1}}
% \renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
% \renewcommand*{\mkbibnamegiven}[1]{\textsc{#1}}
%\AtBeginBibliography{%
%\renewcommand\mkbibnamelast{\lastnameformat}%
%\renewcommand\mkbibnamefamily{\lastnameformat}%
%\renewcommand{\mkbibnamegiven}{\givennameformat}
%}
% use sentence case
% from: https://tex.stackexchange.com/questions/22980/sentence-case-for-titles-in-biblatex
%\DeclareFieldFormat{sentencecase}{\MakeSentenceCase{#1}}
%\renewbibmacro*{title}{%
%\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}}
%{}
%{\ifthenelse{\ifentrytype{article}\OR\ifentrytype{inbook}%
%\OR\ifentrytype{incollection}\OR\ifentrytype{inproceedings}%
%\OR\ifentrytype{inreference}}
%{\printtext[title]{%
%\printfield[sentencecase]{title}%
%\setunit{\subtitlepunct}%
%\printfield[sentencecase]{subtitle}}}%
%{\printtext[title]{%
%\printfield[titlecase]{title}%
%\setunit{\subtitlepunct}%
%\printfield[titlecase]{subtitle}}}%
%\newunit}%
%\printfield{titleaddon}}
% End biblatex tweaks