[Tex/LaTex] Setting font size for caption package

captionsfontsize

I wish to set the font size for caption package, how should I do it, now I have this in my preamble

\usepackage[skip=2pt]{caption}

Best Answer

You can use the font key with one of the values scriptsize, footnotesize, small, normalsize, large or Large. A little example:

\documentclass{article}
\usepackage[skip=2pt,font=scriptsize]{caption}

\begin{document}

\begin{figure}
\caption{A test caption}
\end{figure}
Some regular text

\end{document}

enter image description here

If you want other sizes, you can declare a new format and use \fontsize as in the following (just illustrative) example:

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

\DeclareCaptionFormat{myformat}{\fontsize{5}{6}\selectfont#1#2#3}
\captionsetup{format=myformat}

\begin{document}

\begin{figure}
\caption{A test caption}
\end{figure}
Some regular text

\end{document}

enter image description here