Skip to content

Instantly share code, notes, and snippets.

@hsanchez
Forked from lgylym/algorithm2e_mapreduce
Last active August 29, 2015 14:25
Show Gist options
  • Save hsanchez/ff14fc54d398659a18b4 to your computer and use it in GitHub Desktop.
Save hsanchez/ff14fc54d398659a18b4 to your computer and use it in GitHub Desktop.
algorithm template using algorithm2e
\begin{algorithm}[H]
\SetKwFor{ForEach}{for each}{do}{end}%separate foreach with a space
\SetArgSty{textrm} %do not automatically use italic in arguments
\SetKwInOut{KwInit}{Initialization}
\SetKwFunction{Map}{Map}
\SetKwFunction{Reduce}{Reduce}
\SetKwProg{myproc}{Procedure}{}{}
\DontPrintSemicolon % Some LaTeX compilers require you to use \dontprintsemicolon instead
\KwIn{}
\KwOut{}
\myproc{\Map{[(key, value)]}}{
\ForEach a {
emit(key, value)\;
}
}
\myproc{\Reduce{(key, [value])}} {
save to file\;
}
\caption{FooAlgorithm}
\label{algo:mr}
\end{algorithm}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment