3

I'm currently attempting to place a frame around a figure in an Elsevier template. My figure contains 4 images in a 2 by 2 grid. When I try to use the command \fbox, all the images bunch up and the formatting is ruined.

Is there a way to fix this problem with minimal pain? Below is part of my code:

\begin{figure}[h]
\centering

\fbox{ 
\includegraphics[scale=0.25]{ews1}
\includegraphics[scale=0.25]{ews3}
\includegraphics[scale=0.25]{ews2}
\includegraphics[scale=0.25]{ews4}
     }
\label{f1}
\caption{}
\end{figure}

Thanks for your help.

  • \label must be placed after \caption – user31729 May 14 '16 at 18:24
4

Try to use a \parbox{...} inside of the \fbox{...} and leave an empty line after two of the \includegraphics statements.

\documentclass{elsarticle}

\usepackage{graphicx}


\begin{document}

\begin{figure}[h]
\centering

\fbox{ %
\parbox{0.7\textwidth}{%
 \centering

\includegraphics[scale=0.25]{ente}
\includegraphics[scale=0.25]{ente}

\includegraphics[scale=0.25]{ente}
\includegraphics[scale=0.25]{ente}
}
}
\caption{}
\label{f1}
\end{figure}


\end{document}

enter image description here

  • Thanks @Christian Hupfer, that does it. I'll accept the answer as soon as SE lets me. – Lucif3r May 14 '16 at 18:32
  • @JohnWayne360: Thanks. Happy TeXing! – user31729 May 14 '16 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.