-
Notifications
You must be signed in to change notification settings - Fork 14
/
query-card-definitions.tex
98 lines (78 loc) · 3.27 KB
/
query-card-definitions.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
% colors from Color Brewer 2.0, Set1: http://colorbrewer2.org/#type=qualitative&scheme=Set1&n=3
\definecolor{parameter}{HTML}{e41a1c}
\definecolor{result}{HTML}{377eb8}
\definecolor{sort}{HTML}{4daf4a}
% colors from Color Brewer 2.0, Pastel1: http://colorbrewer2.org/#type=qualitative&scheme=Pastel1&n=9
\definecolor{IC}{HTML}{ffffcc}
\definecolor{IS}{HTML}{fed9a6}
\definecolor{INS}{HTML}{e5d8bd}
\definecolor{BI}{HTML}{decbe4}
\definecolor{DEL}{HTML}{33ccff}
\newboolean{standalone}
\reversemarginpar
\newcommand{\currentQueryCard}{n/a}
\newcommand{\queryRefCard}[3]{
\ifthenelse{
\equal{\currentQueryCard}{#1}
}{%
\colorbox{white}{\tt #2 #3}%
}{%
\ifthenelse{
\boolean{standalone}
}{%
\href{https://ldbcouncil.org/ldbc_snb_docs/#1.pdf}{\colorbox{#2}{\tt #2 #3}}%
%\colorbox{#2}{\tt #2 #3}%
}{%
\hyperref[sec:#1]{\colorbox{#2}{\tt #2 #3}}%
}
}%
}
\newcommand{\attributeNumberWidth}{0.33cm}
\newcommand{\attributeColumnWidth}{2.5cm}
\newcommand{\typeColumnWidth}{2.7cm}
\newcommand{\descriptionColumnWidth}{10.3cm}
\newcommand{\largeDescriptionColumnWidth}{13cm}
\newcommand{\tableHeaderFirst}[1]{\multicolumn{1}{|c|}{\bf #1}}
\newcommand{\tableHeader}[1]{\multicolumn{1}{c|}{\bf #1}}
% using camelCase notation is not conventional in LaTeX, but it helps readability a lot, so I decided to use it anyways [szarnyasg]
\newcommand{\queryCardWidth}{17cm}
\newcommand{\queryPropertyCell}{\small \sf \centering}
\newcommand{\queryPropertyCellWidth}{1.48cm}
\newcommand{\attributeCardWidth}{14.66cm}
\newcommand{\typeWidth}{2.04cm}
\newcommand{\paramNumberCell}{\cellcolor{parameter}\color{white}\footnotesize}
\newcommand{\resultNumberCell}{\cellcolor{result}\color{white}\footnotesize}
\newcommand{\sortNumberCell}{\cellcolor{sort}\color{white}\footnotesize}
\newcommand{\directionCell}{\cellcolor{gray!20}}
\newcommand{\resultOriginCell}{\tt}
\newcommand{\edgeDirectionCell}{\tt}
% for hyphenating tt text, see also https://tex.stackexchange.com/a/44362/71109
\newcommand{\varNameText}{\tt}
\newcommand{\varNameCell}{\varNameText}
\newcommand{\typeText}{\footnotesize\sf}
\newcommand{\typeCellBase}{\cellcolor{gray!20}\typeText}
\newcommand{\typeCell}{\typeCellBase\raggedright}
\newcommand{\chokePoint}[1]{\hyperref[choke_point_#1]{#1}}
\newcommand{\innerCardVSpace}{\vspace{1.1ex}}
\newcommand{\queryCardVSpace}{\vspace{2ex}}
% tabularx magic
% https://tex.stackexchange.com/a/89932/71109
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
% https://tex.stackexchange.com/questions/252385/mixing-m-and-x-in-tabularx#comment602205_252388
\renewcommand{\tabularxcolumn}[1]{m{#1}}
%\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% https://tex.stackexchange.com/a/385069/71109
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\newcolumntype{M}{>{\begin{varwidth}{3.8cm}}Sl<{\end{varwidth}}}
\newcommand{\attributeTable}[3]{
\vspace{1ex}
\begin{tabularx}{\linewidth}{|l|Y|}
\hline
\bf Attribute & \varNameCell #1 \\ \hline
\bf Type & \typeCellBase #2 \\ \hline % using typeCellBase as we cannot use \raggedright here
\bf Description & #3 \\
\hline
\end{tabularx}}
\newcommand{\tpch}[1]{{\color{gray}(Related TPC-H choke point: #1)}}