3

I want to adjust the space in a subfigure environment. Specifically, using \subfigcapskip to increase the space between the subfigure and subcaption, and using \subfigtopskip to reduce the space on the top of the subfigure, simultaneously. I know that I can use either \subfigcapskip or \subfigtopskip in the following way, but how can I use \subfigcapskip and \subfigtopskip simultaneously?

\documentclass[9.5pt,conference,compsocconf,letterpaper]{IEEEtran}
\usepackage{graphicx}
\usepackage{subfigure}


\begin{document}

\begin{figure}[]
    \centering
    \begin{minipage}[htp]{0.5\textwidth}
        {\subfigcapskip = 20pt \subfigure[text A]{\includegraphics[width=0.47\textwidth]{a.eps}}}
        \subfigure[text B]{\includegraphics[width=0.47\textwidth]{b.eps}}
        \caption{text C}
    \end{minipage}
\end{figure}


\end{document}
  • 3
    Can you please make this into a minimal working example, from \documentclass to \end{document}, with the necessary packages for reproducing the issue? If you're using the subfigure package, then note that it has been deprecated for more than a decade. – egreg Mar 7 '14 at 10:01
  • @egreg A MWE is added. As you said subfigure has been deprecated for more than 10 years, then what package should I use to deal with sub-figures? – Bloodmoon Mar 8 '14 at 12:26
  • @Bloodmoon - You should consider using the subcaption package. – Mico Mar 8 '14 at 12:54
  • @Mico I see. Any idea about this question? I've been looking around but cannot find anything helpful. – Bloodmoon Mar 8 '14 at 13:46
1

The subfigure package is deprecated. With IEEEtran you can use subfig, with the option caption=false that doesn't load the incompatible package caption.

I repeat the figure twice, one with the default setting, one with a setting for farskip and nearskip to show the difference.

Note that the demo option for graphicx is just not to bother with a real file; the kantlipsum package provides mock text.

\documentclass[9.5pt,conference,compsocconf,letterpaper]{IEEEtran}
\usepackage[demo]{graphicx} % demo is just for the example
\usepackage[caption=false]{subfig}
\usepackage{kantlipsum} % just for the example

\begin{document}

\kant[1]

\begin{figure}[htp]
\centering
\subfloat[text A]{\includegraphics[width=0.47\columnwidth]{a.eps}}\hfill
\subfloat[text B]{\includegraphics[width=0.47\columnwidth]{b.eps}}
\caption{text C}
\end{figure}

\kant[2]

\begin{figure}[htp]
\captionsetup[subfloat]{farskip=0pt,nearskip=0pt}
\centering
\subfloat[text A]{\includegraphics[width=0.47\columnwidth]{a.eps}}\hfill
\subfloat[text B]{\includegraphics[width=0.47\columnwidth]{b.eps}}
\caption{text C}
\end{figure}

\kant

\end{document}

enter image description here

  • Since the two subfloats are now separated maximally via \hfill, is the \centering instruction needed (or useful)? – Mico Mar 8 '14 at 16:56
  • @Mico It's handy to have it anyway. – egreg Mar 8 '14 at 17:03
  • Thanks for your answer and detailed explanation of the package options. But I want to adjust individually adjust the space of a single sub-figure, e.g., Fig. 2(b) in the above example, rather than a one-fit-all rule. How can I do that? – Bloodmoon Mar 9 '14 at 3:35
  • @Bloodmoon It's difficult to understand without a more detailed example. Why would you change the parameters for just one subfigure? – egreg Mar 9 '14 at 9:47

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.