Generalsubfigure | Control the horizontal Space between Sub-figures

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

subfigure | Control the horizontal Space between Sub-figures

Post by pallav »

I am using the following.

Code: Select all

\usepackage{graphicx,subfigure,float}
\addtolength{\subfigcapskip}{-25pt}
\addtolength{\subfigbottomskip}{-25pt}
\addtolength{\subfigtopskip}{-25pt}
I can control the vertical spacing between sub-figures (suppose, two figures in three rows). I am unable to control the horizontal spacing between two adjacent figure of each rows. Please suggest me to get rid of the problem.
Last edited by pallav on Wed Jan 09, 2013 10:58 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

subfigure | Control the horizontal Space between Sub-figures

Post by Stefan Kottwitz »

subfig provides some vertical skips, such as before and after a subcaption. I guess you need to put horizontal space between subfigures yourself by \hspace, \quad or similar, if you arrange subfigures horizontally.

Perhaps post a Infominimal working example with your subfig layout if you would have further questions. Some people, including me, rarely deal with tiny code snippets if a solution isn't already theoretically obvious. I usually test a solution before I suggest it, on runnable code.

Stefan
LaTeX.org admin
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

subfigure | Control the horizontal Space between Sub-figures

Post by pallav »

Here I am attaching a code. When we use

Code: Select all

\usepackage[demo]{graphicx} 
the figures in each row coming very close to each other and also the distance of two figs of a column is acceptable. There is indeed no need of

Code: Select all

\setlength{\abovecaptionskip}{-1pt}
\setlength{\belowcaptionskip}{-1pt}
\addtolength{\subfigcapskip}{-1pt}

But when the actual figs comes, it is necessary to squeeze the figures in order to avoid the unnecessary space between the figs. The above code helps me to handle the verticle distance of the figs.

But, when the gaps of figs of a row is larger than expectation, I am unable to handle to squeeze them together .

I am requesting to solve the issue (when using \usepackage{graphicx} instead of \usepackage[demo]{graphicx}, obviously).

Code: Select all

\documentclass[11pt]{article}
\usepackage{caption}
\usepackage{amsmath,amssymb,amsthm,subfigure,float}
%\usepackage{graphicx} 
\usepackage[demo]{graphicx} 
\setlength{\abovecaptionskip}{-1pt}
\setlength{\belowcaptionskip}{-1pt}
\addtolength{\subfigcapskip}{-1pt}
 \begin{document}
\begin{figure}
\centering
\subfigure[\tiny{$\lambda_1=0, \lambda_2=0$}]{
    \includegraphics[height=1.5in,width=2in]{A.eps}
    \label{fig:A_D_subfigure501}
		}
\subfigure[\tiny{$\lambda_1=0.1, \lambda_2=0.05$}]{
    \includegraphics[height=1.5in,width=2in]{B.eps}
    \label{fig:A_D_subfigure502}
}
\subfigure[\tiny{$\lambda_1=0.11, \lambda_2=0.05$}]{
    \includegraphics[height=1.5in,width=2in]{C.eps}
    \label{fig:A_D_subfigure503}
		}
\subfigure[\tiny{$\lambda_1=0.18, \lambda_2=0.05$}]{
    \includegraphics[height=1.5in,width=2in]{D.eps}
    \label{fig:A_D_subfigure504}
		}
\caption{\scriptsize (Colour online) The Fig.
} 
 \label{fig:one}
\end{figure}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

subfigure | Control the horizontal Space between Sub-figures

Post by localghost »

The subfigure package is obsolete for a long time and should be replace by subfig (or another corresponding package).


Thorsten
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

Re: subfigure | Control the horizontal Space between Sub-fig

Post by pallav »

How to use? Any hints please.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

subfigure | Control the horizontal Space between Sub-figures

Post by Stefan Kottwitz »

pallav wrote:How to use? Any hints please.
No problem: subfig manual, with examples and reference.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

subfigure | Control the horizontal Space between Sub-figures

Post by cgnieder »

Since you're using the »caption« package already it's probably best to use the subcaption package (documentation: subcaption). It is from the same author and plays together with »caption« nicely.

Regards
site moderator & package author
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

subfigure | Control the horizontal Space between Sub-figures

Post by Stefan Kottwitz »

I support this, for example I remember subcaption worked better with hyperref than subfig (there was at least a bug),

Stefan
LaTeX.org admin
Post Reply