Skip to content

Instantly share code, notes, and snippets.

@xiaom
Created June 2, 2012 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaom/2859275 to your computer and use it in GitHub Desktop.
Save xiaom/2859275 to your computer and use it in GitHub Desktop.
algorithm2e template
\begin{figure}
% Manual: http://bit.ly/N5qECH
\begin{algorithm}[H]
\caption{$\textsc{AlgName}$}
\label{alg:foobar}
\SetAlFnt{\tiny \sf}
\SetCommentSty{textrm}
\SetKwComment{Comment}{~$\triangleright$~}{}
\SetSideCommentRight
\SetFillComment
\SetKwFunction{Procedure}{\bf Procedure}
\SetKwFunction{foo}{\sc FOO}
\SetKwData{MBR}{\sf MBR}
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}
\Input{in}
\Output{out}
$s \gets \emptyset$\\ % use gets instead of leftarrow
$\foo(S)$ \\
\For{ }{}
\lFor{ }{ } \\ % one line for
\lIf{ }{
}\lElseIf{
}\lElse{
}
% ---------------------------------------------
\vspace{1em}
\Procedure $\insert(topK,R)$ \\
...
\end{algorithm}
\end{figure}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment