7

I use a lot of subfigures in my thesis. What I realize now is that the captions between adjacent subfigures are very close together, which makes them hard to read.

My two questions are therefore:

(1) How can the default distance between two subfigures be increased?

or

(2) How can the default width of a subfigure caption be decreased?

Example code:

\usepackage{subfigure}
...
\begin{figure}[h!t]
\centering
\subfigure[long long caption]{
    \includegraphics{filename1}
}
\subfigure[another long caption]{
    \includegraphics{filename2}
}
\caption{two subfigures}
\end{figure}

Thx

Thomas
  • 531
  • 2
    How do you place them? Which package do you use to place them? Can you provide a small example code? – percusse Aug 21 '12 at 08:50
  • Here the example code:
    \usepackage{subfigure}
    ...
    \begin{figure}[h!t]
    

    \centering \subfigure[long long caption]{ \includegraphics{filename1} } \subfigure[another long caption]{ \includegraphics{filename2} } \caption{two subfigures} \end{figure}

    – Thomas Aug 21 '12 at 11:49
  • See this question before anything: http://tex.stackexchange.com/questions/13625/subcaption-vs-subfig – percusse Aug 21 '12 at 11:51

1 Answers1

6

It depends on that you use subfig, subcaption or the subfigure package (this last actually deprecated in CTAN).

An example with the deperecated subfigure:

\documentclass[spanish,11pt]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}

% Compare between loose and normal option in the fig. 1 % (see more options in the documentation)
\usepackage[normal]{subfigure} % \usepackage[loose]{subfigure}

% Compare fig. 1 and 2. subcaptions fixing this value \subfigcapmargin = .5cm

% Fix these other commands as you want and see % \subfigtopskip = 2cm % \subfigcapskip = 2cm % \subfigcaptopadj = 7cm % when caption is above % \subfigbottomskip = 2cm % \subfiglabelskip = 2cm

% See fig 3 to 6 examples of set distances % between subfigures % (there are not any space default, as far I know)

\begin{document}

\begin{figure}% \centering \subfigure[subcaption aa aa aa aa]{\framebox{... ... figure text ... ...}} \subfigure[subcaption bb bb bb bb]{\framebox{... ... figure text ... ...}} \caption[The caption]{The caption} \end{figure}

\subfigcapmargin = .0cm

\begin{figure}% \centering \subfigure[subcaption aa aa aa aa]{\framebox{... ... figure text ... ...}} \subfigure[subcaption bb bb bb bb]{\framebox{... ... figure text ... ...}} \caption[The caption]{The caption} \end{figure}

\begin{figure}% %\centering \subfigure[subcaption]{\framebox{... figure text ...}}\hfill \subfigure[subcaption]{\framebox{... figure text ...}} \caption[The caption]{The caption} \end{figure}

\begin{figure}% %\centering \subfigure[subcaption]{\framebox{... figure text ...}}\qquad \subfigure[subcaption]{\framebox{... figure text ...}} \caption[The caption]{The caption} \end{figure}

\begin{figure}% \centering \subfigure[subcaption]{\framebox{... figure text ...}} \hspace{3cm} \subfigure[subcaption]{\framebox{... figure text ...}} \caption[The caption]{The caption} \end{figure}

\begin{figure}% \centering \subfigure[subcaption]{\framebox{... figure text ...}} \\hspace{5cm}\vspace{1cm} \subfigure[subcaption]{\framebox{... figure text ...}} \caption[The caption]{The caption} \end{figure}

\end{document}

Another solution is to use subcaption package (not compatible with subfigure) as is or with some options, since spacing among subfigures are as in any other floats. Example:

\documentclass{article}
\usepackage{subcaption}
\usepackage[margin=20pt,
font+=small,labelformat=parens,labelsep=space,
skip=6pt,list=false,hypcap=false
]{subcaption}
\begin{document}

\begin{figure}% \centering \begin{subfigure}[h]{0.3\textwidth} \framebox{... figure text ...} \caption{subcaption} \end{subfigure} \begin{subfigure}[h]{0.3\textwidth} \framebox{... figure text ...} \caption{subcaption} \end{subfigure}%

\caption[The caption]{Subfigures with default space and too much margin in subcaptions}

\end{figure}

\begin{figure}% \centering \begin{subfigure}[h]{0.3\textwidth} \framebox{... figure text ...} \caption{subcaption} \end{subfigure} \hspace{0.3\textwidth} \begin{subfigure}[h]{0.3\textwidth} \framebox{... figure text ...} \caption{subcaption} \end{subfigure}%

\caption[The caption]{Subfigures with extra space}

\end{figure}

\end{document}

Similarly, with subfig package you can also control space between subfloats simply with commands as \qquad and also control many subcaptions options. See the documentation packages.

\documentclass{article}
\usepackage[margin=40pt]
{subfig}
\begin{document}
\begin{figure}%
\centering
\subfloat[][subcaption aa aa aa ]{\framebox{... ... figure text ... ... }}%
\qquad 
\subfloat[][subcaption bb bb bb ]{\framebox{... ... figure text ... ... }}%
\caption{The caption}%
\label{fig:cont}%
\end{figure}
\end{document}
Fran
  • 80,769
  • Take a look at the question I have linked above in the comments. – percusse Aug 21 '12 at 12:21
  • Thanks, the \subfigcapmargin = .5cm works. – Thomas Aug 21 '12 at 12:39
  • There's no reason why subfig should be deprecated. Of course it's alternative to subcaption. – egreg Sep 02 '12 at 15:18
  • I dont know, @egreg, but from the TeX Catalogue in Line: This package [subfig] supersedes the subfigure package ... The functionality of the package is provided by the (more recent still) subcaption package. (I known... newer is not a solid reason, but ask to Google). – Fran Sep 02 '12 at 16:23
  • subfig and subcaption are just two packages that do similar things with different approaches. – egreg Sep 02 '12 at 16:52
  • @egreg,I'm afraid I have not explained clearly (sorry for my poor English). I do not dispute this. The subject is perfectly explained in @percusse link. Just wanted to say that the belief that subfig is deprecated appears in may pages, and not only those with novice dialogs, but also in webs that may be are considered good references. An example is wikibooks. The categorical statement about has been transcribed verbatim in many other pages. – Fran Sep 02 '12 at 18:18
  • I would be very cautious in considering Wikibooks an authoritative reference about LaTeX; IOW, I don't consider it such. – egreg Sep 02 '12 at 19:24
  • subfig is (AFAIK) unmaintained, but definitely not deprecated. –  Oct 28 '16 at 09:27
  • @AxelSommerfeldt OK, I finally removed in this old answer any mention to deprecated packages, as seem clear that look like I think, but it was only what I saw (and anyone can still see) in some Internet places, without stating my opinion. Long life to subfig! – Fran Oct 28 '16 at 10:54