davinci-paper/v2/build/preamble-macros.tex
v2/build/preamble-macros.texRaw
1% !TeX root = main.tex
2
3% Doc sytle
4\setcounter{secnumdepth}{3} %enumerate sections up to depth 3 (subsubsection)
5
6% Working directory
7\newcommand{\definedir}[2]{\newcommand{#1}{#2}}
8\definedir{\secs}{../sections}
9\definedir{\figs}{../figures}
10\definedir{\bib}{../bibliography}
11
12% Comments
13\newcommand{\marta}[1]{\todo[size=\small, color=red!40]{\textbf{Marta}: #1}}
14\newcommand{\martai}[1]{\todo[inline, size=\small, color=red!40]{\textbf{Marta}: #1}}
15\newcommand{\pau}[1]{\todo[size=\small, color=blue!40]{\textbf{Pau}: #1}}
16\newcommand{\paui}[1]{\todo[inline, size=\small, color=blue!40]{\textbf{Pau}: #1}}
17\newcommand{\jordi}[1]{\todo[size=\small, color=green!40]{\textbf{Jordi}: #1}}
18\newcommand{\jordii}[1]{\todo[inline, size=\small, color=green!40]{\textbf{Jordi}: #1}}
19
20% freefootnote
21\let\svthefootnote\thefootnote
22\newcommand\freefootnote[1]{%
23 \let\thefootnote\relax%
24 \footnotetext{#1}%
25 \let\thefootnote\svthefootnote%
26}
27
28% Colors
29\definecolor{cred}{rgb}{1, 0.5, 0.5}
30\definecolor{cgreen}{rgb}{0.5, 1, 0.5}
31\definecolor{cblue}{rgb}{0.5, 0.5, 1}
32
33% Hyperref setup
34%\hypersetup{
35% final=true,
36% colorlinks=true,
37% linkcolor=cblue,
38% urlcolor=black,
39% citecolor=cblue,
40%}
41
42% Mathbb
43\newcommand{\N}{\ensuremath{\mathbb{N}}\xspace}
44\newcommand{\Z}{\ensuremath{\mathbb{Z}}\xspace}
45\newcommand{\G}{\ensuremath{\mathbb{G}}\xspace}
46\newcommand{\F}{\ensuremath{\mathbb{F}}\xspace}
47\newcommand{\J}{\ensuremath{\mathbb{J}}\xspace}
48
49% Ballot protocol
50\newcommand{\ballotstyle}[1]{\texttt{#1}\xspace}
51\newcommand{\maxcount}{\ballotstyle{maxCount}}
52\newcommand{\maxvalue}{\ballotstyle{maxValue}}
53\newcommand{\minvalue}{\ballotstyle{minValue}}
54\newcommand{\uniquevalues}{\ballotstyle{uniqueValues}}
55\newcommand{\maxtotalcost}{\ballotstyle{maxTotalCost}}
56\newcommand{\mintotalcost}{\ballotstyle{minTotalCost}}
57\newcommand{\costexponent}{\ballotstyle{costExponent}}
58
59% Voting protocol
60\newcommand{\variablestyle}[1]{\texttt{#1}\xspace}
61\newcommand{\nullifier}{\variablestyle{nullifier}}
62\newcommand{\commitment}{\variablestyle{commitment}}
63
64% Others
65\newcommand{\noi}{\noindent}
66
67% Hyperlinks
68\newcommand{\hlset}[1]{\hypertarget{\detokenize{#1}}{#1}}
69\newcommand{\hlget}[1]{\hyperlink{\detokenize{#1}}{#1}}
70
71% Cryptographic primitives
72\newcommand{\methodstyle}[1]{{\sf{#1}}\xspace}
73\newcommand{\Enc}{\methodstyle{Enc}}
74\newcommand{\Dec}{\methodstyle{Dec}}
75\newcommand{\GenerateShares}{\methodstyle{GenerateShares}}
76\newcommand{\VerifyShare}{\methodstyle{VerifyShare}}
77\newcommand{\DerivePublicKey}{\methodstyle{DerivePublicKey}}
78\newcommand{\DeriveSecretShare}{\methodstyle{DeriveSecretShare}}
79
80\newcommand{\blinder}[1][]{{\sf{blinder}^{#1}}}
81\newcommand{\pk}[1][]{{\sf{pk}^{#1}}}
82\newcommand{\sk}[1][]{{\sf{sk}^{#1}}}
83\newcommand{\msg}[1][]{{\sf{message}^{#1}}}
84\newcommand{\enc}[1][]{{\sf{ciphertext}^{#1}}}
85\newcommand{\sample}{\xleftarrow{\$}}
86
87% VOC token
88\newcommand{\vocstyle}[1]{{\sf{#1}}\xspace}
89
90\newcommand{\baseCost}{\vocstyle{baseCost}}
91\newcommand{\capacityCost}{\vocstyle{capacityCost}}
92\newcommand{\durationCost}{\vocstyle{durationCost}}
93\newcommand{\fixedCost}{\vocstyle{fixedCost}}
94\newcommand{\maxVotes}{\vocstyle{maxVotes}}
95\newcommand{\maxDuration}{\vocstyle{maxDuration}}
96\newcommand{\numSequencers}{\vocstyle{numSequencers}}
97\newcommand{\processDuration}{\vocstyle{processDuration}}
98\newcommand{\reimbursement}{\vocstyle{reimbursement}}
99\newcommand{\securityCost}{\vocstyle{securityCost}}
100\newcommand{\sequencerReward}{\vocstyle{sequencerReward}}
101\newcommand{\slashedAmount}{\vocstyle{slashedAmount}}
102\newcommand{\stakedCollateral}{\vocstyle{stakedCollateral}}
103\newcommand{\totalCost}{\vocstyle{totalCost}}
104\newcommand{\totalReward}{\vocstyle{totalReward}}
105\newcommand{\totalRewrites}{\vocstyle{totalRewrites}}
106\newcommand{\totalSequencers}{\vocstyle{totalSequencers}}
107\newcommand{\totalVotingProcesses}{\vocstyle{totalVotingProcesses}}
108\newcommand{\usedSequencers}{\vocstyle{usedSequencers}}
109\newcommand{\votes}{\vocstyle{votes}}
110\newcommand{\voteRewrites}{\vocstyle{voteRewrites}}
111
112% misc
113\newcommand{\davinci}{DAVINCI\xspace}
114
115% draft watermark
116%\ifdraft{\SetWatermarkScale{4}}{\SetWatermarkScale{0}}
117
118% new foonote referencing a previous footmark
119\makeatletter
120\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
121\makeatother