11

That's what I use

\usepackage{caption}
\usepackage{subcaption}

The template I'm using is from a university and uses the Koma Script When adding figures or graphs I do this:

\begin{figure}[h!]
\begin{subfigure}[normal]{0.40\textwidth} 
\includegraphics[width=\textwidth]{figures/Fig1}
\caption{Caption of Fig1}
\label{Label of Fig1}
\end{subfigure}
\begin{subfigure}[normal]{0.40\textwidth}
\includegraphics[width=\textwidth]{figures/Fig2}
\caption{Caption of Fig2}
\label{Label of Fig2}
\end{subfigure}
\caption{This is the caption for whole graphic}
\label{This is the label for the whole graphic}
\end{figure}

what I want to know is how to simply adjust different font styles for the captions of the subfigures and figure.

I want especially the captions fonts of the subfigures to be smaller than the captions fonts of the figures.

As far as I googled the problem, I could do this with a Koma script command or by addressing the caption package.

I tried the following:

\captionsetup{font=small,labelfont={bf,sf}}

this affects all captions but how can I adjust the captions of subfigures separately?

I don't understand the difference in the approaches between the komaScript and the captionpackages So I simply want to adjust the Font sizes of the different Caption types separately and uniquely for the whole document and I would like to adjust the space between the captions and the subfigures .....

  • 2
    BTW: [normal] is not a valid position specifier for the minipage and subfigure environment. – Axel Sommerfeldt Dec 16 '15 at 8:53
15

You can use the [sub] optional parameter of \captionsetup, e.g.

\captionsetup{font=normalsize,labelfont={bf,sf}}
\captionsetup[sub]{font=small,labelfont={bf,sf}}

BTW, I would add a \centering in your figure environment.

  • This doesn't work for me for figures created with figure*. If I manually put \captionsetup{...} within a specificfigure* environment, it works - but I'd like to do it once at the beginning of the document, so that when you put it at the start, it works not only for figure, but also figure*. Any help with that? – Ela782 May 9 '17 at 17:33
  • @Ela782 I've just tried and it works for me with figure* too. I suggest you ask a new question and provide a couple of details. You can link to this question in order ot provide some background. – campa May 10 '17 at 8:00
  • I see, thanks for trying! It is my particular setup then. I will proceed as you suggest. Thank you :) – Ela782 May 10 '17 at 18:39
  • Don't you have to do \usepackage{caption} first? – tommy.carstensen Feb 23 '18 at 9:40
  • @tommy.carstensen Wow, I didn't remember I wrote this answer. Anyway yes, the subcaption package is required, but this is clear from the question setup so I wrote only the relevant snippet. – campa Feb 23 '18 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.