-
Notifications
You must be signed in to change notification settings - Fork 1
/
outline.sty
executable file
·266 lines (229 loc) · 7.72 KB
/
outline.sty
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
% To enable working with both pdflatex (pdf/png figures) and plain latex (eps/pdf figures)
\newif\ifCLASSINFOpdf \CLASSINFOpdftrue
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\graphicspath{{./},{figures/}}
\DeclareGraphicsExtensions{.pdf,.png}
\else
\usepackage[dvips]{graphicx}
\graphicspath{{./},{figures/}}
\DeclareGraphicsExtensions{.pdf,.eps}
\fi
%watermark
\usepackage{wallpaper}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Default packages commonly used
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
\usepackage[nottoc]{tocbibind}
\usepackage[utf8]{inputenc}
%%%%%%%%%%% Table related commands
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{ctable}
\newcommand{\otoprule}{\midrule[\heavyrulewidth]}
\newcommand{\ctoprule}[1]{\cmidrule[\heavyrulewidth]{#1}}
%%%%%%%%%%% Depth of toc and paragraph layout
\setlength{\parindent}{0pt}
\setlength{\parskip}{8pt}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
%%%%%%%%%%% Fancy Header and Footer
\usepackage{fancyhdr}
\usepackage[left=3cm,top=2cm,right=2cm,bottom=2cm]{geometry}
% \usepackage[left=3cm,top=2.5cm,right=3cm,bottom=2.5cm,includeheadfoot]{geometry}
%\usepackage[left=3.85cm,top=3.85cm,right=3.85cm,bottom=3.35cm,includeheadfoot]{geometry}
% \usepackage[left=4cm,top=3.5cm,right=4cm,bottom=3.5cm,includeheadfoot]{geometry}
\usepackage[plainpages=false]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Special packages and commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{caption}
\usepackage{float}
\usepackage{listings}
\lstnewenvironment{rawtext}[1][]{
\noindent
\minipage{\linewidth}
\renewcommand*{\lstlistingname}{Note}
\lstset{basicstyle=\footnotesize\ttfamily\bfseries,lineskip={-4pt},columns=fullflexible,keepspaces=true,captionpos=b,xleftmargin=2em,#1}}
{\endminipage}
\newcommand{\executeiffilenewer}[3]{%
\ifnum\pdfstrcmp{\pdffilemoddate{#1}}%
{\pdffilemoddate{#2}}>0%
{\immediate\write18{#3}}\fi%
}
\newcommand{\includesvg}[1]{%
\executeiffilenewer{#1.svg}{#1.pdf}%
{inkscape -z -D --file=#1.svg %
--export-pdf=#1.pdf --export-latex}%
\input{#1.pdf_tex}%
}
% label, caption, width
\newcommand{\makeFigure}[3]{
\begin{figure}[!h]
\centering
\includegraphics[width=#3\textwidth]{../img/#1.pdf}
\caption{#2}
\label{#1}
\end{figure}
}
\newcommand{\makeGraphic}[1]{
\includegraphics[width=0.5\textwidth]{../img/#1.pdf}
\label{#1}
}
\newcommand{\makeCCCPingGraphic}[1]{
\includegraphics[width=0.35\textwidth]{#1/s1rtt.pdf} &
\includegraphics[width=0.35\textwidth]{#1/s1rvh.pdf} &
\includegraphics[width=0.35\textwidth]{#1/s1tim.pdf} \\
}
\newcommand{\makeCCCPerfGraphic}[1]{
\includegraphics[width=0.35\textwidth]{#1/netperf_T.pdf} &
\includegraphics[width=0.35\textwidth]{#1/netperf_TP.pdf} &
\includegraphics[width=0.35\textwidth]{#1/top_VSZ.pdf} \\
}
\newcommand{\makeCCCOvhdGraphic}[1]{
\includegraphics[width=0.35\textwidth]{#1/top_100CPU.pdf} &
\includegraphics[width=0.35\textwidth]{#1/tcpdump_B.pdf} &
\includegraphics[width=0.35\textwidth]{#1/tcpdump_P.pdf} \\
}
\newcommand{\makeTCCGraphic}[1]{
\makeGraphic{#1rtt} & \makeGraphic{#1tim} \\
\makeGraphic{#1hop} & \makeGraphic{#1rvh} \\
}
\newcommand{\makeCCTabl}[3]{
\begin{table}[!h] \begin{center} \begin{tabular}{ c c }
#3
\end{tabular} \label{#1} \caption{#2}
\end{center} \end{table}
\clearpage
}
\newcommand{\makeCCCTabl}[3]{
\begin{table}[!h]
\begin{center}
\begin{tabular}{ c c c }
#3
\end{tabular}
\caption{#2}
\label{#1}
\end{center}
\end{table}
\clearpage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Page margins
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\headheight}{14.5pt}
% \setlength{\headsep}{1cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Headings and Footers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sets fancy header and footer
% \pagestyle{fancy}
% Page number (boldface)
% \fancyfoot[C]{\bfseries\thepage}%
% Chapter and sections in head
% \fancyhead{}%
% \fancyhead[RO]{\bfseries\leftmark} % Chapter in the right on even pages
% \fancyhead[LE]{\bfseries\rightmark} % Section in the left on odd pages
% Small Capitals chapter and section marker style
% \renewcommand{\sectionmark}[1]{\markboth{\thesection.\ #1}{}}%
% \renewcommand{\subsectionmark}[1]{\markright{\thesubsection.\ #1}{}}%
%\renewcommand{\subsectionmark}[1]{\markleft{\thesubsection.\ #1}{}}%
% Width of head rule
% \renewcommand{\headrulewidth}{0.3pt}
% Plain headers (for chapter's first pages, title pages, etc.)
% \fancypagestyle{plain}{%
% % clear all header and footer fields
% \fancyhf{}
% % except the center
% \fancyfoot[C]{\bfseries\thepage}
% % no lines
% \renewcommand{\headrulewidth}{0pt}
% \renewcommand{\footrulewidth}{0pt}%
% }
\newcommand{\frontmatter}{
% \cleardoublepage
\pagenumbering{roman}
}
\newcommand{\mainmatter}{
% \cleardoublepage
\pagenumbering{arabic}
\setcounter{page}{1}
}
\newcommand{\backmatter}{
% \cleardoublepage
\pagestyle{plain}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Style for empty pages when clearing double pages and symbol footnote
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear Header Style on the Last Empty Odd pages
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty}% % Empty header styles
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi%
}
\makeatother
% Clear Header Style on the Last Empty Odd pages
\makeatletter
\def\clearsinglepage{
\thispagestyle{plain}% % Empty header styles
\newpage%
}
\makeatother
% Footnotes with symbols instead of numbers, usage : \symbolfootnote[num]{text}
% \long\def\symbolfootnote[#1]#2{\begingroup
% \def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page and document information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand{\contributors}[1]{\gdef\@contributors{#1}}
\newcommand{\doctype}[1]{\gdef\@doctype{#1}}
\newcommand{\eventlocation}[1]{\gdef\@eventlocation{#1}}
\newcommand{\eventdates}[1]{\gdef\@eventdates{#1}}
\newcommand{\eventurl}[1]{\gdef\@eventurl{#1}}
\newcommand{\logofigure}[1]{\gdef\@logofig{#1}}
\renewcommand{\maketitle}{
\thispagestyle{empty}
%% Add watermark
% \AddToShipoutPicture*{%
% \hspace*{-50mm}%
% \AtPageLowerLeft{%
% \parbox[b][\paperheight]{1\paperwidth}{%
% \vspace*{67mm}%
% \includegraphics[width=0.5\paperwidth,height=0.5\paperheight,keepaspectratio]{\@logofig}%
% \vfill%
%
% }
% }
% }%
\begin{center}
% \vfill%
% \includegraphics[width=0.75\textwidth]{\@logofig}%
% \vfill%
\Huge{\textbf{\@title}}%
\vfill%
\large{\textsc{\@author}}\\%
\vfill%
\textbf{
Type: \@doctype\\%
% \textsc{\@contributors}\\%
% \vspace*{10mm}
Creation date: \@date\\%
\vspace*{5mm}
Event: \\%
\@eventlocation \\%
\@eventdates \\%
\@eventurl \\%
\vfill%
}%
\vfill%
\includegraphics[width=0.75\textwidth]{\@logofig}%
% \vfill%
\end{center}%
% \cleardoublepage
}
\makeatother