algpseudocode
lets me write code such as:
\documentclass{article}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithmic}
\While{$n>3$}
\If{$m>n$}
\State ...
\State ...
\EndIf
\If{$m>2$}
\State ...
\EndIf
\EndWhile
\end{algorithmic}
\end{document}
Yielding results similar to
while n>3
if m>n
...
...
end if
if m>2
...
end if
end while
I'd like all of that "end if", "end while", "end procedure" text to disappear and everything to compress upwards such that the result is:
while n>3
if m>n
...
...
if m>2
...
That is, I'd like a Pythonic-style where indentations indicate blocks.
Can algpseudocode
do this? Or is there another package with similar functionality?
\algdef{SE}[WHILE]{While}{EndWhile}[1]{\algorithmicwhile\ #1\ \algorithmicdo}{}% \algdef{SE}[IF]{If}{EndIf}[1]{\algorithmicif\ #1\ \algorithmicthen}{}%
will eliminate the text, but leaves a blank line.