3

I'm reading a computer science paper right now and I really like the way the pseudocode is displayed. I'm unsure, however, of what pseudocode package this is. Any help would be appreciated. An image is below:

enter image description here

1 Answers1

2

You can produce that layout using the algorithm2e package:

\documentclass{article}
\usepackage[procnumbered,noline]{algorithm2e}

\makeatletter
\renewcommand\theAlgoLine{\two@digits{\arabic{AlgoLine}}}
\makeatother
\SetNlSty{normalfont}{}{.}
\SetNlSkip{-10pt}
\SetInd{1em}{2em} 
\newcommand\nld{\SetNlSty{normalfont}{}{\hphantom{.}}\nl}
\SetKw{melse}{else,} 

\begin{document}

\begin{procedure}
\SetKwProg{myproc}{Procedure}{}{}
\myproc{improve-approx-2(r,S,T)}{
\nl $\Delta=r(S,T)$\;
\nl let $c$ be the number of $\Delta$-critical nodes\;
\nl\uIf{$c>m^{9/16}$}{\nld find a $\Delta/(4m)$-optimal flow}
\nl\melse\uIf{$m^{1/3}<c<m^{9/16}$}{\nld let $G'$ denote $\Delta$-compact network}
}
\end{procedure} 

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Thanks! This is exactly what I was looking for. I already had tried algorithmicx but I couldn't customize the output the way I wanted it here. – rahulmehta95 Aug 01 '13 at 20:19