I want to have a box in my algorithm, and for that I'm using framed
environment. However, it also shifts line numbers:
\documentclass{article}
\usepackage[vlined,ruled,linesnumbered]{algorithm2e}
\usepackage{framed}
\begin{document}
\begin{algorithm}
aaa
\begin{framed}
bbb
\end{framed}
\end{algorithm}
\end{document}
How can I vertically align line numbers? \Indm
shifts the code, not the line numbers. \DecMargin
doesn't apply to individual lines.
I don't mind using another package/environment instead of framed
if you can recommend one: my only requirement is to have a box around a block of code.
I don't mind hardcoding the indentations if required.