I am more and more convinced that algorithm2e
is badly designed, basically because it reinvents the wheel for quite a lot of things (e.g., captions). Alas, it's too late to switch. So here's my next question:
How do I get rid of the ugly margins of the following algorithm? (the margins to both sides of the caption, and the margin on the right of the algorithm)
\documentclass{scrartcl}
\usepackage[ruled]{algorithm2e}
\usepackage{lipsum}
\setlength{\algomargin}{0em}
\begin{document}
\begin{algorithm}
\caption{\lipsum[1]}
\For{$x$}{$y$\tcp*[r]{$z$}}
\end{algorithm}
\lipsum[2]
\end{document}
algorithm2e
?[H]
float specifier, separating algorithm and float would be some improvements I can think of. But – I have decided to usealgorithm2e
, so I'll have to live with it.