I have the following LaTeX code
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\begin{document}
\begin{algorithm}
do something\;
\caption{Algorithm #1}
\end{algorithm}
\begin{algorithm}
do something\;
\caption{Algorithm #2}
\end{algorithm}
\begin{algorithm}
do something\;
\caption{Algorithm #3}
\end{algorithm}
\end{document}
Given that I have initialised algorithm2e with the "ruled" option, the three algorithms appear with a nice ruled frame.
I want the second algorithm to appear with no frame at all, that is, just plain code. Is there a way to achieve this?
Thanks.
Best Answer
These options are set when loading the package and is meant to promote consistency. However, it's fairly trivial to adjust the algorithm style.
Below I've introduced
\algorithmstyle{<style>}
where you can specify/update the algorithm style to match any of the existing ones provided by the package:Default style choices include
plain
,plainruled
,boxed
,ruled
,algoruled
,boxruled
andtworuled
.