# Hide closing statements for algorithms

I would like to generate an algorithm with the algorithmic package which does not show the annoying closing statements when I typeset it. I have done this before but have now forgotten how to do it. Specifically,

   \FORALL Natural numbers N
\STATE N=N-1 !
\ENDFOR


I'd prefer that the final \ENDFOR statement not show up after typesetting as this just needlessly chews up space.

• Can you post your answer as an answer to this question, so that you can accept it and the question be resolved? Jan 28, 2011 at 8:32
• It doesn't look like blackkettle will returen. So I added a CW answer. Could someone please upvote it once, so that this question gets off the unanswered list. Feb 7, 2011 at 23:17

From the algorithmic manual:

There is a single option, noend that may be invoked when the algorithmic package is loaded. With this option invoked the end statements are omitted in the output. This allows space to be saved in the output document when this is an issue.

So, if you load the package with

\usepackage[noend]{algorithmic}


there won't be any closing statements.

• I use \begin{algorithm} around algorithmic and only load \usepackage{algorithm}. I get errors if a additionally \usepackage[noend]{algorithmic}. Is there another way to remove the closing statements? Jan 17, 2017 at 9:24
• @CGFoX use [noend] argument with package algpseudocode instead of package algorithmic. Apr 29, 2019 at 21:24

Package algpseudocode also has a noend option. It is invoked via:

\usepackage[noend]{algpseudocode}

This alternate approach solves the issue reported in a previous comment that adding package algorithmic to the document leads to the error:

Command \algorithmic already defined. {\end{list}}