-
-
Save hsanchez/ff14fc54d398659a18b4 to your computer and use it in GitHub Desktop.
algorithm template using algorithm2e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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