I am using the algorithm2e package with the boxruled option to format my pseudo-code. However, I am getting an overfull hbox, which I suspect is due to margin/box conflicts.
Does anyone have a fix for this? Minimal working example provided:
\documentclass[11pt]{llncs}
\usepackage[boxruled]{algorithm2e}
\SetAlFnt{\scriptsize}
\SetAlCapFnt{\scriptsize}
\SetAlCapNameFnt{\scriptsize}
\begin{document}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{input}
\KwResult{output}
a;
b;
c;
\caption{lalala}
\end{algorithm}
\end{document}
Best Answer
The coding for the
boxruled
option produces a box that doesn't take into account the width of the rules. This can be corrected as follows, by redefining one internal command:The newcommand differs from that in the style file by (a) printing the horizontal rule first and (b) hiding the widths (
0.4pt
) of the vertical rules. This essentially how\framebox
works, which is what is used for boxing up the body of the algorithm. It can't be used on the caption as one doesn't want to double the dividing rule.