I have stumbled across various pseudo code packages but can't seem to find that's simple and eye-candy and practical.
What I'm looking for:
- Visually attractive structure (eye-candy) ( easy to look at — understandable )
- Numbered
- Colored (optional)
- Title on top
- Practical and easy to use
The one I'm using now is
\documentclass[12pt,a4paper]{report}
\usepackage{algorithm2e} %for psuedo code
\usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}
\begin{document}
\begin{algorithm}[H] %or another one check
\caption{How to write algorithms}
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\end{algorithm}
\end{document}
which outputs
However, I do not really like how the code is presented here.
Best Answer
Probably the user who asked this question is not interested in my answer anymore. But I was in the same quest didn't find any good-looking algorithm package (for my taste).
Since I'm a fan of the Listings package I followed Ruben's suggestion and created my own environment. Features:
Here follows the code to go in the preamble!
Now you can use as simple as follows:
Hope you enjoy as much as I did :P