2

I am creating a latex project with the document class ieeeconf:

\documentclass[letterpaper, 10 pt, conference]{ieeeconf} 

I need to include some a figure with some subfigures, similar to what is shown in this article on positioning images (i.e. a figure with multiple subfigure images that each get there own caption numbering a,b,etc.) and another caption for the entire image: image with 2 subfigures that have subcaptions and a caption for the whole image

However, since I ham using the ieeeconf documentclass, I get warning errors if I try to use either the subcaption package (as recommended in the link above) or the subfig package (as I saw recommended elsewhere).

What is the correct package to use here?

4
  • Probably interesing: tex.stackexchange.com/a/305492/134144
    – leandriis
    Commented Jan 6, 2020 at 20:40
  • You could give \usepackage[caption=false]{subfig} a try. (caption=false is the important part.)
    – user2574
    Commented Jan 6, 2020 at 21:48
  • Thanks for the suggestion @leandriis I tried using the code there (the part with \ifCLASSOPTIONcompsoc but still got a bunch of errors, including: "\ifCLASSOPTIONcompsoc The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.)
    – Ariella
    Commented Jan 6, 2020 at 22:19
  • Thanks for the suggestion @AxelSommerfeldt Unfortunately, when I tried that, I got a 2 warning messages. 1. that my document class has a bad definition of \endfigure, 2. my document class has a bad definition of \endtable
    – Ariella
    Commented Jan 6, 2020 at 22:24

1 Answer 1

1

Set the images inside a tabular

enter image description here

\documentclass{IEEEconf}

\usepackage{lipsum,graphicx}

\begin{document}

\lipsum[1]

\begin{figure}
  \centering
  \begin{tabular}{ c @{\hspace{20pt}} c }
    \includegraphics[width=.3\columnwidth]{example-image-a} &
      \includegraphics[width=.3\columnwidth]{example-image-b} \\
    \small (a) &
      \small (b)
  \end{tabular}

  \medskip

  \caption{A figure caption}
\end{figure}

\end{document}

The space between the images is set using \hspace{20pt} in the tabular column specification. Also, the subfigure numbering is set using \small, with a skip between the images and the main figure caption using \medskip (a vertical skip of size \medskipamount).

2
  • Do you have any idea on how to reference the sub figure from text? Like: Fig. 3.b ?
    – Aryo
    Commented Sep 1 at 9:49
  • @Aryo: Try with this example. Since the main figure caption is placed at the end, you need to artificially step the figure counter so its proper value will be used inside a \label/\ref of the newly-defined subfigure counter.
    – Werner
    Commented Sep 3 at 16:56

You must log in to answer this question.

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