[Tex/LaTex] Border or frame around figure

floatsframed

I'd like to place a border / frame around my figure.

The figure is a bunch of equations:

\begin{figure}[ht]
    \[ eqn 1 \]

    \[ eqn 2 \]

    \[ eqn 3 \]

    \caption{\label{myfig} My caption.}
\end{figure}

I've tried putting an \fbox{...} and \framebox[\textwidth]{...} around the equations but it doesn't work.

Preferably, I'd like the border to not include the caption.

Any hints are welcome…


Related question (though it concerns \includegraphics instead):

Best Answer

With the package mdframed or framed this is possible

\documentclass{article}
\usepackage{mdframed}
\begin{document}
\begin{figure}[ht]
\begin{mdframed}
    \[ eqn 1 \]

    \[ eqn 2 \]

    \[ eqn 3 \]
\end{mdframed}
    \caption{\label{myfig} My caption.}
\end{figure}
\end{document}