# Create separator lines for algorithm captions in algorithm2e

How I can generate separator lines for captions as follows in algorithm2e?

Algorithm 1: Generate Separator Line

-

Use the ruled package option:

\documentclass{article}
\usepackage[ruled]{algorithm2e}

\begin{document}

\begin{algorithm}
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}

\end{document}


-
your explanation is way succincter and clearer than algorithm2e's documentation! Thanks – pegausbupt Jun 19 '12 at 14:30