Trevor
I am using the algpseudocode package to make an algorithm. I know you can remove the **end for**, **end while**, and **end if** lines by using algpseudocode's noend option:

\usepackage[noend]{algpseudocode}

However, I would also like to remove the **do** and **then** words to make the algorithm look more minimal. Here is an example:

\documentclass{article}

\usepackage[noend]{algpseudocode}

\begin{document}

\begin{algorithmic}
\State $i \leftarrow 1$
\For{$n \in (1,2,3)$}
\State $i \leftarrow n i$
\EndFor
\While{$a < 3$}
\State $a \leftarrow a+1$
\EndWhile
\If{$b = 1$}
\State $b \leftarrow 5$
\ElsIf{$b = 2$}
\State $b \leftarrow 7$
\Else
\State $b \leftarrow 3$
\EndIf
\end{algorithmic}

\end{document}

![alg.png](/image?hash=bbe0e2a1d8880ce623f1f223feef72811b43dd5de11100e612c339747748bb52)
I want to remove all of the **do** and **then** words from the output.
निरंजन
You can use \algrenewcommand which uses \algorithmic... where you replace ... with the element you want to renew.


\documentclass{article}
\usepackage[noend]{algpseudocode}
\algrenewcommand\algorithmicdo{}
\algrenewcommand\algorithmicthen{}

\begin{document}
\begin{algorithmic}
\State $i \leftarrow 1$
\For{$n \in (1,2,3)$}
\State $i \leftarrow n i$
\EndFor
\While{$a < 3$}
\State $a \leftarrow a+1$
\EndWhile
\If{$b = 1$}
\State $b \leftarrow 5$
\ElsIf{$b = 2$}
\State $b \leftarrow 7$
\Else
\State $b \leftarrow 3$
\EndIf
\end{algorithmic}
\end{document}