[Tex/LaTex] algpseudocode without visible EndIf

algorithmicxalgorithmsindentation

I have the following chunk of code

\begin{algorithmic}
\State $\mathit{FlatMask}(c)=0$
\If{$\mathit{Inc1}(c)>0$}
    \State $\mathit{FlatMask}(c)\;+\!\!=2(\mathit{Inc1}(c)-1)$
\EndIf
\end{algorithmic}

It displays using the algpseudocode package, but I would like that the final printed End If not be displayed, just the indentation to be reset.

Any thoughts?

Best Answer

The following is a simple method to do this:

\algtext*{EndIf}% Remove "end if" text

An expanded answer is available here.

Related Question