I want to reduce the padding between figures and text. I know I can achieve this using \setlength{\belowcaptionskip}{-7pt}
but this will reduce the padding of all figures. How can I accomplish this only for certain figures?
1 Answer
You can insert a negative \vspace
at the end of the image insertion - this will result in moving the caption up by the given amount, visually "reducing" the image size.
\documentclass{article}
\usepackage{graphicx,lipsum}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[height=10\baselineskip]{example-image-a}
\caption{This is a figure caption.}
\end{figure}
\lipsum[1-7]
\begin{figure}[t]
\centering
\includegraphics[height=10\baselineskip]{example-image-b}
\vspace{-5\baselineskip}% Reduce image height
\caption{This is a figure caption.}
\end{figure}
\end{document}
The same can be achieved with adjustbox
using its vspace = <above> <below>
option.
\usepackage[export]{adjustbox}
% ...
\includegraphics[vspace=0pt -5\baselineskip,height=10\baselineskip]{example-image-b}
This can be done an a figure-by-figure basis.
~\\[10pt]
(or whatever the appropriate spacing amount) right after your\end{figure}
.\belowcaptionskip
use it inside of thefigure
environment.\vspace{<len>}
(where<len>
is negative) before your\caption
.\begin{figure}\begin{center} ... \end{center}\end{figure}
, instead of\begin{figure}\centering ... \end{figure}
?