-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
443 lines (360 loc) · 15 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
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
\usepackage[a4paper,centering,margin=1in,marginparwidth=0.75in]{geometry}
\usepackage[utf8]{inputenc} % unicode support
\usepackage{shadow}
\usepackage{supertabular}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{lscape}
\usepackage{layout}
\usepackage{array}
\usepackage{fancybox}
\usepackage{xspace}
\usepackage{ifpdf}
\usepackage{etoolbox}
\usepackage{tocvsec2}
% Hyperref, xcolor, graphicx and possibly others have a flag "pdftex"
% that needs to be used if pdflatex is being used. The following puts
% these inside a conditional for that situation.
\usepackage[pdftex,rgb,dvipsnames,svgnames,hyperref,table]{xcolor}
\usepackage{float}
\usepackage[american]{varioref}
\usepackage[normalem]{ulem}
\usepackage{eso-pic}
\usepackage{natbib}
\usepackage{listings} % enabling listings
\usepackage{url} % enabling URLs
\usepackage{pifont}% enable dingbats
\usepackage{alltt}
% using pdflatex with emp package
\ifx\pdftexversion\undefined
\usepackage[dvips]{graphicx}
\else
\usepackage[pdftex]{graphicx}
\graphicspath{{./}{./images/}}
\DeclareGraphicsExtensions{.png}
\fi
% Hyperref, xcolor, graphicx and possibly others have a flag "pdftex"
% that needs to be used if pdflatex is being used. The following puts
% these inside a conditional for that situation.
\ifpdf
% Case: using pdflatex
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.pdf,.png}
% Options get even more complicated. If we're producing grayscale output,
% we don't want to bother with coloring links, but we still want to load
% hyperref so that its macros are defined (and we don't have to redefine
% everything that uses hyperref). So:
\usepackage[pdftex,breaklinks=true,colorlinks=true,plainpages=false,
pdfpagelabels,bookmarks=true,bookmarksopen=true,bookmarksopenlevel=2,
pdfhighlight=/O,linkcolor={RoyalBlue},citecolor={RoyalBlue},
urlcolor={RoyalBlue}]{hyperref}
\usepackage[pdftex,rgb,dvipsnames,svgnames,hyperref,table]{xcolor}
\else
% Case: not using pdflatex
\usepackage{graphicx}
\DeclareGraphicsExtensions{.eps,.png}
\usepackage[breaklinks,plainpages=false,pdfpagelabels]{hyperref}
\usepackage[rgb,dvipsnames,svgnames,hyperref,table]{xcolor}
\fi
% Package 'rotating' needs to come after the others.
\usepackage{rotating}
% Booktabs for sharp-looking \toprule, \midrule, \bottomrule in tables.
\usepackage{booktabs}
\setlength{\cmidrulewidth}{0.3 pt}
\setlength{\lightrulewidth}{0.3 pt}
\setlength{\heavyrulewidth}{0.9 pt}
\setlength{\parindent}{0pt} % no indents in the whole document
%% ----------------------------------------------------------------------------
%% Special customizations
%% ----------------------------------------------------------------------------
\makeatletter
% Adjust bottom-of-page behavior and page line spacing.
\raggedbottom
\renewcommand{\baselinestretch}{0.98}
% Numbers the paragraph, but does not lists them in the ToC
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{2}
% Fix placement of figures & tables. This keeps latex from shoving big
% floats to the end of a document when they are somewhat big, which it will
% do even if you put [htb] as the argument.
\setcounter{topnumber}{3}
\renewcommand\topfraction{1.0}
\setcounter{bottomnumber}{2}
\renewcommand\bottomfraction{1.0}
\renewcommand\textfraction{0.0}
\renewcommand\floatpagefraction{0.9}
% Adjustment to the spacing around tables and figures.
\renewcommand{\intextsep}{2em}
% This sets up Helvetica for headings. The font scaling is
% because the default Helvetica size is too big.
\RequirePackage{helvet}
\def\Hv@scale{0.87}
% The following sets up txtt for the typewriter font.
\renewcommand{\ttdefault}{txtt}
\DeclareMathAlphabet{\mathtt}{OT1}{txtt}{m}{n}
\SetMathAlphabet{\mathtt}{bold}{OT1}{txtt}{b}{n}
% The next bit is an adaption of code from ot1phv.fd and adapted to the txtt
% fonts. The txtt fonts are just a tad too big, so this tries to rescale
% them down a tiny bit. This isn't completely right because I couldn't
% figure out the right syntax when the DeclareFontShape uses ssub below.
% (Notice how the ones with ssub don't have the \Txtt@@scale factor.)
\def\Txtt@scale{0.975}
\edef\Txtt@@scale{s*[\csname Txtt@scale\endcsname]}%
\DeclareFontFamily{OT1}{txtt}{\hyphenchar \font\m@ne}
\DeclareFontShape{OT1}{txtt}{m}{n}{ %rebular
<-> \Txtt@@scale txtt%
}{}
\DeclareFontShape{OT1}{txtt}{m}{sc}{ %cap & small cap
<-> \Txtt@@scale txttsc%
}{}
\DeclareFontShape{OT1}{txtt}{m}{sl}{ %slanted
<-> \Txtt@@scale txttsl%
}{}
\DeclareFontShape{OT1}{txtt}{m}{it}{ %italic
<-> ssub * txtt/m/sl%
}{}
\DeclareFontShape{OT1}{txtt}{m}{ui}{ %unslanted italic
<-> ssub * txtt/m/sl%
}{}
\DeclareFontShape{OT1}{txtt}{b}{n}{ %bold
<-> \Txtt@@scale txbtt%
}{}
\DeclareFontShape{OT1}{txtt}{b}{sc}{ %bold cap & small cap
<-> \Txtt@@scale txbttsc%
}{}
\DeclareFontShape{OT1}{txtt}{b}{sl}{ %bold slanted
<-> \Txtt@@scale txbttsl%
}{}
\DeclareFontShape{OT1}{txtt}{b}{it}{ %bold italic
<-> ssub * txtt/b/sl%
}{}
\DeclareFontShape{OT1}{txtt}{b}{ui}{ %bold unslanted italic
<-> ssub * txtt/b/sl%
}{}
\DeclareFontShape{OT1}{txtt}{bx}{n}{ %bold extended
<-> ssub * txtt/b/n%
}{}
\DeclareFontShape{OT1}{txtt}{bx}{sc}{ %bold extended cap & small cap
<-> ssub * txtt/b/sc%
}{}
\DeclareFontShape{OT1}{txtt}{bx}{sl}{ %bold extended slanted
<-> ssub * txtt/b/sl%
}{}
\DeclareFontShape{OT1}{txtt}{bx}{it}{ %bold extended italic
<-> ssub * txtt/b/sl%
}{}
\DeclareFontShape{OT1}{txtt}{bx}{ui}{ %bold extended unslanted italic
<-> ssub * txtt/b/sl%
}{}
% This next set of commands uses the sectsty package to change
% section labels to be in a sans-serif font and put the numbers
% into the left margin.
\usepackage{sectsty}
\allsectionsfont{\sffamily\raggedright}
\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}}
% The next definitions change the style of the section headings.
% Definition of paragraph style.
\setlength{\parindent}{0 pt} % Unindented paragraphs, separated ...
\setlength{\parskip}{1.3 ex} % ... by roughly one blank line.
\setlength{\partopsep}{-1ex plus 0.1ex minus -0.2ex}
\setlength{\itemsep}{-0.25ex plus 0.15ex}
% \topsep is supposed to affect list environments like itemize,
% but does nothing there. Instead, it affects environments like tabular.
\setlength{\topsep}{0.3ex plus 0.1ex minus -0.2ex}
% Definition of section heading style.
%\renewcommand{\section}{\newpage\@startsection%
% {section}{1}{0pt}{-1.8ex \@plus -1ex \@minus -.2ex}%
% {0.8ex}{\clearpage\normalfont\Large\bfseries\sffamily}}
\renewcommand{\chapter}{\@startsection%
{chapter}{1}{0pt}{-1.8ex \@plus -1ex \@minus -.2ex}%
{0.8ex}{\normalfont\Huge\bfseries\sffamily}}
\renewcommand{\section}{\@startsection%
{section}{1}{0pt}{-1.8ex \@plus -1ex \@minus -.2ex}%
{0.8ex}{\normalfont\Large\bfseries\sffamily}}
\renewcommand{\subsection}{\@startsection%
{subsection}{2}{0pt}{-2ex \@plus 1ex \@minus -.2ex}%
{0.8ex}{\large\bfseries\sffamily}}
\renewcommand{\subsubsection}{\@startsection%
{subsubsection}{3}{0pt}{-1.5ex \@plus 1ex \@minus -.2ex}%
{0.5ex}{\slshape\normalsize\bfseries\sffamily}}
\renewcommand{\paragraph}{\@startsection%
{paragraph}{4}{0pt}{-1.25ex \@plus 1ex \@minus -.2ex}%
{0.5ex}{\slshape\normalsize\sffamily}}
% Below, we take out the heading embedded by the \tableofcontents
% command so that we can control where it's put.
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
% There seems to be no way to redefine the font used by the table of contents
% line printing command except to modify the source from latex.ltx.
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont\sffamily \normalcolor #5}%
\par}%
\fi}
% The following was ripped out of caption.sty, version 1.4b.
% Copyright (C) 1994-95 Harald Axel Sommerfeldt
% The first few lines set up the parameters for the layout created
% by this style file.
\newcommand{\captionsize}{\small}
\newcommand{\captionfont}{\captionsize\itshape}
\newcommand{\captionlabelfont}{\captionsize\sffamily\bfseries\upshape}
\newlength{\captionmargin}
\setlength{\captionmargin}{6ex}
\newsavebox{\as@captionbox}
\newlength{\as@captionwidth}
\newcommand{\as@normalcaption}[2]{%
#1 #2\par}
\let\as@caption\as@normalcaption
\newcommand{\as@centercaption}[2]{%
\parbox[t]{\as@captionwidth}{{\centering#1 #2\par}}}
\let\as@shortcaption\as@centercaption
\newcommand{\as@makecaption}[2]{%
\setlength{\leftskip}{\captionmargin}%
\setlength{\rightskip}{\captionmargin}%
\addtolength{\as@captionwidth}{-2\captionmargin}%
\renewcommand{\baselinestretch}{0.9}
\captionfont%
\sbox{\as@captionbox}{{\captionlabelfont #1:} #2}%
\ifdim \wd\as@captionbox >\as@captionwidth
\as@caption{{\captionlabelfont #1:}}{#2}%
\else%
\as@shortcaption{{\captionlabelfont #1:}}{#2}%
\fi}
\renewcommand{\@makecaption}[2]{%
\vskip\abovecaptionskip%
\setlength{\as@captionwidth}{\linewidth}%
\as@makecaption{#1}{#2}%
\vskip\belowcaptionskip}
\ifx\@makerotcaption\undefined
\else
\typeout{\space\space\space\space\space\space\space\space\space
`rotating' package detected}
\renewcommand{\@makerotcaption}[2]{%
\renewcommand{\baselinestretch}{0.9}
\captionfont%
\sbox{\as@captionbox}{{\captionlabelfont #1:} #2}%
\ifdim \wd\as@captionbox > .8\vsize
\rotatebox{90}{%
\setlength{\as@captionwidth}{.8\textheight}%
\begin{minipage}{\as@captionwidth}%
\as@caption{{\captionlabelfont #1:}}{#2}%
\end{minipage}}\par
\else%
\rotatebox{90}{\usebox{\as@captionbox}}%
\fi
\hspace{12pt}}
\fi
\ifx\floatc@plain\undefined
\else
\typeout{\space\space\space\space\space\space\space\space\space
`float' package detected}
\renewcommand\floatc@plain[2]{%
\setlength{\as@captionwidth}{\linewidth}%
\as@makecaption{#1}{#2}}
\ifx\as@ruled\undefined
\else
\renewcommand\floatc@ruled[2]{%
\setlength{\as@captionwidth}{\linewidth}%
\renewcommand{\baselinestretch}{0.9}
\captionfont%
\as@caption{{\captionlabelfont #1:}}{#2}}
\fi
\fi
\renewcommand{\@makechapterhead}[1]{%
\vspace*{50 pt}%
{\setlength{\parindent}{0pt} \raggedright% \normalfont
\sffamily\bfseries\Huge\thechapter.\ #1
\par\nobreak\vspace{40 pt}}}
\makeatother
% packages and commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\token}[1]{\texttt{#1}}
\newcommand{\concept}[1]{\textcolor{blue}{#1}}
\newcommand{\element}[1]{\texttt{#1}}
\newcommand{\alert}[1]{\textcolor{red}{#1}}
\newcommand{\note}[1]{\paragraph*{} \emph{\scshape{\alert{Please Note}}: #1} \newline}
\newcommand{\mailto}[1] {\link{mailto:#1}{#1}}
\newcommand{\link}[2] {\literalFont{\href{#1}{#2}}}
\newcommand{\literalFont}[1]{\textup{\texttt{#1}}}
\newcommand{\version}{2\xspace}
\newcommand{\level}{1\xspace}
\newcommand{\LoneVone}{Level~1 Version~1\xspace}
\newcommand{\LoneVtwo}{Level~1 Version~2\xspace}
\newcommand{\LoneVthree}{Level~1 Version~3\xspace}
\newcommand{\currentLV}{Level~1 Version~1\xspace}
\newcommand{\previousLV}{Level~1 Version~2\xspace}
\newcommand{\biom}{BioModels Database\xspace}
% attribute table layout
\newcommand{\attribute}{attribute\xspace}
\newcommand{\desc}{description\xspace}
\newcommand{\subelements}{sub-elements\xspace}
\newcommand{\SedModel}{\hyperref[class:model]{Model}\xspace}
\newcommand{\SedDataSource}{\hyperref[class:dataSource]{DataSource}\xspace}
\newcommand{\SedDataDescription}{\hyperref[class:dataDescription]{DataDescription}\xspace}
\newcommand{\SedSlice}{\hyperref[class:slice]{Slice}\xspace}
\newcommand{\refpage}[1]{\hyperref[#1]{page \pageref{#1}}} % to hyperref to a particular page in the spec
\newcommand{\tabcap}[1]{ % to create table captions for overview tables for each SED-ML class
Attributes and nested elements for \concept{#1}. \emph{xy$^{o}$} denotes optional elements and attributes.
}
\newcommand{\tabtext}[2]{ % to create the introducing table text for each table reference
\tab{#1}~shows all attributes and sub-elements for the \concept{#2} element as defined by the SED-ML \currentLV XML Schema.
}
\newcommand{\lsttext}[2]{ % to create the introducing listing text for each listing reference
Listing~\vref{lst:#1} shows the use of the \element{#2} element in a SED-ML file as defined by the SED-ML \currentLV XML Schema.
}
\newcommand{\lsttexta}[2]{ % to create the introducing listing text for each listing reference
Listing~\vref{lst:#1} shows the use of the \element{#2} attribute in a SED-ML file as defined by the SED-ML \currentLV XML Schema.
}
%
\newcommand{\chap}[1] {Chapter~\protect\ref{chap:#1}\xspace}
\newcommand{\sect}[1] {Section~\protect\ref{sec:#1}\xspace}
\newcommand{\fig}[1] {Figure~\protect\vref{fig:#1}\xspace}
\newcommand{\tab}[1] {Table~\protect\vref{tab:#1}\xspace}
\newcommand{\lst}[1] {Listing~\protect\ref{lst:#1}\xspace}
\newcommand{\eg} {e.\,g.,\xspace}
\newcommand{\ie} {i.\,e.,\xspace}
\newcommand{\tickYes}{\hspace{1pt}\ding{52}}
\newcommand{\tickNo}{\hspace{1pt}\ding{56}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% standard figure layout
\newcommand{\sedfig}[4][]
% {\begin{figure}[H]\begin{center}{\includegraphics[width=0.9\textwidth,#1]{#2}}\caption{#3}\label{#4}\end{center}\end{figure}}
{\begin{figure}[hbt!]\begin{center}{\includegraphics[width=0.9\textwidth,#1]{#2}}\caption{#3}\label{#4}\end{center}\end{figure}}
\newcommand{\sedfigX}[4][]
{\begin{figure}[H]\begin{center}{\includegraphics[#1]{#2}}\caption{#3}\label{#4}\end{center}\end{figure}}
% standard XML listing layout
\lstnewenvironment{myXmlLst}[2]
{\lstset{basicstyle=\ttfamily\scriptsize, caption={#1},label={#2}, keywordstyle=\color{blue}\bfseries, stringstyle=\color{blue}, commentstyle=\color{red}, captionpos=b, breaklines=true, xleftmargin=1.5em, xrightmargin=1.5em, numbers=left, numberstyle=\ttfamily\tiny, numbersep=5pt, tabsize=4, showstringspaces=false, language=XML}} %, float=!h
{}
% listings in appendixes:
\newcommand{\myXmlImport}[3] {\lstinputlisting[basicstyle=\ttfamily\scriptsize,caption={#1},label={#2},%
keywordstyle=\color{blue}\bfseries, stringstyle=\color{blue}, commentstyle=\color{red}, captionpos=b, breaklines=true, xleftmargin=1.5em, xrightmargin=1.5em, numbers=left, numberstyle=\ttfamily\tiny, numbersep=5pt, tabsize=4, showstringspaces=false, language=XML, stepnumber=1]{#3}} %float=h!
%% Conditional for L1V4 updates
\newbool{L1V4}
\setbool{L1V4}{true}
% END \input{sources/latex-macros.tex}