7

Using IEEEtran package, I want to place two figures with two captions (one right one left) in a column. A layout like this

----------------------------    ----------------------------
----------------------------    ----------------------------
----------------------------    
----------------------------     *********     **********
----------------------------     *********     **********
----------------------------     *********     **********
----------------------------     *********     **********
----------------------------     *********     **********
----------------------------     caption1       caption2
----------------------------    
----------------------------    ----------------------------
----------------------------    ----------------------------

When I search for that, the results mostly explain about "how to put a wide figure on two columns".

current code which stack the figures is listed below

\begin{figure}[!h]
    \centering
    \includegraphics[width=0.6\textwidth]{figs1.eps}
    \caption{caption1}
    \label{f1}
\end{figure}  

\begin{figure}[!h]
    \centering
    \includegraphics[width=0.6\textwidth]{figs2.eps}
    \caption{caption2}
    \label{f2}
\end{figure}  

What is the solution then?

UPDATE

After applying the method in the answer, the width of caption2 exceeds the column width. I used the codes that I understood from the answer. Please let me where did I made the mistake

\begin{figure}[!h]
\begin{minipage}[t]{0.5\linewidth}
    \centering
    \includegraphics[width=1\textwidth]{figs1.eps}
    \caption{caption1}
    \label{f1}
\end{minipage}
\hspace{0.1cm}
\begin{minipage}[t]{0.5\linewidth} 
    \centering
    \includegraphics[width=1\textwidth]{figs2.eps}
    \caption{caption2}
    \label{f2}
\end{minipage}        
\end{figure}  

enter image description here

  • 2
    Regarding the code in the follow-up posting: First, you shouldn't set the widths of the minipages to exactly 0.5\columnwidth; choose something like 0.45\columnwidth instead. Second, don't use a fixed amount of spacing between the minipages unless you really intend to exceed the width of the column. Instead of \hspace{0.1cm}, use \hspace{\fill}. Finally, do omit the \centering instructions: They're redundant since the graphs are being set to the full widths of the minipages. – Mico Jan 11 '15 at 10:08
  • 1
    You didn't follow exactly my code... That's why you have the caption exceedind the column. – karlkoeller Jan 11 '15 at 10:13
  • Yes... but I now understand :) – mahmood Jan 11 '15 at 10:14
12

You can insert two minipages inside a single figure environment.

\documentclass{IEEEtran}
\usepackage[demo]{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1-8]

\begin{figure}[htbp]
\begin{minipage}[t]{0.45\linewidth}
    \includegraphics[width=\linewidth]{figs1.eps}
    \caption{caption1}
    \label{f1}
\end{minipage}%
    \hfill%
\begin{minipage}[t]{0.45\linewidth}
    \includegraphics[width=\linewidth]{figs2.eps}
    \caption{caption2}
    \label{f2}
\end{minipage} 
\end{figure}

\lipsum[1]

\end{document} 

enter image description here

  • You may want to mention what should be done if the two figures should, in fact, be allowed to "float". – Mico Jan 11 '15 at 8:45
  • @Mico BTW: I take this opportunity to congratulate you for your 100k reputation... Bravo! – karlkoeller Jan 11 '15 at 9:12
  • Many thanks -- I truly appreciate these best wishes!! I look forward to extending these wishes to you when you cross the mark as well! – Mico Jan 11 '15 at 9:18
  • Excuse me, what is the purpose of lipsum? I didn't use that. Instead I use \hspace{0.1cm}. Moreover, the length of caption2 exceeds the column width. – mahmood Jan 11 '15 at 9:44
  • 1
    @mahmood lipsum and the \lipsum command are just to typeset dummy text. – karlkoeller Jan 11 '15 at 9:46

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.