88

I m importing one image in latex document. But caption has bigger font than my normal text on page.

\documentclass{article}
\usepackage{graphicx}

\begin{document}

  Some text...

  \begin{figure}[htb]
  \begin{center}
  \includegraphics[height=1in,width=1in,angle=-90]{foo}
  \caption{This is a figure.}
  \end{center}
  \end{figure}

   More text...

  \end{document}

How to reduce the font size of caption and space between caption and image?

hpesoj626
  • 17,282
manish
  • 9,111

5 Answers5

102

You can do it with caption package. The space between the caption and the figure is called skip (default is 10pt).

\documentclass{article}
\usepackage[demo]{graphicx} %% Remove [demo] in your file
%\usepackage{caption}
%\captionsetup[table]{font=small,skip=0pt}     %% Adjust here
%or equivalently 
\usepackage[font=small,skip=0pt]{caption}

\begin{document}

  Some text...

  \begin{figure}[htb]
  \begin{center}
  \includegraphics[height=1in,width=1in,angle=-90]{foo}
  \caption{This is a figure.}
  \end{center}
  \end{figure}

   More text...

  \begin{table}[htb]
  \centering
  \caption{This is a table.}
  \begin{tabular}{|c|c|}
    \hline
    % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
    1 & 2 \\
    4 & 7 \\
    \hline
  \end{tabular}
  \end{table}

     More text...

  \end{document}

enter image description here

Please note that \captionsetup{font=small,skip=0pt} affects both tables and figures. If you want it separately, you may use:

 \captionsetup[table]{font=small,skip=0pt}

for tables only or

\captionsetup[figure]{font=small,skip=0pt}

for figures only.

David Carlisle
  • 757,742
  • 1
    I was about to edit my answer to contain the explanation but you already have it in yours so I am deleting my answer :) – hpesoj626 Jan 16 '13 at 05:03
  • 1
    As much as I enjoy earning reputation, I enjoy better answers more. :) Making mine better is out of the question since it will look like a duplicate of your answer. +1 anyway. – hpesoj626 Jan 16 '13 at 05:10
  • 1
    @hpesoj626 Nice of you. I basically enjoy troubleshooting (and learning in turn). Everything comes next :-) –  Jan 16 '13 at 05:15
  • Can we do the same for table? – manish Jan 16 '13 at 06:22
  • 1
    @user15662 The setup here will affect both figures and tables. If you want to separate caption settings for tables and figures set \captionsetup[table]{} and \captionsetup[figure]{} separately. – hpesoj626 Jan 16 '13 at 06:52
  • 1
    How do I change the value of skip locally ? Not for all the document. – LMT-PhD May 07 '14 at 08:43
  • @LMT-PhD Put \captionsetup[figure]{skip=0pt} inside \begin{figure} (just after \begin{figure} say), then it is local. –  May 07 '14 at 08:59
  • 1
    Doesn't work for me – LMT-PhD May 07 '14 at 09:05
  • @LMT-PhD Doen't work is not giving any hint. \begin{figure}[htb] \captionsetup{font=small,skip=0pt} \centering \includegraphics[height=1in,width=1in,angle=-90]{foo} \caption{This is a figure.} \end{figure} works for me. –  May 07 '14 at 09:32
  • @Kumar: For me adding \captionsetup does nothing, whether inside figure environment or just before it. – truthseeker May 07 '15 at 18:33
  • When using this solution, my figure numbers were replaced with question marks in the text. – cryptic0 Feb 13 '19 at 16:55
  • For people who use subcaption package: you can also give the option skip to subcaption package – Cyriac Antony Aug 08 '19 at 11:44
  • your way saved my work! thanks – Mikasa Sep 22 '23 at 09:44
  • 2023 update: \captionsetup[table]{..., aboveskip=0pt, belowskip=0pt} works. They accept negative values as well. – Jovial Joe Jayarson Nov 21 '23 at 02:52
13

For locally change the caption position you can also use a negative value on the setting. For example, when the figure has larger white part, e.g use \vspace{-1cm}, instead of changing the figure itself.

11

A brute force \vspace{1pt} just before the caption, inside any figure, also works if one wants to change spacings locally.

8

Just add a vspace*{-3mm}:

\begin{figure}[htbp]
    \centering
    \includegraphics[width=0.74\textwidth]{figs/Subplt.pdf}
    \vspace*{-3mm}
    \caption{Inverter-level and macro-level MAPE bootstrap distributions.}
    \label{Fig:Subplt_fig}
\end{figure}
2

This answer suggests to modify \abovecaptionskip and \belowcaptionskip, e.g. with

\setlength{\abovecaptionskip}{15pt plus 3pt minus 2pt}

in the preamble. The defaults appear to be 2pt plus 2pt minus 1pt.