Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Removing the borders from algorithm listings

I am relatively new to Latex. If I use standard algorithm and algorithmic for my algorithm listings I'm getting the borders displayed around the table with the pseudocode. How to remove them? I als 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.

share|improve this question
    
@Jamie: enclose your inline code with a pair of ` signs so you can save more keystrokes than what you did (enclosing the code with <code>). :-) –  xport Jun 15 '11 at 13:14
add comment

migrated from stackoverflow.com Jun 15 '11 at 12:51

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Joseph Wright Aug 31 '11 at 16:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Something like this?

\documentclass{article}
\usepackage[plain]{algorithm}
\usepackage{algorithmic}
\begin{document}
\begin{algorithm}
\begin{algorithmic}
\REQUIRE $n \geq 0 \vee x \neq 0$
\ENSURE $y = x^n$
\STATE $y \leftarrow 1$
...
\end{algorithmic}
\caption{Calculate $y = x^n$}
\label{alg1}
\end{algorithm}
\end{document}

enter image description here

share|improve this answer
add comment