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.

1
  • \label must be placed after \caption
    – user31729
    May 14, 2016 at 18:24

1 Answer 1

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .