5

Could I change caption text size and label size to only one figure?

I've seen in other questions that:

\captionsetup[figure]{font=footnotesize,labelfont=footnotesize}

can be used to change sizes in captions, but that is for the whole document and I would like to do this for only one figure; could this be possible?

Best regards and thank you so much.

1 Answer 1

6

Local changes to a specific caption can be done within the figure or table environment, if \captionsetup is used in the relevant environment. See the example of the 2nd figure environment -- the change of settings does not leak outside and has no effect on the third figure caption.

Make sure to remove the optional argument [figure] or [table], otherwise caption complains and does not apply the local changes at all.

\documentclass{article}


\usepackage{caption}

\begin{document}

\begin{figure}
\caption{Foo figure}
\end{figure}

\begin{figure}
\captionsetup{font=footnotesize,labelfont=footnotesize}
\caption{Foobar figure}
\end{figure}


\begin{figure}
\caption{other Foo figure}
\end{figure}

\end{document}

enter image description here

1
  • 4
    An explanation why \captionsetup[figure}{...} does not work when used within a figure: \captionsetup[figure]{...} gets executed at (every) \begin{figure}, therefore this does not have any effect when used after \begin{figure}, and therefore local settings (done within the figure) will override settings done with \captionsetup[figure]{...} in the preamble.
    – user2574
    Aug 24, 2016 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .