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

Algorithm 1: Generate Separator Line

1 Answer 1


Use the ruled package option:



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


enter image description here

  • your explanation is way succincter and clearer than algorithm2e's documentation! Thanks
    – sma
    Jun 19, 2012 at 14:30

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.