# How to adjust the gap between figure and caption in subfloat [duplicate]

For the following example:

\begin{figure}
\centering
\subfloat[A]{\includegraphics[ scale=0.5]{images/a.jpg}}
\vspace{-10pt}
\subfloat[B]{\includegraphics[scale=0.5]{images/b.jpg}}
\vspace{-10pt}
\caption{}\label{fig:online_test}
\end{figure}


I got the following figure:

The sub-caption of (a) is too close to the sub-figure B. How can I adjust the space between the caption and figure within a subfloat?

Thank you all for helping me and I would prefer a solution for subfloat, instead of using other packages. But I would also appreciate a solution of using other packages.

I know my question looks similar to this question. But please make it clear. I'm asking for how to adjust the gap between figure and caption within a subfloat, not the gap between two subfloat. That is, the gap between the caption "a" and the figure "A"!!!

I would keep arguing until my question get re-opened.

## marked as duplicate by Stefan Pinnow, Troy, TeXnician, Schweinebacke, MicoAug 12 '17 at 10:50

• Have you seen egreg's answer in the linked question? "with captionskip we set the distance from the subfigure and the caption." – Troy Aug 12 '17 at 9:34