2

I am using minipage within figure environment, and I want to maintain only the figure name, and sort of "sub caption" to the minipage.

MWE:

Currently, this is how I plot the figure:

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


\begin{document}

\begin{figure}
  \centering
  \begin{minipage}{0.48\linewidth}
       \centering
        \includegraphics[width=\linewidth]{a}
        \caption{a part }
    \end{minipage}
    \hfill
   \begin{minipage}{0.48\linewidth}
        \centering
         \includegraphics[width=\linewidth]{b}
          \caption{b part}
    \end{minipage}
\end{figure}

\lipsum[1]
\end{document}

Which produces:

enter image description here

Require figure title format:

enter image description here

2
  • Will you be need to cross-reference the subfigures?
    – Mico
    May 27 at 13:12
  • Not really. I will only cross-reference the entire figure in my text. Where needed, I will use (a) and (b) to describe the subfigures.
    – arilwan
    May 27 at 13:15

2 Answers 2

2

Since you don't need to cross-reference the subfigures individually, you don't need custom \caption directives for them.

enter image description here

Aside: As the subcaption package isn't fully compatible with the IEEEtran document class, this answer deliberately doesn't make use of the that package.

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

\begin{document}

\begin{figure}[h]
  \begin{minipage}[b]{0.48\linewidth}
  \includegraphics[width=\linewidth]{a}
  
  \medskip\footnotesize\centering (a) part 
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.48\linewidth}
  \includegraphics[width=\linewidth]{b}
  
  \medskip\footnotesize\centering (b) part
  \end{minipage}

\caption{Required output format} \label{fig:required}
\end{figure}

A cross-reference to Figure \ref{fig:required}.

\lipsum[1]

\end{document}
2

Edit:

  • Use of the subcaption package in ˙IEEEtrandocumentclass throw warning, thatcaptionpackage (which is loaded bysubcaption` package) will not be used but default document class caption settings.
  • However, if instead of it is used older subfig package, there is not problems (warning, error) at compilation, since it is compatible with IEEEtra document class. So the posible simple solution for your problem can be:
\documentclass[conference]{IEEEtran}
\usepackage{graphicx}
%\usepackage{subcaption}   it givers warning that instead `caption` is used default caption setup.
\usepackage{subfig}% works without any problem
\usepackage{lipsum}


\begin{document}
\lipsum[1]
\begin{figure}[ht]
    \centering
\setkeys{Gin}{width=0.48\linewidth}
\subfloat[part]{\includegraphics{example-image-a}}
\hfill 
\subfloat[part]{\includegraphics{example-image-b}}
    \caption{Required output format} 
    \label{fig:required}
\end{figure}

A cross-reference to Figure \ref{fig:required}.

\lipsum[2-7]
\end{document}

enter image description here

2
  • 1
    My problem with subcaption in IEEEtran is messing up with my settings. Package subcaption Error: This package can't be used in cooperation
    – arilwan
    May 27 at 14:26
  • 1
    @arilwan, i got only warning that instead of caption will be used default caption setup. However, this warning disappear if instead subcaption is used subfig package, Now added to my MWE.
    – Zarko
    May 27 at 17:06

You must log in to answer this question.

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