-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.tex
138 lines (127 loc) · 4.95 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
\newcommand{\pow}{\textsc{PoW}\xspace}
\newcommand{\lwrite}{\textsc{write}\xspace}
\newcommand{\lread}{\textsc{read}\xspace}
\newcommand{\net}{\textsc{net}\xspace}
\newcommand{\broadcast}{\textsc{broadcast}\xspace}
\newcommand{\constructor}{\textsc{constructor}\xspace}
\newcommand{\execute}{\textsc{execute}\xspace}
\newcommand{\receive}{\textsc{re}\-\textsc{ceive}\xspace}
\newcommand{\maxvalid}{\textsc{maxvalid}\xspace}
\newcommand{\validate}{\textsc{validate}\xspace}
\newcommand{\intrinsicDifficulty}{\textsf{intrinsicDifficulty}\xspace}
\newcommand{\temp}{\textsf{temp}\xspace}
\newcommand{\tx}{\textsf{tx}\xspace}
\newcommand{\ctr}{\textsf{ctr}\xspace}
\newcommand{\ssum}{\textsf{sum}\xspace}
\newcommand{\mmax}{\textsf{max}\xspace}
\newcommand{\round}{\textsf{round}\xspace}
\newcommand{\HS}{\textsc{HS}\xspace}
\newcommand{\COLL}{\textsc{COLL}\xspace}
\newcommand{\FLIP}{\textsc{FLIP}\xspace}
\newcommand{\CLOSE}{\textsc{CLOSE}\xspace}
\newcommand{\BADRANGE}{\textsc{BADRANGE}\xspace}
\newcommand{\true}{\textsf{true}}
\newcommand{\false}{\textsf{false}}
\newcommand{\maxwork}{\textsf{maxwork}}
\newcommand{\thiswork}{\textsf{thiswork}}
\newcommand{\Break}{\State\textsf{break}}
\newcommand{\Continue}{\State\textsf{continue}}
\newcommand{\poem}{\text{PoEM}\xspace}
\newcommandx{\Ledger}[3][1=,2=,3=]{\prescript{#1}{}{\pmb{L}}^{#2}_{#3}}
\newcommandx{\Chain}[3][1=,2=,3=]{\prescript{#1}{}{\pmb{C}}^{#2}_{#3}}
\newcommandx{\cdf}[1][1=]{{\text{cdf}}_{#1}}
\newcommandx{\pdf}[1][1=]{{\text{pdf}}_{#1}}
\newcommandx{\PDF}[1][1=]{{\text{PDF}}_{#1}}
\newcommand{\concat}{\,\|\,}
\newcommand{\HX}{\hat X}
\newcommand{\getsrandomly}{\overset{\$}{\gets}}
\newcommand{\Epsilon}{\mathcal{E}}
\newcommand{\Exp}{\textsf{Exp}}
\newcommand{\Bern}{\textsf{Bern}}
\newcommandx{\myparagraph}[1][1=]{%
\ifoakland%
\textbf{#1.}%
\else%
\textbf{#1}.%
\fi%
}%
\makeatletter
\let\save@mathaccent\mathaccent
\newcommand*\if@single[3]{%
\setbox0\hbox{${\mathaccent"0362{#1}}^H$}%
\setbox2\hbox{${\mathaccent"0362{\kern0pt#1}}^H$}%
\ifdim\ht0=\ht2 #3\else #2\fi
}
%The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:
\newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
\newcommand*\wideaccent[2]{\@ifnextchar^{{\wide@accent{#1}{#2}{0}}}{\wide@accent{#1}{#2}{1}}}
%Use a separate algorithm for single symbols:
\newcommand*\wide@accent[3]{\if@single{#2}{\wide@accent@{#1}{#2}{#3}{1}}{\wide@accent@{#1}{#2}{#3}{2}}}
\newcommand*\wide@accent@[4]{%
\begingroup
\def\mathaccent##1##2{%
%Enable nesting of accents:
\let\mathaccent\save@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
\if#42 \let\macc@nucleus\first@char \fi
%Determine the italic correction:
\setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}%
\setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}%
\dimen@\wd\tw@
\advance\dimen@-\wd\z@
%Now \dimen@ is the italic correction of the symbol.
\divide\dimen@ 3
\@tempdima\wd\tw@
\advance\@tempdima-\scriptspace
%Now \@tempdima is the width of the symbol.
\divide\@tempdima 10
\advance\dimen@-\@tempdima
%Now \dimen@ = (italic correction / 3) - (Breite / 10)
\ifdim\dimen@>\z@ \dimen@0pt\fi
%The bar will be shortened in the case \dimen@<0 !
\rel@kern{0.6}\kern-\dimen@
\if#41
#1{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}%
\advance\[email protected]\dimexpr\macc@kerna
%Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:
\let\final@kern#3%
\ifdim\dimen@<\z@ \let\final@kern1\fi
\if\final@kern1 \kern-\dimen@\fi
\else
#1{\rel@kern{-0.6}\kern\dimen@#2}%
\fi
}%
\macc@depth\@ne
\let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
\mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
\macc@set@skewchar\relax
\let\mathaccentV\macc@nested@a
%The following initialises \macc@kerna and calls \mathaccent:
\if#41
\macc@nested@a\relax111{#2}%
\else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
\def\gobble@till@marker##1\endmarker{}%
\futurelet\first@char\gobble@till@marker#2\endmarker
\ifcat\noexpand\first@char A\else
\def\first@char{}%
\fi
\macc@nested@a\relax111{\first@char}%
\fi
\endgroup
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\doubleoverline[1]{\overline{\overline{#1}}}
\newcommand\widebar{\wideaccent\overline}
\newcommand\widebarbar{\wideaccent\doubleoverline}
\newcommand{\work}{\textsc{work}\xspace}
\newcommand{\rwork}{\widebarbar{\textsc{work}}\xspace}
\newcommand{\rH}{\widebarbar{H}}
\newcommand{\rw}{\widebarbar{w}}
\newcommand{\rlhd}{\widebarbar{\lhd}}
\newcommand{\borderline}{\textsc{Borderline}}
\newcommand{\montecarlo}{$100{,}000$}