arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
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% Elliptic curves
 50\newcommand{\BW}[1]{\ensuremath{{#1}^{\text{\tiny \sf BW}}}\xspace}
 51\newcommand{\BLS}[1]{\ensuremath{{#1}^{\text{\tiny \sf BLS}}}\xspace}
 52\newcommand{\BN}[1]{\ensuremath{{#1}^{\text{\tiny \sf BN}}}\xspace}
 53
 54% Ballot protocol
 55\newcommand{\ballotstyle}[1]{\texttt{#1}\xspace}
 56\newcommand{\maxcount}{\ballotstyle{maxCount}}
 57\newcommand{\maxvalue}{\ballotstyle{maxValue}}
 58\newcommand{\minvalue}{\ballotstyle{minValue}}
 59\newcommand{\uniquevalues}{\ballotstyle{uniqueValues}}
 60\newcommand{\maxtotalcost}{\ballotstyle{maxTotalCost}}
 61\newcommand{\mintotalcost}{\ballotstyle{minTotalCost}}
 62\newcommand{\costexponent}{\ballotstyle{costExponent}}
 63
 64% Voting protocol
 65\newcommand{\variablestyle}[1]{\texttt{#1}\xspace}
 66\newcommand{\nullifier}{\variablestyle{nullifier}}
 67\newcommand{\commitment}{\variablestyle{commitment}}
 68
 69% Others
 70\newcommand{\noi}{\noindent}
 71
 72% Hyperlinks
 73\newcommand{\hlset}[1]{\hypertarget{\detokenize{#1}}{#1}}
 74\newcommand{\hlget}[1]{\hyperlink{\detokenize{#1}}{#1}}
 75
 76% Cryptographic primitives
 77\newcommand{\methodstyle}[1]{{\sf{#1}}\xspace}
 78\newcommand{\Enc}{\methodstyle{Enc}}
 79\newcommand{\Dec}{\methodstyle{Dec}}
 80\newcommand{\GenerateShares}{\methodstyle{GenerateShares}}
 81\newcommand{\VerifyShare}{\methodstyle{VerifyShare}}
 82\newcommand{\DerivePublicKey}{\methodstyle{DerivePublicKey}}
 83\newcommand{\DeriveSecretShare}{\methodstyle{DeriveSecretShare}}
 84
 85\newcommand{\blinder}[1][]{{\sf{blinder}^{#1}}}
 86\newcommand{\pk}[1][]{{\sf{pk}^{#1}}}
 87\newcommand{\sk}[1][]{{\sf{sk}^{#1}}} 
 88\newcommand{\msg}[1][]{{\sf{message}^{#1}}}
 89\newcommand{\enc}[1][]{{\sf{ciphertext}^{#1}}}
 90\newcommand{\sample}{\xleftarrow{\$}}
 91
 92% VOC token
 93\newcommand{\vocstyle}[1]{{\sf{#1}}\xspace}
 94
 95\newcommand{\baseCost}{\vocstyle{baseCost}}
 96\newcommand{\capacityCost}{\vocstyle{capacityCost}}
 97\newcommand{\durationCost}{\vocstyle{durationCost}}
 98\newcommand{\fixedCost}{\vocstyle{fixedCost}}
 99\newcommand{\maxVotes}{\vocstyle{maxVotes}}
100\newcommand{\maxDuration}{\vocstyle{maxDuration}}
101\newcommand{\numSequencers}{\vocstyle{numSequencers}}
102\newcommand{\processDuration}{\vocstyle{processDuration}}
103\newcommand{\reimbursement}{\vocstyle{reimbursement}}
104\newcommand{\securityCost}{\vocstyle{securityCost}}
105\newcommand{\sequencerReward}{\vocstyle{sequencerReward}}
106\newcommand{\slashedAmount}{\vocstyle{slashedAmount}}
107\newcommand{\stakedCollateral}{\vocstyle{stakedCollateral}}
108\newcommand{\totalCost}{\vocstyle{totalCost}}
109\newcommand{\totalReward}{\vocstyle{totalReward}}
110\newcommand{\totalRewrites}{\vocstyle{totalRewrites}}
111\newcommand{\totalSequencers}{\vocstyle{totalSequencers}}
112\newcommand{\totalVotingProcesses}{\vocstyle{totalVotingProcesses}}
113\newcommand{\usedSequencers}{\vocstyle{usedSequencers}}
114\newcommand{\votes}{\vocstyle{votes}}
115\newcommand{\voteRewrites}{\vocstyle{voteRewrites}}
116
117% misc
118\newcommand{\davinci}{DAVINCI\xspace}
119
120% draft watermark
121%\ifdraft{\SetWatermarkScale{4}}{\SetWatermarkScale{0}}
122
123% new foonote referencing a previous footmark
124\makeatletter
125\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
126\makeatother