2

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?)

  • What package are you using to produce algorithms? – karlkoeller Dec 19 '13 at 11:25
  • I am using the "algorithm" package with "algorithmic" inside the an algorithm environment for the actual algorithm. – kloop Dec 19 '13 at 12:20
6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.