Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I found that the distance between the picture caption and the picture is a little large, as we can see in the pictureenter image description here

I use the code as follows, thus, how to reduce the distance between the caption and the picture?

\usepackage[latin1]{inputenc}
\usetikzlibrary{trees}
\usepackage{verbatim}
\usetikzlibrary{trees,decorations.pathmorphing}
 \begin{figure}[ht!]
{\centering
\tikzset{level 1/.style={level distance=1.0cm, sibling distance=0.5cm}}
\tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}
\begin{tikzpicture}[grow=down, -stealth,  edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=2mm}}]
    {\node[bag]{$S_0{:}(\{a{\mapsto}1\},A{<}a{=}1{>}B,t_{i_1}{\geq}0,0)$}
         child{edge from parent node{$$}; \node[bag]{$S_{n-1}{:}(...,stop_{good},t_{i_3}{\geq}3,0)$}
    };
    }
\end{tikzpicture}
}
\caption{LTS of A Pick Activity}
\end{figure}
share|improve this question

2 Answers 2

up vote 5 down vote accepted

Alternatively, you can use the skip key of the caption package; I used a value of 2pt, but you can choose the length that best suits your needs:

\documentclass{article}
\usepackage[skip=2pt]{caption}
\usepackage{tikz}
\usetikzlibrary{trees}

\begin{document}

\usetikzlibrary{trees,decorations.pathmorphing}
 \begin{figure}[ht!]
{\centering
\tikzset{level 1/.style={level distance=1.0cm, sibling distance=0.5cm}}
\tikzset{bag/.style={text width=20em, text centered,yshift=-0.2cm}}
\begin{tikzpicture}[grow=down, -stealth,  edge from parent/.style={draw,decorate,decoration={snake, post=lineto, post length=2mm}}]
    {\node[bag]{$S_0{:}(\{a{\mapsto}1\},A{<}a{=}1{>}B,t_{i_1}{\geq}0,0)$}
         child{edge from parent node{$$}; \node[bag]{$S_{n-1}{:}(...,stop_{good},t_{i_3}{\geq}3,0)$}
    };
    }
\end{tikzpicture}
}
\caption{LTS of A Pick Activity}
\end{figure}

\end{document}

enter image description here

share|improve this answer

The spaces before and after a caption are controlled by \abovecaptionskip and \belowcaptionskip. Thus you can change the distance before the caption with

\setlength{\abovecaptionskip}{0cm}

Change the value as appropriate.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.