CRDTs talk slides from Utah Distributed Systems 2/16/2016

master
Levi Pearson 2016-02-16 22:27:01 -07:00
commit ba74fb43d1
9 changed files with 1490 additions and 0 deletions

427
CRDTs.md Normal file
View File

@ -0,0 +1,427 @@
---
title: CRDTs
subtitle: Guaranteed Eventual Consistency
author: Levi Pearson
...
# Introduction
## Goals - To Understand
+ What makes a CRDT
+ Theoretical Impact
+ Practical Relevance
+ Some Existing CRDTs
## Source Paper
+ *A Comprehensive Study of Convergent and Commutative Replicated Data Types*
2011 INRIA Research Report by Shapiro, Preguiça, Baquero, Zawirski
+ Many related publications on CRDTs from same authors
+ Zawirski's Ph.D. Thesis is related to size-optimizing CRDTs
## Outline
+ Basic CRDT Concept
+ Detailed Model of CRDTs
+ Portfolio of CRDT Specifications
+ Garbage Collection Issues
+ A Shopping Cart Example
# CRDTs in a Nutshell
## Motivations
+ **Eventual Consistency** for scalability
+ Improve theoretical grounding
+ Weaken coordination requirements
## Eventual Consistency
+ Updates are executed at replicas
+ Later, sent to all other replicas
+ Eventually, all replicas see all updates
+ They apply asynchronously and possibly in different orders
+ Concurrent updates may conflict and require *arbitration*
## Strong Eventual Consistency
+ Formal model of Eventual Consistency
+ No conflict-resolution or roll-back required; *Conflict-Freedom*
+ Extremely scalable and fault-tolerant
+ Based on mathematical properties
## Two Related Formulations
+ *Convergent* Replicated Data Types (CvRDT)
- State-based
- Weak network requirements
- Based on *monotonic join semilattices*
+ *Commutative* Replicated Data Types (CmRDT)
- Operation-based
- Requires reliable broadcast with *delivery order*
- Based on *commutativity of concurrent operations*
+ Both can always simulate one another
# System Model of CRDTs
## Distributed Systems
+ Processes interconnected by asynchronous network
+ Network can partition and recover
+ Nodes can operate disconnected for some time
+ Processes may crash and recover, memory survives crashes
+ Assumption of non-Byzantine behavior
## Atoms and Objects
+ Processes store **atoms** and **objects**
+ Atoms are base immutable data; directly comparable values
+ Objects are mutable, replicated data; collections of objects and atoms
+ Objects with the same identity but different location are **replicas**
+ Objects are independent; no transactions
## Operations
+ There are **clients** that query and modify objects via **operations**
+ A client acts on one replica, the **source** replica
+ The operation executes locally at the source and then remotely
- *Phase 1*: Operation called at source; possibly some processing occurs
- *Phase 2*: Update transmitted asynchronously to **downstream** replicas
## State-Based Replication
+ Update happens entirely at source replica via **update**
+ Modified payload transmitted downstream
+ Receivers use **merge** operation to update their payload
+ Replicas can be compared via **compare** operation
+ Operations guarded by **source pre-conditions**
## State-Based Causal History Model
+ Initially, set $C(x_i)$ of each replica $x_i$ is $\emptyset$
+ After update $f$, $C(f(x_i))$ is $C(x_i) \cup \{f\}$
+ After merge of $C(x_i)$ and $C(x_j)$, the state is $C(x_i) \cup C(x_j)$
+ The "happens-before" relation $f \to g \Leftrightarrow C(f) \subset C(g)$
## State-Based Network Assumptions
+ States transmit between replicas at unspecified times
+ Transmissions occur infinitely often
+ Communication forms a connected graph
## Operation-Based Replication
+ Phase 1 of **update** is local to source replica
- Precondition guard must be true
- Executes immediately and atomically
- No side-effects
- May return results
+ Phase 2 of **update** executes asynchronously on downstream replicas
- Downstream precondition must be true
- Can't return results
- Updates downstream state
- Arguments prepared by Phase 1
- Executes atomically
## Operation-Based Causal History Model
+ Initially, set $C(x_i)$ of each replica $x_i$ is $\emptyset$
+ After downstream phase, $f$, $C(f(x_i))$ is $C(x_i) \cup \{f\}$
+ The "happens-before" relation $f \to g \Leftrightarrow C(f) \subset C(g)$
+ **causal delivery** means that if $f \to g$, then $f$ is delivered before $g$
## Operation-Based Network Assumptions
+ Presence of a reliable broadcast mechanism
+ Delivery of every update in a **delivery order**
+ The delivery order maintains downstream preconditions
+ A delivery order of causal delivery is always sufficient
## Definition of Convergence
+ Two replicas $x_i$ and $x_j$ of $x$ *converge eventually* if:
- Safety: $\forall{i,j}: C(x_i) = C(x_j)$ implies payloads of $i$ and $j$ are equivalent
- Liveness: $\forall{i,j}: f \in C(x_i)$ implies *eventually* $f \in C(x_j)$
+ States are equivalent when all **query** operations return the same values
## Convergent Replicated Data Type (CvRDT)
+ Based on concept of **join semilattice**
- A *set* of values equipped with
- a *partial order* relation ($\leq$ or $\sqsubseteq$) on them
- and a *least upper bound* (LUB or $\sqcup$) operation, aka *join*
+ LUB: if $m = x \sqcup y$ then $m$ is a LUB under $\leq$ **iff**
- $x \leq m \land y \leq m$
- There is no $m' \leq m$ where $x \leq m' \land y \leq m'$
- The "smallest" $m$ in the set that is "at least as big" as both $x$ and $y$
- LUB is *commutative*, *idempotent*, and *associative*
+ An *ordered set* is a *join semilattice* if for all pairs, a LUB exists
+ For CvRDTs, **merge** is the LUB operation on the payloads
+ All operations are *non-decreasing* with respect to the ordering
## Example CvRDT
+ An integer counter; our set is $\mathbb{Z}$
+ Our ordering is numeric $\leq$
+ For merge, we use $max()$
+ Our payload, `x`, is initialized to `0`
+ Operation **value** returning an integer $j$ is `let j = x`
+ Operation **compare(a,b)** is `a.x ` $\leq$ ` b.x`
+ Operation **inc** is `x := x + 1`
+ Operation **merge(a,b)** is `max(a,b)`
## Commutative Replicated Data Type (CmRDT)
+ Based on a reliable broadcast strong enough to guarantee **delivery order**
+ **Delivery order**, $<$, is specified per CmRDT
+ Some operations are not ordered; they are *concurrent*, $\|$
+ $f \| g \Leftrightarrow f \nless g \land g \nless f$
+ All replicas converge to the same state when:
- all concurrent operations commute, so
- all execution orders consistent with delivery order are equivalent
+ Reliable causal delivery
- doesn't require agreement
- is immune to partitioning (connected subsets still make deliveries)
- eventually delivers all updates to all nodes
+ Delivery order is never stricter than causal delivery
## Relationship of CvRDT and CmRDT
+ State-based CvRDT are:
- easy to reason about (relatively)
- requires only weak network properties, no membership tracking
- may be inefficient for large objects
- used in NFS, AFS, Coda, Dynamo, Riak
+ Operation-based CmRDT are:
- harder to reason about; requires reasoning about history
- have greater expressive power
- require an underlying reliable broadcast protocol, need membership tracking
- used in Bayou, Rover, IceCube, Telex
+ They can always emulate one another (although not necessarily efficiently)
# Portfolio of CRDTs
## Categories
+ Counters
+ Registers
+ Sets
+ Graphs
+ Co-op Text Editing
## State-Based Outline
| **payload** *Payload type; instantiated at all replicas*
| **initial** *Inital value*
| **query** *Query*( *arguments* ) : *returns*
| **pre** *Precondition*
| **let** *Evaluate synchronously, no side effects*
| **update** *Source-local operation*( *arguments* ) : *returns*
| **pre** *Precondition*
| **let** *Evaluate at source, synchronously*
| *Side effects at source to execute synchronously*
| **compare** (value1, value2) : boolean *b*
| *Is value1* $\leq$ *value2 in semilattice?*
| **merge** (value1, value2) : payload mergedValue
| *LUB merge of value1 and value2, at any replica*
## Op-Based Outline
| **payload** *Payload type; intstantiated at all replicas*
| **initial** *Initial value*
| **query** *Source-local operation*( *arguments* ) : *returns*
| **pre** *Precondition*
| **let** *Execute at source, synchronously, no side-effects*
| **update** *Global update*( *arguments* ) : *returns*
| **atSource**( *arguments* ) : *returns*
| **pre** *Precondition at source*
| **let** *1st phase: synchronous, at source, no side-effects*
| **downstream** ( *arguments passed downstream* )
| **pre** *Precondition against downstream state*
| *2nd phase, asynchronous, side-effects to downstream state*
## Op-based Counter
| **payload** integer $i$
| **initial** $0$
| **query** *value*() : integer $j$
| **let** $j = i$
| **update** *increment*()
| **downstream**()
| $i := i + 1$
| **update** *decrement*()
| **downstream**()
| $i := i - 1$
## G-Counter
| **payload** integer[$n$] $P$
| **initial** $[0,0,\dots,0]$
| **update** *increment*()
| **let** $g = myID()$
| $P[g] := P[g] + 1$
| **query** *value*() : integer $v$
| **let** $v = \sum_i{P[i]}$
| **compare**($X, Y$) : boolean $b$
| **let** $b = (\forall i \in [0, n-1] : X.P[i] \leq Y.P[i])$
| **merge**($X, Y$) : payload $Z$
| **let** $\forall i \in [0, n - 1] : Z.P[i] = max(X.P[i], Y.P[i])$
## PN-Counter
| **payload** integer[$n$] $P$, integer[$n$] $N$
| **initial** $[0,0,\dots,0], [0,0,\dots,0]$
| **update** *increment*()
| **let** $g = myID()$; $P[g] := P[g] + 1$
| **update** *decrement*()
| **let** $g = myID()$; $N[g] := N[g] + 1$
| **query** *value*() : integer $v$
| **let** $v = \sum_i{P[i]} - \sum_i{N[i]}$
| **compare**($X, Y$) : boolean $b$
| **let** $b = (\forall i \in [0, n-1] : X.P[i] \leq Y.P[i] \land \forall i \in [0,n - 1] : X.N[i] \leq Y.N[i])$
| **merge**($X, Y$) : payload $Z$
| **let** $\forall i \in [0, n - 1] : Z.P[i] = max(X.P[i], Y.P[i])$
| **let** $\forall i \in [0, n - 1] : Z.N[i] = max(X.N[i], Y.N[i])$
## LWW-Register
| **payload** $X$ $x$, timestamp $t$
| **initial** $\bot, 0$
| **update** *assign*( $X$ $w$ )
| $x, t := w, now()$
| **query** *value*() : $X$ $w$
| **let** $w = x$
| **compare**($R, R'$) : boolean $b$
| **let** $b = (R.t \leq R'.t)$
| **merge**($R, R'$) : payload $R''$
| **if** $R.t \leq R'.t$ **then** $R''.x, R''.t = R'.x, R'.t$
| **else** $R''.x, R''.t = R.x, R.t$
## LWW-Register (Op-based)
| **payload** $X$ $x$, timestamp $t$
| **initial** $\bot, 0$
| **query** *value*() : $X$ $w$
| **let** $w = x$
| **update** *assign*( $X$ $x'$ )
| **atSource**() $t'$
| **let** $t' = now()$
| **downstream**($x', t'$)
| **if** $t < t'$ **then** $x, t := x', t'$
## MV-Register
| **payload** set $S$ of $(x, V)$ pairs; $x \in X$; $V$ its version vector
| **initial** $\{(\bot, [0,\dots,0])\}$
| **query** *incVV*() : integer[$n$] $V'$
| **let** $g = myID()$
| **let** $\mathcal{V} = \{V \mid \exists x : (x,V) \in S\}$
| **let** $V' = [ max_{V \in \mathcal{V}}(V[j]) ]_{j \neq g}$
| **let** $V'[g] = max_{V \in \mathcal{V}}(V[g]) + 1$
| **update** *assign*( set $R$ )
| **let** $V = incVV()$
| $S := R \times \{V\}$
## MV-Register (cont.)
| **query** *value*() : set $S'$
| **let** $S' = S$
| **compare**($A, B$) : boolean $b$
| **let** $b = (\forall(x,V) \in A, (x', V') \in B : V \leq V')$
| **merge**($A, B$) : payload $C$
| **let** $A' = \{(x,V) \in A \mid \forall(y,W) \in B : V \| W \lor V \leq W\}$
| **let** $B' = \{(y,W) \in B \mid \forall(x,V) \in A : W \| V \lor W \leq V\}$
| **let** $C = A' \cup B'$
## G-Set
| **payload** set $A$
| **initial** $\emptyset$
| **update** *add*(element $e$)
| $A := A \cup \{e\}$
| **query** *lookup*(element $e$) : boolean $b$
| **let** $b = (e \in A)$
| **compare**($S, T$) : boolean $b$
| **let** $b = (S.A \subseteq T.A)$
| **merge**($S, T$) : payload $U$
| **let** $U.A = S.A \cup T.A$
## 2P-Set
| **payload** set $A$, set $R$
| **initial** $\emptyset, \emptyset$
| **query** *lookup*(element $e$) : boolean $b$
| **let** $b = (e \in A \land e \notin R)$
| **update** *add*(element $e$)
| $A := A \cup \{e\}$
| **update** *remove*(element $e$)
| **pre** $lookup(e)$
| $R := R \cup \{e\}$
| **compare**($S, T$) : boolean $b$
| **let** $b = (S.A \subseteq T.A \lor S.R \subseteq T.R)$
| **merge**($S, T$) : payload $U$
| **let** $U.A = S.A \cup T.A$
| **let** $U.R = S.R \cup T.R$
## U-Set
| **payload** set $S$
| **initial** $\emptyset$
| **query** *lookup*(element $e$) : boolean $b$
| **let** $b = (e \in S)$
| **update** *add*(element $e$)
| **atSource**($e$)
| **pre** $e$ is unique
| **downstream**($e$)
| $S := S \cup \{e\}$
## U-Set (cont.)
| **update** *remove*(element $e$)
| **atSource**($e$)
| **pre** $lookup(e)$
| **downstream**($e$)
| **pre** $add(e)$ has been delivered
| $S := S \setminus \{e\}$
# Thanks!

28
Makefile Normal file
View File

@ -0,0 +1,28 @@
NAME := CRDTs
THEME := metropolis
THEME_FILES := beamercolortheme${THEME}.sty \
beamerfonttheme${THEME}.sty \
beamerinnertheme${THEME}.sty \
beameroutertheme${THEME}.sty \
beamertheme${THEME}.sty \
pgfplotsthemetol.sty
.PHONY: all clean tex-clean
all: ${NAME}.pdf
body.tex: ${NAME}.md
pandoc --latex-engine=xelatex -t beamer -V theme:${THEME} -o body.tex ${NAME}.md
${NAME}.pdf: head.tex body.tex
xelatex head.tex
xelatex head.tex
mv head.pdf ${NAME}.pdf
tex-clean:
@rm -f *.aux *.log *.nav *.out *.snm *.toc body.tex
clean: tex-clean
@rm -f *.pdf

View File

@ -0,0 +1,126 @@
%%
%% This is file `beamercolorthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamercolorthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamercolorthememetropolis}[2015/12/04 Metropolis color theme]
\RequirePackage{pgfopts}
\pgfkeys{
/metropolis/color/block/.cd,
.is choice,
transparent/.code=\@metropolis@block@transparent,
fill/.code=\@metropolis@block@fill,
}
\pgfkeys{
/metropolis/color/background/.cd,
.is choice,
dark/.code=\@metropolis@colors@dark,
light/.code=\@metropolis@colors@light,
}
\newcommand{\@metropolis@color@setdefaults}{
\pgfkeys{/metropolis/color/.cd,
background=light,
block=transparent,
}
}
\definecolor{mDarkBrown}{HTML}{604c38}
\definecolor{mDarkTeal}{HTML}{23373b}
\definecolor{mLightBrown}{HTML}{EB811B}
\definecolor{mLightGreen}{HTML}{14B03D}
\newcommand{\@metropolis@colors@dark}{
\setbeamercolor{normal text}{%
fg=black!2,
bg=mDarkTeal
}
}
\newcommand{\@metropolis@colors@light}{
\setbeamercolor{normal text}{%
fg=mDarkTeal,
bg=black!2
}
}
\setbeamercolor{alerted text}{%
fg=mLightBrown
}
\setbeamercolor{example text}{%
fg=mLightGreen
}
\setbeamercolor{titlelike}{use=normal text, parent=normal text}
\setbeamercolor{author}{use=normal text, parent=normal text}
\setbeamercolor{date}{use=normal text, parent=normal text}
\setbeamercolor{institute}{use=normal text, parent=normal text}
\setbeamercolor{structure}{use=normal text, fg=normal text.fg}
\setbeamercolor{palette primary}{%
use=normal text,
fg=normal text.bg,
bg=normal text.fg
}
\setbeamercolor{frametitle}{%
use=palette primary,
parent=palette primary
}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=alerted text.fg!50!black!30
}
\setbeamercolor{title separator}{
use=progress bar,
parent=progress bar
}
\setbeamercolor{progress bar in head/foot}{%
use=progress bar,
parent=progress bar
}
\setbeamercolor{progress bar in section page}{
use=progress bar,
parent=progress bar
}
\newcommand{\@metropolis@block@transparent}{
\setbeamercolor{block title}{use=normal text, parent=normal text}
}
\newcommand{\@metropolis@block@fill}{
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=normal text.bg!80!fg
}
}
\setbeamercolor{block title alerted}{%
use={block title, alerted text},
bg=block title.bg,
fg=alerted text.fg
}
\setbeamercolor{block title example}{%
use={block title, example text},
bg=block title.bg,
fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}
\setbeamercolor{block body}{
use={block title, normal text},
bg=block title.bg!50!normal text.bg
}
\setbeamercolor{footnote}{fg=normal text.fg!90}
\setbeamercolor{footnote mark}{fg=.}
\@metropolis@color@setdefaults
\ProcessPgfPackageOptions{/metropolis/color}
\mode<all>
\endinput
%%
%% End of file `beamercolorthememetropolis.sty'.

View File

@ -0,0 +1,112 @@
%%
%% This is file `beamerfontthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerfontthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerfontthememetropolis}[2015/12/04 Metropolis font theme]
\RequirePackage{etoolbox}
\RequirePackage{ifxetex}
\RequirePackage{ifluatex}
\ifboolexpr{bool {xetex} or bool {luatex}}{
\RequirePackage[no-math]{fontspec}
\newcounter{fontsnotfound}
\newcommand{\checkfont}[1]{%
\suppressfontnotfounderror=1%
\font\x = "#1" at 10pt
\selectfont
\ifx\x\nullfont%
\stepcounter{fontsnotfound}%
\fi%
\suppressfontnotfounderror=0%
}
\newcommand{\iffontsexist}[3]{%
\setcounter{fontsnotfound}{0}%
\expandafter\forcsvlist\expandafter%
\checkfont\expandafter{#1}%
\ifnum\value{fontsnotfound}=0%
#2%
\else%
#3%
\fi%
}
\iffontsexist{Fira Sans Light,%
Fira Sans Light Italic,%
Fira Sans,%
Fira Sans Italic}{%
\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}%
}{%
\iffontsexist{Fira Sans Light OT,%
Fira Sans Light Italic OT,%
Fira Sans OT,%
Fira Sans Italic OT}{%
\setsansfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}%
}{%
\PackageWarning{beamerthememetropolis}{%
Could not find Fira Sans fonts%
}
}
}
\iffontsexist{Fira Mono, Fira Mono Bold}{%
\setmonofont{Fira Mono}%
}{%
\iffontsexist{Fira Mono OT, Fira Mono Bold OT}{%
\setmonofont{Fira Mono OT}%
}{%
\PackageWarning{beamerthememetropolis}{%
Could not find Fira Mono fonts%
}
}
}
\AtBeginEnvironment{tabular}{%
\addfontfeature{Numbers={Monospaced}}%
}
}{%
\PackageWarning{beamerthememetropolis}{%
You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts%
}
}
\setbeamerfont{title}{size=\Large,%
series=\bfseries}
\setbeamerfont{author}{size=\small}
\setbeamerfont{date}{size=\small}
\setbeamerfont{section title}{size=\Large,%
series=\bfseries}
\setbeamerfont{plain title}{size=\Large,%
series=\bfseries}
\setbeamerfont{block title}{size=\normalsize,%
series=\bfseries}
\setbeamerfont{block title alerted}{size=\normalsize,%
series=\bfseries}
\setbeamerfont*{subtitle}{size=\large}
\setbeamerfont{frametitle}{size=\large,%
series=\bfseries}
\setbeamerfont{caption}{size=\small}
\setbeamerfont{caption name}{series=\bfseries}
\setbeamerfont{description item}{series=\bfseries}
\setbeamerfont{page number in head/foot}{size=\scriptsize}
\setbeamerfont{bibliography entry author}{size=\normalsize,%
series=\normalfont}
\setbeamerfont{bibliography entry title}{size=\normalsize,%
series=\bfseries}
\setbeamerfont{bibliography entry location}{size=\normalsize,%
series=\normalfont}
\setbeamerfont{bibliography entry note}{size=\small,%
series=\normalfont}
\endinput
%%
%% End of file `beamerfontthememetropolis.sty'.

View File

@ -0,0 +1,345 @@
%%
%% This is file `beamerinnerthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerinnerthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthememetropolis}[2015/12/04 Metropolis inner theme]
\RequirePackage{etoolbox}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
\pgfkeys{
/metropolis/inner/block/.cd,
.is choice,
transparent/.code=\setlength{\@metropolis@blockskip}{0ex},
fill/.code=\setlength{\@metropolis@blockskip}{1ex},
}
\pgfkeys{
/metropolis/inner/titleformat title/.cd,
.is choice,
regular/.code={%
\let\@metropolis@titleformat\@empty%
\setbeamerfont{title}{shape=\normalfont}%
},
smallcaps/.code={%
\let\@metropolis@titleformat\@empty%
\setbeamerfont{title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@titleformat\MakeLowercase%
\setbeamerfont{title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat title=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@titleformat\MakeUppercase%
\setbeamerfont{title}{shape=\normalfont}
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat title=allcaps can lead to problems%
}
},
}
\pgfkeys{
/metropolis/inner/titleformat subtitle/.cd,
.is choice,
regular/.code={%
\let\@metropolis@subtitleformat\@empty%
\setbeamerfont{subtitle}{shape=\normalfont}%
},
smallcaps/.code={%
\let\@metropolis@subtitleformat\@empty%
\setbeamerfont{subtitle}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@subtitleformat\MakeLowercase%
\setbeamerfont{subtitle}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat subtitle=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@subtitleformat\MakeUppercase%
\setbeamerfont{subtitle}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat subtitle=allcaps can lead to problems%
}
},
}
\pgfkeys{
/metropolis/inner/titleformat section/.cd,
.is choice,
regular/.code={%
\let\@metropolis@sectiontitleformat\@empty%
\setbeamerfont{section title}{shape=\normalfont}%
},
smallcaps/.code={%
\let\@metropolis@sectiontitleformat\@empty%
\setbeamerfont{section title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@sectiontitleformat\MakeLowercase%
\setbeamerfont{section title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat section=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@sectiontitleformat\MakeUppercase%
\setbeamerfont{section title}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat section=allcaps can lead to problems%
}
},
}
\pgfkeys{
/metropolis/inner/sectionpage/.cd,
.is choice,
none/.code=\@metropolis@sectionpage@none,
simple/.code=\@metropolis@sectionpage@simple,
progressbar/.code=\@metropolis@sectionpage@progressbar,
}
\newcommand{\@metropolis@inner@setdefaults}{
\pgfkeys{/metropolis/inner/.cd,
sectionpage=progressbar,
block=transparent,
titleformat title=regular,
titleformat subtitle=regular,
titleformat section=regular,
}
}
\def\@metropolis@titleformat#1{#1}
\def\@metropolis@subtitleformat#1{#1}
\def\@metropolis@sectiontitleformat#1{#1}
\patchcmd{\sectionentry}
{\def\insertsectionhead{#2}}
{\def\insertsectionhead{\@metropolis@sectiontitleformat{#2}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed}}
\patchcmd{\beamer@section}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{%
\@metropolis@sectiontitleformat{#1}}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed}}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\vfill%
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
\usebeamertemplate*{title separator}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\def\maketitle{%
\ifbeamer@inframe
\titlepage
\else
\frame[plain]{\titlepage}
\fi
}
\def\titlepage{%
\usebeamertemplate{title page}
}
\setbeamertemplate{title graphic}{
\vbox to 0pt {
\vspace*{2em}
\inserttitlegraphic%
}%
\nointerlineskip%
}
\setbeamertemplate{title}{
\raggedright%
\linespread{1.0}%
\@metropolis@titleformat{\inserttitle}%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
\@metropolis@subtitleformat{\insertsubtitle}%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{title separator}{
\begin{tikzpicture}
\draw[fg, fill=fg] (0,0) rectangle (\textwidth, 0.4pt);
\end{tikzpicture}%
\par%
}
\setbeamertemplate{author}{
\vspace*{2em}
\insertauthor%
\par%
\vspace*{0.25em}
}
\setbeamertemplate{date}{
\insertdate%
\par%
}
\setbeamertemplate{institute}{
\vspace*{3mm}
\insertinstitute%
\par%
}
\newcommand{\@metropolis@sectionpage@none}{
\AtBeginSection{
% intenionally empty
}
}
\defbeamertemplate{section page}{simple}{
\centering
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\
}
\newcommand{\@metropolis@sectionpage@simple}{
\setbeamertemplate{section page}[simple]
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c]{\sectionpage}
\fi
}
}
\defbeamertemplate{section page}{progressbar}{
\centering
\begin{minipage}{22em}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\end{minipage}
\par
}
\newcommand{\@metropolis@sectionpage@progressbar}{
\setbeamertemplate{section page}[progressbar]
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c]{\sectionpage}
\fi
}
}
\newlength{\metropolis@progressonsectionpage}
\setbeamertemplate{progress bar in section page}{
\setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{tikzpicture}
\draw[bg, fill=bg] (0,0) rectangle (\textwidth, 0.4pt);
\draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressonsectionpage, 0.4pt);
\end{tikzpicture}%
}
\def\inserttotalframenumber{100}
\newlength{\@metropolis@blockskip}
\setbeamertemplate{block begin}{%
\setlength{\parskip}{\@metropolis@parskip}
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body}%
}
\setbeamertemplate{block end}{%
\end{beamercolorbox}
\vspace*{0.2ex}
}
\setbeamertemplate{block alerted begin}{%
\setlength{\parskip}{\@metropolis@parskip}
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title alerted}
\usebeamerfont*{block title alerted}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body alerted}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body alerted}%
}
\setbeamertemplate{block alerted end}{%
\end{beamercolorbox}
\vspace*{0.2ex}
}
\setbeamertemplate{block example begin}{%
\setlength{\parskip}{\@metropolis@parskip}
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title example}
\usebeamerfont*{block title example}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body example}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body example}%
}
\setbeamertemplate{block example end}{%
\end{beamercolorbox}
\vspace*{0.2ex}
}
\setbeamertemplate{itemize items}{\textbullet}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{footnote}{%
\parindent 0em\noindent%
\raggedright
\usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\newlength{\@metropolis@parskip}
\setlength{\@metropolis@parskip}{0.5em}
\setlength{\parskip}{\@metropolis@parskip}
\linespread{1.15}
\define@key{beamerframe}{c}[true]{% centered
\beamer@frametopskip=0pt plus 1fill\relax%
\beamer@framebottomskip=0pt plus 1fill\relax%
\beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
\beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
\def\beamer@initfirstlineunskip{}%
}
\@metropolis@inner@setdefaults
\ProcessPgfPackageOptions{/metropolis/inner}
\endinput
%%
%% End of file `beamerinnerthememetropolis.sty'.

View File

@ -0,0 +1,158 @@
%%
%% This is file `beamerouterthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerouterthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthememetropolis}[2015/12/04 Metropolis outer theme]
\RequirePackage{etoolbox}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\pgfkeys{
/metropolis/outer/numbering/.cd,
.is choice,
none/.code=\setbeamertemplate{frame numbering}[none],
counter/.code=\setbeamertemplate{frame numbering}[counter],
fraction/.code=\setbeamertemplate{frame numbering}[fraction],
}
\pgfkeys{
/metropolis/outer/progressbar/.cd,
.is choice,
none/.code={%
\setbeamertemplate{headline}[plain]
\setbeamertemplate{frametitle}[plain]
\setbeamertemplate{footline}[plain]
},
head/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{headline}{}{%
\usebeamertemplate*{progress bar in head/foot}
}
},
frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{frametitle}{}{%
\usebeamertemplate*{progress bar in head/foot}
}
},
foot/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{footline}{}{%
\usebeamertemplate*{progress bar in head/foot}%
}
},
}
\pgfkeys{
/metropolis/outer/titleformat frame/.cd,
.is choice,
regular/.code={%
\let\@metropolis@frametitleformat\@empty%
\setbeamerfont{frametitle}{shape=\normalfont}%
\renewcommand{\@metropolis@frametitlestrut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}%
}
},
smallcaps/.code={%
\let\@metropolis@frametitleformat\@empty%
\setbeamerfont{frametitle}{shape=\scshape}%
\renewcommand{\@metropolis@frametitlestrut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}%
}
},
allsmallcaps/.code={%
\let\@metropolis@frametitleformat\MakeLowercase%
\setbeamerfont{frametitle}{shape=\scshape}%
\renewcommand{\@metropolis@frametitlestrut}{%
\vphantom{abcdefghijklmnopqrstuvwxyz}%
}
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat frame=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@frametitleformat\MakeUppercase%
\setbeamerfont{frametitle}{shape=\normalfont}
\renewcommand{\@metropolis@frametitlestrut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
}
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat frame=allcaps can lead to problems%
}
},
}
\newcommand{\@metropolis@outer@setdefaults}{
\pgfkeys{/metropolis/outer/.cd,
numbering=counter,
progressbar=none,
titleformat frame=regular,
}
}
\setbeamertemplate{navigation symbols}{}
\defbeamertemplate{frame numbering}{none}{}
\defbeamertemplate{frame numbering}{counter}{\insertframenumber}
\defbeamertemplate{frame numbering}{fraction}{
\insertframenumber/\inserttotalframenumber
}
\defbeamertemplate{headline}{plain}{}
\defbeamertemplate{footline}{plain}{%
\begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
\hfill%
\usebeamerfont{page number in head/foot}%
\usebeamertemplate*{frame numbering}
\end{beamercolorbox}%
}
\def\@metropolis@frametitleformat#1{#1}
\patchcmd{\beamer@@frametitle}
{\beamer@ifempty{#2}{}{%
\gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space%
\usebeamertemplate*{frametitle continuation}\fi}}%
\gdef\beamer@frametitle{#2}%
\gdef\beamer@shortframetitle{#1}%
}}
{\beamer@ifempty{#2}{}{%
\gdef\insertframetitle{{\@metropolis@frametitleformat{#2}\ifnum%
\beamer@autobreakcount>0\relax{}\space%
\usebeamertemplate*{frametitle continuation}\fi}}%
\gdef\beamer@frametitle{#2}%
\gdef\beamer@shortframetitle{#1}%
}}
{}
{\PackageError{beamerouterthememetropolis}{Patching frame title failed}}
\newlength{\@metropolis@frametitlestrut}
\defbeamertemplate{frametitle}{plain}{%
\nointerlineskip%
\begin{beamercolorbox}[%
wd=\paperwidth,%
sep=1.5ex,%
]{frametitle}%
\@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut%
\end{beamercolorbox}%
}
\newlength{\metropolis@progressinheadfoot}
\setbeamertemplate{progress bar in head/foot}{
\nointerlineskip
\setlength{\metropolis@progressinheadfoot}{%
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
\begin{tikzpicture}
\draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt);
\draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
\end{tikzpicture}%
\end{beamercolorbox}
}
\@metropolis@outer@setdefaults
\ProcessPgfPackageOptions{/metropolis/outer}
\endinput
%%
%% End of file `beamerouterthememetropolis.sty'.

113
beamerthememetropolis.sty Normal file
View File

@ -0,0 +1,113 @@
%%
%% This is file `beamerthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerthememetropolis}[2015/12/04 Metropolis Beamer theme]
\RequirePackage{etoolbox}
\RequirePackage{pgfopts}
\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}}
\pgfkeys{/metropolis/.cd,
.search also={
/metropolis/inner,
/metropolis/outer,
/metropolis/color,
},
block/.code=\pgfkeysalso{
inner/block=#1,
color/block=#1,
},
}
\pgfkeys{
/metropolis/titleformat plain/.cd,
.is choice,
regular/.code={%
\let\@metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\normalfont}%
},
smallcaps/.code={%
\let\@metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@plaintitleformat\MakeLowercase%
\setbeamerfont{plain title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@plaintitleformat\MakeUppercase%
\setbeamerfont{plain title}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allcaps can lead to problems%
}
},
}
\pgfkeys{
/metropolis/titleformat/.code=\pgfkeysalso{
inner/titleformat title=#1,
inner/titleformat subtitle=#1,
inner/titleformat section=#1,
outer/titleformat frame=#1,
titleformat plain=#1,
}
}
\pgfkeys{/metropolis/.cd,
usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=frametitle},
noslidenumbers/.code=\pgfkeysalso{outer/numbering=none},
usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
darkcolors/.code=\pgfkeysalso{color/background=dark},
blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
}
\newcommand{\@metropolis@setdefaults}{
\pgfkeys{/metropolis/.cd,
titleformat plain=regular,
}
}
\useinnertheme{metropolis}
\useoutertheme{metropolis}
\usecolortheme{metropolis}
\usefonttheme{metropolis}
\AtEndPreamble{%
\@ifpackageloaded{pgfplots}{%
\RequirePackage{pgfplotsthemetol}
}{}
}
\def\@metropolis@plaintitleformat#1{#1}
\newcommand{\plain}[2][]{%
\begingroup
\setbeamercolor{background canvas}{
use=palette primary,
parent=palette primary
}
\begin{frame}[c]{#1}
\begin{center}
\usebeamercolor[fg]{palette primary}
\usebeamerfont{plain title}
\@metropolis@plaintitleformat{#2}
\end{center}
\end{frame}
\endgroup
}
\newcommand{\mreducelistspacing}{\vspace{-\topsep}}
\@metropolis@setdefaults
\ProcessPgfOptions{/metropolis}
\endinput
%%
%% End of file `beamerthememetropolis.sty'.

58
head.tex Normal file
View File

@ -0,0 +1,58 @@
\documentclass[ignorenonframetext,aspectratio=169]{beamer}
\usetheme{metropolis}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{{#1}}}
\newcommand{\ImportTok}[1]{{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{{#1}}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{{#1}}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{{#1}}}
\newcommand{\BuiltInTok}[1]{{#1}}
\newcommand{\ExtensionTok}[1]{{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{{#1}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}
\newcommand{\RegionMarkerTok}[1]{{#1}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\NormalTok}[1]{{#1}}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\title{CRDTs}
\subtitle{Guaranteed Eventual Consistency}
\author{Levi Pearson}
\date{}
\begin{document}
\frame{\titlepage}
\mode<all>
\include{body}
\mode*
\end{document}

123
pgfplotsthemetol.sty Normal file
View File

@ -0,0 +1,123 @@
%%
%% This is file `pgfplotsthemetol.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pgfplotsthemetol.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pgfplotsthemetol}
[2015/06/16 PGFplots colors based on Paul Tol's SRON technical note]
\definecolor{TolDarkPurple}{HTML}{332288}
\definecolor{TolDarkBlue}{HTML}{6699CC}
\definecolor{TolLightBlue}{HTML}{88CCEE}
\definecolor{TolLightGreen}{HTML}{44AA99}
\definecolor{TolDarkGreen}{HTML}{117733}
\definecolor{TolDarkBrown}{HTML}{999933}
\definecolor{TolLightBrown}{HTML}{DDCC77}
\definecolor{TolDarkRed}{HTML}{661100}
\definecolor{TolLightRed}{HTML}{CC6677}
\definecolor{TolLightPink}{HTML}{AA4466}
\definecolor{TolDarkPink}{HTML}{882255}
\definecolor{TolLightPurple}{HTML}{AA4499}
\pgfplotscreateplotcyclelist{mbarplot cycle}{%
{draw=TolDarkBlue, fill=TolDarkBlue!70},
{draw=TolLightBrown, fill=TolLightBrown!70},
{draw=TolLightGreen, fill=TolLightGreen!70},
{draw=TolDarkPink, fill=TolDarkPink!70},
{draw=TolDarkPurple, fill=TolDarkPurple!70},
{draw=TolDarkRed, fill=TolDarkRed!70},
{draw=TolDarkBrown, fill=TolDarkBrown!70},
{draw=TolLightRed, fill=TolLightRed!70},
{draw=TolLightPink, fill=TolLightPink!70},
{draw=TolLightPurple, fill=TolLightPurple!70},
{draw=TolLightBlue, fill=TolLightBlue!70},
{draw=TolDarkGreen, fill=TolDarkGreen!70},
}
\pgfplotscreateplotcyclelist{mlineplot cycle}{%
{TolDarkBlue, mark=*, mark size=1.5pt},
{TolLightBrown, mark=square*, mark size=1.3pt},
{TolLightGreen, mark=triangle*, mark size=1.5pt},
{TolDarkBrown, mark=diamond*, mark size=1.5pt},
}
\pgfplotsset{
compat=1.9,
mlineplot/.style={
mbaseplot,
xmajorgrids=true,
ymajorgrids=true,
major grid style={dotted},
axis x line=bottom,
axis y line=left,
legend style={
cells={anchor=west},
draw=none
},
cycle list name=mlineplot cycle,
},
mbarplot base/.style={
mbaseplot,
bar width=6pt,
axis y line*=none,
},
mbarplot/.style={
mbarplot base,
ybar,
xmajorgrids=false,
ymajorgrids=true,
area legend,
legend image code/.code={%
\draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
},
cycle list name=mbarplot cycle,
},
horizontal mbarplot/.style={
mbarplot base,
xmajorgrids=true,
ymajorgrids=false,
xbar stacked,
area legend,
legend image code/.code={%
\draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
},
cycle list name=mbarplot cycle,
},
mbaseplot/.style={
legend style={
draw=none,
fill=none,
cells={anchor=west},
},
x tick label style={
font=\footnotesize
},
y tick label style={
font=\footnotesize
},
legend style={
font=\footnotesize
},
major grid style={
dotted,
},
axis x line*=bottom,
},
disable thousands separator/.style={
/pgf/number format/.cd,
1000 sep={}
},
}
\endinput
%%
%% End of file `pgfplotsthemetol.sty'.