I am trying to achieve something like this:
This image is linked from this answer. This answer also provides a solution and seems simpler. Both answers deal with the algorithmicx
package however. I am interested in the solution for the algorithm2e
package.
I read the documentation of the algorithm2e
package but didn't find an answer.
How can I achieve the colored effect?
EDIT:
Here is sample code to create a minimum working example.
\documentclass{article}
\usepackage[ruled]{algorithm2e} % http://www.ctan.org/pkg/algorithm2e
\begin{document}
\begin{algorithm}[h]
\caption{Evolutionary algorithm}
initialize population \;
\For( \emph{Evolutionary loop}){$g := 1$ to $G_{max}$}
{
do things \;
evolve population \;
}
celebrate \;
\end{algorithm}
\end{document}