Border or frame around figure

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}

Using memoir (a package for books), you can use the

\begin{framed}
[...]
\end{framed} 

construct. See manual pages 181-183.


IF you don't want to use the memoir documentclass, as is suggested in @Sardathrion's answer, you could use the float package and, in particular, its \floatstyle{boxed} and \restylefloat commands.

A nice feature of the float package is that it provides the H location specifier, as in "I really want this float HERE and nowhere else". Two idiosyncracies of the "boxed" float style are (i) the width of the boxes is that of \textwidth (plus a small fudge factor, so that an object of full \textwidth width fill fit) and (ii) captions of table and figure floats will always be placed below the respective objects. (To change this behavior, one will have to delve into the innards of the code of the float package.)

Aside: if you set tables with the "boxed" float style, you'll definitely want to use as few \hline commands as possible (or, even better, none at all).

\documentclass{article}
\usepackage{float,lipsum}
\floatstyle{boxed}
\restylefloat{table}
\restylefloat{figure}
\begin{document}
\lipsum[1]
\begin{figure}[H]
\centering
ABCDEFG
\caption{A very simple figure}
\end{figure}

\bigskip
\begin{table}[h]
\caption{An equally simple table}
\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}rlrlr@{}}
Here & There & Here & There & Here & There 
\end{tabular*}
\end{table}

\lipsum[2]
\end{document}

enter image description here

Tags:

Floats

Framed