3

I used following solution : ( https://tex.stackexchange.com/a/540197/148579 ) in order to put multiple figures next to each other only in a single line.

But, I received following error:

Apparently, \usepackage{subfigure} cannot be used at the same time with \usepackage{subcaption} that I need it as well.

RECEIVED ERROR :

Package subcaption Error: This package can't be used in cooperation(subcaption) with the subfigure package. \begin{document}

This one one I did (exactly similar the proposed mentioned solution):

\begin{figure}
\centering
\subfigure[]{\includegraphics[width=0.24\textwidth]{Part_1_in_Figure}} 
\subfigure[]{\includegraphics[width=0.24\textwidth]{Part_2_in_Figure}} 
\subfigure[]{\includegraphics[width=0.24\textwidth]{Part_3_in_Figure}}
\caption{(a) blah (b) blah (c) blah}
\label{fig:foobar}
\end{figure}

Thank you to propose a solution to fix this error, or completely another solution.

  • 1
    The simplest solution: Just don't load the subfigure package. It's buggy and badly deprecated. Why are you trying to use it? You can place multiple subfigures next to each with the machinery of the subcaption package alone; you do not need the subfigure package to get this job done. – Mico Jul 04 '21 at 18:00
  • @Micro, Yes, apparently it is a goods solution. I selected it as I sew the inserted images in the answer such as I was expected the same output. Could you please present me other better alternative solutions with the same result. Thanks – Questioner Jul 04 '21 at 19:55
  • Please show what you've tried so far, and do please mention which document class you use. (Not all subfigure-related packages are compatible with all document classes.) – Mico Jul 04 '21 at 19:58
  • @Mico , I added what I did by editing the question. (\documentclass[conference]{IEEEtran}) – Questioner Jul 04 '21 at 20:16

1 Answers1

3

Here's how the OP's code might be re-cast in terms of macros provided by the subcaption package.

\documentclass{article}
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{subcaption}
\begin{document}

\begin{figure} \subfloat[bla bla]{\includegraphics[width=0.31\textwidth]{Part_1_in_Figure}}\hfill \subfloat[blb blb]{\includegraphics[width=0.31\textwidth]{Part_2_in_Figure}}\hfill \subfloat[blc blc]{\includegraphics[width=0.31\textwidth]{Part_3_in_Figure}} \caption{Overall figure caption} \label{fig:foobar} \end{figure} \end{document}

Mico
  • 506,678