add tag
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.
Top Answer
निरंजन
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}
```

![Screenshot_2022-10-04_09-54-55.png](/image?hash=58974caaadb7203f13b64e1ed903ac6329f3df7a8e4c465408162917ae46a018)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.