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.
Best Answer
To make that a real answer: If you want a box around
I suggest to switch to the
algorithm2e
package. The above can be roughly mimicked with