-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmacros.tex
493 lines (399 loc) · 14.7 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
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
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
\usepackage[utf8]{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage{appendix}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Index
\usepackage[protected]{splitidx}% makeindex will brake layout when sindex in table cells
%\usepackage[makeindex,protected]{splitidx}
\newindex[General Index]{idx}
\newindex[Name index]{person}
\newindex[List of acronyms]{acronym}
\setindexpreamble[idx]{
Page numbers set in bold font indicate a more detailed description.
Persons and acronyms are excluded and included in an index of its
own respectively.}% TODO reference the page number of other indexes
\setindexpreamble[acronym]{The world of data is full of acronyms.
Bold page numbers indicate a further description of the entry,
normal page numbers indicate where an acronym is used in the text.}
\usepackage{multicol}
\extendtheindex{}%
{\useindexpreamble
\small\begin{multicols}{2}}%
{\end{multicols}}% after the index
{}% no change after the ending
% required hack to mix hyperref and formatted page numbers
% \newcommand{\bfhref}[1]{\textbf{\hyperpage{#1}}}
\setindexpreamble[person]{
This index lists all persons that are cited by their works (page numbers in
normal font) or directly referenced by name (page numbers in \textbf{bold}) font.
}
% style of the page numbers in person index
\newcommand*{\personindexcitepage}[1]{\hyperpage{#1}}
\newcommand*{\personindextextpage}[1]{\textbf{\hyperpage{#1}}}
% command to create a person index entry
\newcommand{\personindex}[1]{\sindex[person]{#1}}
% command to create a specific type of person indext entry (text or cite)
\newcommand{\personindexcite}[1]{\personindex{#1|personindexcitepage}}
\newcommand{\personindextext}[1]{\personindex{#1|personindextextpage}}
\newcommand{\Person}[2][]{% print and index full name
\ifthenelse{\isempty{#1}}%
{\personindextext{#2}#2}%
{\personindextext{#2, #1}#1 #2}}
\newcommand{\person}[2][]{% print surname only but index full name
\ifthenelse{\isempty{#1}}%
{\personindextext{#2}#2}%
{\personindextext{#2, #1}#2}}
% See http://www.anindexer.com/about/abbr/abbrindex.html for style tips
%%% I want multiple indexes
% \usepackage[abshang,hangindent=1em,font=small]{idxlayout}
% Declared in biblatex: maybe change to suppress editors?
% \DeclareIndexNameAlias{author}{default}
% \DeclareIndexNameAlias{editor}{default}
% \DeclareIndexNameAlias{bookauthor}{default}
\newcommand{\unnumberedsection}[1]{
\clearpage
\phantomsection
\section*{#1}
\addcontentsline{toc}{section}{#1}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[automark]{scrpage2}
\setheadsepline{0pt}% no vertical line below header
\lehead{\upshape\headmark}% chapter
%\lehead{\small\upshape\thechapter~\chaptermark}% chapter
\rohead{\small\upshape\headmark}% section
\pagestyle{scrheadings}
\automark[section]{chapter}
%%%%
% thanks to http://mintaka.sdsu.edu/GF/bibliog/latex/floats.html
\renewcommand{\topfraction}{0.9} % max fraction of floats at top
\renewcommand{\bottomfraction}{0.8} % max fraction of floats at bottom
% Parameters for TEXT pages (not float pages):
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4} % 2 may work better
\setcounter{dbltopnumber}{2} % for 2-column pages
\renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text
\renewcommand{\textfraction}{0.07} % allow minimal text w. figs
% Parameters for FLOAT pages (not text pages):
\renewcommand{\floatpagefraction}{0.7} % require fuller float pages
% N.B.: floatpagefraction MUST be less than topfraction !!
\renewcommand{\dblfloatpagefraction}{0.7}% adjust style of chapter and section headers
\setkomafont{disposition}{\normalcolor\rmfamily\bfseries}
\addtokomafont{section}{\LARGE}
\addtokomafont{subsection}{\large}
% chapter title
\addtokomafont{chapter}{\Huge}
\renewcommand*{\chapterformat}{\LARGE\chaptername~\thechapter}
% chapter mark in the header
\renewcommand*{\chaptermarkformat}{\thechapter\enskip}
%% Use serife from kpfonts as standard font
\usepackage[light,onlyrm,largesmallcaps]{kpfonts} % serife
% defines \textgreater and \textless
\usepackage{textcomp}% only required in one image (???)
% Zeilenabstand
% \linespread{1.1}
\usepackage{microtype}
\SetExpansion[context=sloppy,shrink=60]{encoding={OT1,T1,TS1}}{}
\usepackage{rotating} % for sidewaystable
\usepackage{tipa,textcomp} % needed for \textbeta in combination with hyperref
\usepackage{afterpage}
%%% extended tables
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{upquote}
\usepackage{fancybox}
\usepackage{float}
\makeatletter
\newcommand{\fs@shadow}{%
\fs@plain
\def\@fs@pre{%
\setbox\@currbox\vbox{\shadowbox{\box\@currbox}}%
}
\let\@fs@iftopcapt=\iffalse}
\makeatother
\newcommand{\subsectionexample}[1]{
\stepcounter{example}
\subsection*{Example \theexample: #1}
\addcontentsline{example}{example}{\protect\numberline{\theexample}#1}
}
\let\tq\textquotesingle
\let\sp\textvisiblespace
%\usepackage{mathabx} % THANKS to http://carlo-hamalainen.net/blog/?p=8
% \usepackage{MnSymbol}
%\usepackage{tabularx}
\usepackage{graphicx}
%%% Add a space after footnote marks (only problematic if referenced)
\let\myfootnote\footnote
\renewcommand{\footnote}[1]{\myfootnote{~#1}}
% Zeilenabstand vorübergehend ändern
%%\usepackage{setspace}
%%% tikz and tkz-orm
%\usepackage{tikz-er2} % TODO: say thanks
\usepackage{tkz-orm}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{matrix}
\usetikzlibrary{shapes} % for shape ellipse
\usetikzlibrary{chains}
\usetikzlibrary{calc}
\usetikzlibrary{mindmap,trees}
\usetikzlibrary{snakes}
% some tikz styles for data matrices
\tikzset{ucs/.style={font=\ttfamily\scriptsize,color=black!70,align=center}}
\tikzset{datamatrix/.style={matrix of nodes,nodes in empty cells,
nodes={anchor=west,font=\ttfamily}}}
% some tikz styles for drawing graphs
\tikzstyle{gnode}=[circle,fill=black,minimum size=2mm,inner sep=0pt]
\tikzstyle{garc}=[solid,thick,->,shorten >=0.75pt,>=latex]
\tikzstyle{gedge}=[thick]
\tikzstyle{glink}=[thick,dashed,->,shorten >=0.75pt,>=latex]
\tikzstyle{ggraph}=[every node/.style={gnode},every edge/.style={garc}]
% some tikz styles for drawing ERM diagrams
\tikzstyle{erm}=[font=\sffamily,node distance=4mm,
label distance=1.25mm,line width=0.25mm]
\tikzstyle{ermnode}=[draw,minimum size=6mm]
\newcommand{\ignore}[1]{}
%%% Captions of figures, tables, etc.
\usepackage[hang,small,bf]{caption}
%\renewcommand{\captionfont}{\rmfamily}
%\renewcommand{\captionlabelfont}{\rmfamily\textbf}
%% additional mathematical symbols, align etc.
\usepackage{amsmath,amsthm,amssymb}
% relation
\newcommand{\rel}{\longrightarrow}
\newcommand{\bij}{\leftrightarrow}
\usepackage[normalem]{ulem} % use standard layout for emph instead of underline
\newcommand{\pattern}[1]{\hyperref[pattern:#1]{\emph{#1}}}
\usepackage{acroterm}
\usepackage{relsize}
%\renewcommand{\acrostyle}[1]{\textsc{\smaller #1}}
%\renewcommand{\Acrostyle}[1]{\textsc{#1}}
\renewcommand{\acrostyle}[1]{#1}
\renewcommand{\Acrostyle}[1]{\textit{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Syntax highlighting
\PassOptionsToPackage{x11names,rgb}{xcolor}
\usepackage[procnames]{listings}
\definecolor{mygray}{rgb}{0.4,0.4,0.4}
\definecolor{mydarkblue}{rgb}{0.0,0.0,0.4}
\definecolor{mycyan}{rgb}{0.0,0.4,0.4}
\definecolor{mygreen}{rgb}{0.0,0.5,0.0}
\lstset{
basicstyle=\ttfamily,
showstringspaces=false,
commentstyle=\color{mygray}\upshape,
stringstyle=\color{black},
numberstyle=\color{black}\footnotesize,
keywordstyle=\color{mycyan},
identifierstyle=\color{mydarkblue}
}
\lstdefinelanguage{XML}
{
columns=fullflexible,
alsoletter={-.:},
morecomment=[s]{!--}{--},
morestring=[b]",
morestring=[s]{>}{<},
morecomment=[s]{<?}{?>},
}
\lstdefinelanguage{DTD}{
alsoletter={-\#.:},
keywords={,CDATA,DOCTYPE,ATTLIST,ELEMENT,EMPTY,ANY,ID,%
IDREF,IDREFS,ENTITY,ENTITIES,NMTOKEN,NMTOKENS,NOTATION,%
INCLUDE,IGNORE,SYSTEM,PUBLIC,NDATA,PUBLIC,%
\#PCDATA,\#REQUIRED,\#IMPLIED,\#FIXED,}%
morecomment=[s]{<!--}{-->},
morestring=[d]",
morestring=[d]',
stringstyle=\color{mygreen},
}
\lstdefinelanguage{rnc}{
keywords={,attribute,default,datatypes,div,element,empty,external,grammar,%
include,inherit,list,mixed,namespace,notAllowed,parent,start,string,%
text,token,},
alsoletter={-.:},
morecomment=[l]{\#},
columns=flexible,
}
\lstdefinelanguage{BNF}
{
columns=flexible,
morestring=[d]",
morestring=[d]',
morestring=[s]{\[}{\]},
morestring=[s]{\#}{\ },
% stringstyle=\itshape\color[rgb]{0.0,0.5,0.0},
stringstyle=\color{mygreen},
% stringstyle=\color[rgb]{0.0,0.5,0.5},
identifierstyle=\sffamily\color{mydarkblue} %darkblue?
}
\lstdefinelanguage{turtle}
{
columns=fullflexible,
morekeywords={@prefix,@base,@forSome,@forAll,@keywords},
morecomment=[l]{\#},
alsoletter={-?}, % allowed in names
% morecomment=[l][\color{cyan}]{@}, % TODO: language tags
morecomment=[s][\color{mydarkblue}]{<}{>},
% basicstyle=\ttfamily\color{gray}, % . , ;
% numberstyle=\color{darkblue},
morestring=[b][\color{black}]\",
}
\newcommand\rdf[1]{\lstinline[language=turtle]{#1}}
\newcommand\xml[1]{\lstinline[language=XML]{#1}}
\newcommand\dtd[1]{\lstinline[language=DTD]{#1}}
\newcommand\bnf[1]{\lstinline[language=BNF]{#1}}
\newcommand\sql[1]{\lstinline[language=SQL,morekeywords={SCHEMA}]{#1}}
\newcommand\bnfstring[1]{\texttt{\color{mygreen}#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newfloat{example}{htp}{example}
\floatname{example}{Example}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Bibliography and citation style
\usepackage[
style=authoryear-comp,
sorting=nyvt,hyperref=true,
indexing=cite,
url=true,
isbn=false,
doi=false,
backend=biber
]{biblatex}
%\DeclareFieldFormat*{url}{}
\DeclareFieldFormat*{url}{\url{#1}}
\DeclareFieldFormat[book]{url}{}
%\DeclareFieldFormat[misc]{url}{\url{#1}}
%\DeclareFieldFormat[standard]{url}{\url{#1}}
%\DeclareFieldFormat[report]{url}{\url{#1}}
%\DeclareFieldFormat[misc]{url}{\url{#1}}
%\DeclareFieldFormat[misc]{article}{\url{#1}}
\AtEveryBibitem{% remove url if pages field
\iffieldundef{pages}{%
}{%
\clearfield{url}
}%
}
% show note in parens
\DeclareFieldFormat[misc]{note}{\mkbibparens{#1}}
% let cite behave like \parencite
\let\cite\parencite
\DeclareCiteCommand{\citeyear}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printtext[bibhyperref]{\printfield{year}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\setlength{\bibitemsep}{1pt}% TODO
\usepackage{xifthen}
\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\personindexcite}{#1}{#3}{#5}{#7}}
\DeclareIndexFieldFormat{indextitle}{}% do not index titles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Size of Quotation / Quote / Verse
%\let\oldquote\quote
%\renewcommand\quote{\par\singlespacing\small\oldquote}
%\let\oldquotation\quotation
%\renewcommand\quotation{\par\singlespacing\small\oldquotation}
%\let\oldverse\verse
%\renewcommand\verse{\par\singlespacing\small\oldverse}
% TODO calc \textwidth - \parindent
\renewenvironment{quotation}%
{\begin{center}\begin{minipage}[h]{0.95\textwidth}\small\noindent}%
{\end{minipage}\end{center}\noindent}
\newcommand{\quotationsource}{\hspace*{0.5em} --- }
% chapter numbers roman
%\def\thechapter{\Roman{chapter}}
%%% enable '|' to type verbatim
\usepackage{fancyvrb}% TODO: really needed?
%%% Unicode codepoint
\newcommand{\U}[1]{\texttt{U+#1}}
\newcommand{\Ox}[1]{\texttt{0x#1}}
\newcommand\format[1]{\textsf{#1}}
\newcommand{\formati}[2]{\ensuremath{\format{#1}_{\textsf{#2}}}}
\newcommand{\tuple}[1]{\langle #1 \rangle}
% Set brackets and set builder notation
\newcommand{\set}[2][]{%
\ifthenelse{\isempty{#1}}%
{\ensuremath{\{#2\}}}
{\ensuremath{\{\,#1\,|\,#2\,\}}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\nwc}[1]{\ensuremath{#1^\uparrow}}
\newcommand{\nwr}[1]{\ensuremath{#1^\downarrow}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{enumitem}
\setlist{leftmargin=*,rightmargin=\parindent,font=\rmfamily}
\setlist[description]{labelsep=0.5em,leftmargin=0.5em}
%TODO: this make build brake:?!
%\setlist[description]{labelindent=\parindent,label=--,topsep=2pt,itemsep=2pt,parsep=0pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\patternsection}[2]{%
% horizontal line
\vskip\medskipamount % or other desired dimension
\leaders\vrule width \textwidth\vskip0.4pt % or other desired thickness
\vskip\medskipamount % ditto
\nointerlineskip
\expandafter\subsection\expandafter{#1 pattern}
\expandafter\label\expandafter{#2}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\TODO}[1]{\vspace{\parskip}\noindent%
\begin{tikzpicture}
\node (b) [font=\scriptsize,rectangle,
inner sep=5pt,
text width=\linewidth,
%text justified,
anchor=south
]{\parbox[t]{\linewidth}{#1}};
\draw[dashed,very thick,red] (b.north west) to (b.south west)
to +(10pt,0);
\draw[dashed,very thick,red] (b.north west) to +(10pt,0);
\end{tikzpicture}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[ocgcolorlinks]{hyperref}
\usepackage{hyperxmp}
\hypersetup{
pdfborder={0 0 0},
%colorlinks=false,ocgcolorlinks=false,
%colorlinks=true,
linkcolor=purple, citecolor=olive, urlcolor=violet,
bookmarksnumbered=true,
pdfpagemode=UseOutlines,
pdfauthor={Jakob Voß},
pdfcreator={Jakob Voß},
pdftitle={Describing data patterns. A general deconstruction of metadata standards},
pdfsubject={Common features across all methods of data structuring and description},
pdfkeywords={data, data description, data modeling, metadata, pattern language},
pdflang={en},
pdfmetalang={en},
pdfcopyright={CC-BY-SA by Jakob Voß},
pdflicenseurl={http://creativecommons.org/licenses/by-sa/3.0/}
}
\include{ocgcolorlinks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RGB color profile.
% I had to download and copy sRGBIEC1966-2.1.icm to
% /usr/share/texlive/texmf-dist/tex/latex/pdfx/
% and run texthash afterwards.
% code from pdfx package
\immediate\pdfobj stream attr{/N 4} file{sRGBIEC1966-2.1.icm}
\edef\OBJ@RVT{\the\pdflastobj}
\pdfcatalog{%
/OutputIntents [ <<
/Type /OutputIntent
/S/GTS_PDFA1
/DestOutputProfile \OBJ@RVT\space 0 R
/OutputConditionIdentifier (sRGB IEC61966-2.1)
/Info(sRGB IEC61966-2.1)
>> ]}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliography{bibliography}
\raggedbottom % prevent LaTeX from adding vertical white space in strange places on pages that it cannot fill properly.
% numerate subsubsections in small roman numbers but don't shown them in ToC
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}
\renewcommand{\thesubsubsection}{\Roman{subsubsection}}
\renewcommand{\contentsname}{Table of Contents}