[Tex/LaTex] Removing the borders from algorithm listings

algorithmscaptionsrules

I am relatively new to LaTeX. If I use standard algorithm and algorithmic environment for my algorithm listings I'm getting the borders displayed around the table with the pseudocode. How to remove them? I also want to have the caption of the algorithm below the pseudocode – it is currently above. I believe the problem is extremely easy but googling didn't give me any hints for that.

Best Answer

If you are using the algorithm package, it is enough to use the plain option:

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

\begin{document}

\begin{algorithm}
\begin{algorithmic}
  \STATE $sum\gets 0$
  \STATE $i\gets 1$
  \WHILE{$i\le n$}
  \STATE $sum\gets sum+i$
  \STATE $i\gets i+1$
  \ENDWHILE
\end{algorithmic}
\caption{Calculate $y = x^n$}
\label{alg:test}
\end{algorithm}

\end{document}

enter image description here