This post has beautifully shown how to make the algorithm pseudocode box as wide as one column or two columns.
I am now writing a pseudocode with many if
layers. So a one-column box cannot suffice. However, the layers are not that many to span over two columns. So my problem is that if I use the two-column box, the RHS is too empty and the comments are too far away from the code.
One-column, too narrow. Two-column, too wide.
Can I define the width of the algorithm box myself, say 1.5 columns wide?
Best Answer
You can place the
algorithmic
environment inside aminipage
of desired width (for example,1.5\columnwidth
):To reduce the box size itself, it is far more convenient to remove the
boxed
float style, and mere wrap theminipage
dalgorithmic
environment inside an\fbox
: