[Tex/LaTex] how to change the algorithm environment

algorithms

I am interested in changing the algorithm environment so that the numbered "Algorithm" title appears at the bottom instead of at the top, and also the three rulers (one above the Algorithm caption, second below the Algorithm caption, and third at the bottom of the whole environment) won't be there.

I couldn't find a way of doing it according to here:

http://cs.brown.edu/about/system/software/latex/doc/algodoc.pdf

Any ideas how to do that?

(Maybe I should define a new environment which is very similar to the Figure environment instead, only the heading is Algorithm instead of Figure?)

Best Answer

The package algorithm accepts three options at loading time, in regards of the appearance of the algorithm: ruled, boxed and plain. The default is ruled but I think you are looking for the plain style.

Example in plain style:

\documentclass{article}
\usepackage[plain]{algorithm}
\usepackage{algorithmic}

\begin{document}
\begin{algorithm}
\begin{algorithmic}
\FOR{$i=1 \to 10$}
    \STATE X
\ENDFOR
\end{algorithmic}
\caption{My algorithm}
\end{algorithm}
\end{document} 

Output:

enter image description here

Substituting plain with boxed:

enter image description here

And finally the default style (ruled):

enter image description here

Related Question