![哪个伪代码包产生这个输出?](https://linux22.com/image/272918/%E5%93%AA%E4%B8%AA%E4%BC%AA%E4%BB%A3%E7%A0%81%E5%8C%85%E4%BA%A7%E7%94%9F%E8%BF%99%E4%B8%AA%E8%BE%93%E5%87%BA%EF%BC%9F.png)
我正在读计算机科学纸现在,我真的很喜欢伪代码的显示方式。但是,我不确定这是哪个伪代码包。任何帮助都将不胜感激。图片如下:
答案1
您可以使用algorithm2e
包裹:
\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}