[Tex/LaTex] Trying to put a box around a collection of subfigures

framedieeetransubfloats

I'm trying to have a bounding box around the following figure:

\begin{figure}[htp]
\begin{center} 
\subfigure[Process with no error]{\label{noerror}\includegraphics[width=1.5in]{noerror-process}}
\subfigure[Process with syntactic  errors (connector having multiple incoming edges and presence of hanging node)]{\label{synerror}\includegraphics[width=1.5in]{synerror-process}} \\
\subfigure[Process with deadlock]{\label{deadlock}\includegraphics[width=1.5in]{deadlock-process}}
\subfigure[Process with lack of synchronization]{\label{lacksync}\includegraphics[width=1.5in]{lacksync-process}}
\end{center} 
\caption{Different kinds of errors occuring in InFlux Processes}
\label{processes}
\vspace*{-0.65cm}
\end{figure}

Can you please help?

Best Answer

The following example shows possibilites with the package framed, tcolorbox and adjustbox.

enter image description here enter image description here enter image description here

\listfiles
\documentclass[demo]{article}
\usepackage{framed}
\usepackage{tcolorbox}
\usepackage{adjustbox}

\usepackage[]{graphicx}
\usepackage{subfigure}
\begin{document}
\section{Package \texttt{frame}}

\begin{figure}[!htp]
\begin{framed}
\centering
\subfigure[Process with no error]{\label{noerror}\includegraphics[width=1.5in]{noerror-process}}\qquad
\subfigure[Process with syntactic  errors (connector having multiple incoming edges and presence of hanging node)]{\label{synerror}\includegraphics[width=1.5in]{synerror-process}}

\subfigure[Process with deadlock]{\label{deadlock}\includegraphics[width=1.5in]{deadlock-process}}\qquad
\subfigure[Process with lack of synchronization]{\label{lacksync}\includegraphics[width=1.5in]{lacksync-process}}
\caption{Different kinds of errors occuring in InFlux Processes}
\end{framed}
\end{figure}
\clearpage
\section{Package \texttt{tcolorbox}}

\begin{figure}[!htp]
\begin{tcolorbox}
\centering
\subfigure[Process with no error]{\label{noerror}\includegraphics[width=1.5in]{noerror-process}}\qquad
\subfigure[Process with syntactic  errors (connector having multiple incoming edges and presence of hanging node)]{\label{synerror}\includegraphics[width=1.5in]{synerror-process}}

\subfigure[Process with deadlock]{\label{deadlock}\includegraphics[width=1.5in]{deadlock-process}}\qquad
\subfigure[Process with lack of synchronization]{\label{lacksync}\includegraphics[width=1.5in]{lacksync-process}}
\caption{Different kinds of errors occuring in InFlux Processes}
\end{tcolorbox}
\end{figure}
\clearpage
\section{Package \texttt{adjustbox}}

\begin{figure}[!htp]
\begin{adjustbox}{minipage=\linewidth,frame}
\centering
\subfigure[Process with no error]{\label{noerror}\includegraphics[width=1.5in]{noerror-process}}\qquad
\subfigure[Process with syntactic  errors (connector having multiple incoming edges and presence of hanging node)]{\label{synerror}\includegraphics[width=1.5in]{synerror-process}}

\subfigure[Process with deadlock]{\label{deadlock}\includegraphics[width=1.5in]{deadlock-process}}\qquad
\subfigure[Process with lack of synchronization]{\label{lacksync}\includegraphics[width=1.5in]{lacksync-process}}
\caption{Different kinds of errors occuring in InFlux Processes}
\end{adjustbox}
\end{figure}

\end{document}