I want to put an algorithm inside a box. Here is the code
\fbox{\parbox{0.8\linewidth}{
\begin{algorithm}
\caption{My algorithm}
\begin{algorithmic}[1]
\scriptsize
...
\end{algorithmic}
\end{algorithm}
}}
I am getting this error:
Not in outer par mode
following other error at the line where the two ending curly brackets are. The problem is solved when i remove the algorithm environment and i have only the algorithmic. But i want to have algorithm environment to put the caption.


algorithm2e, or thelistingspackage. With the oldalgorithmstuff this is not easily possible. – mafp Apr 23 '13 at 09:36algorithmis a float environment. If you put the box only inalgorithmicit should work.\begin{algorithm}\fbox{\begin{minipage}[b]{\textwidth} \begin{algorithmic} ... \end{agorithmic} \end{minipage}} end{algorithm}– cacamailg Apr 23 '13 at 10:31\fboxand\parboxinstead ofalgorithm2ebox features ? see more primitive TeX boxes – texenthusiast Apr 24 '13 at 08:42