A simple solution is to change your document class to one of the KOMA-script classes that corresponds to the document class you use (book=scrbook
, report=scrreprt
and article=scrartcl
). Then, you may use KOMA-script’s build in commands to format the captions.
I have listed most of KOMA-script’s caption format commands in the MWE. The two commands that I assume will be of the most interest for you, is
\addtokomafont{caption}{\footnotesize}
\addtokomafont{captionlabel}{\usekomafont{caption}}
The first line adds attributes to the text part of the caption (\caption{<text>}
), i.e. the text inside the curly brackets. The second adds font attributes to the label part, (Figure 1
, Tabell 1
, etc.) The command \usekomafont{<fontset>}
) replicates all font attributes set for the text part to the label.
If you want to reset the attributes from scratch, use \setkomafont{caption}{<attributes>}, instead of
\addtokomafont`. For example, if you want the label in italic, but not the text part, use
\addtokomafont{captionlabel}{\usekomafont{caption}\itshape}
Here is an MWE and the output:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/jVlSI.png)
\documentclass[UKenglish, demo]{scrartcl}
\usepackage{lmodern}
\usepackage{scrlayer-scrpage}
\usepackage[babel=true]{microtype}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{booktabs, bigdelim, rotating}
\KOMAoptions{headings=small,%
captions=tableheading,%
}
% Section
\let\raggedsection\flushleft
% Caption and figures
\renewcommand*{\captionformat}{:\ }
\addtokomafont{caption}{\footnotesize}
\addtokomafont{captionlabel}{\usekomafont{caption}}
\setlength{\belowcaptionskip}{0.5\baselineskip}
\setlength{\abovecaptionskip}{0.5\baselineskip}
\setlength{\intextsep}{0.5\baselineskip}
\begin{document}
\title{Capital Asset Prices}
\author{W.\,T.\,F.\,Dull}
\maketitle
\section{Section}
\label{sec:intro}
\textsc{One of the problems} which has plagued the world is bad typesetting of figures and tables. Now we have KOMA-script to help us.
\begin{figure}[!h]
\centering
\includegraphics[width=0.5\columnwidth]{figure1.png}
\caption{A demo of figure captions\label{fig-1}}
\end{figure}
Even table captions look better with KOMA-script, but that is no surprise. The example is borrowed from another question posted at Stackexchange.com
\begin{table}[!htbp]
\caption{A demo of figure captions\label{fig-1}}
\centering
\begin{tabular}{llcc@{}}
\cmidrule[\heavyrulewidth](l){2-4}
& header1 & header 2 & header 3 \\
\cmidrule(l){2-4}
\ldelim\{{4}{4mm}[\parbox{4mm}{\rotatebox[origin=c]{90}{group1}}] & 1 & a & g \\
& 2 & b & h \\
& 3 & c & i \\
& 3 & c & i \\\addlinespace[0.75ex]
\ldelim\{{6}{4mm}[\parbox{4mm}{\rotatebox[origin=c]{90}{group2}}] & 4 & d & j \\
& 5 & e & k \\
& 6 & f & l \\
& 7 & g & m \\
& 8 & h & n \\
& 9 & i & o \\
\cmidrule[\heavyrulewidth](l){2-4}
\end{tabular}
\end{table}
\end{document}
\caption
argument, specify the formatting of the text as it appears in the caption and list of figures as part of the document setup in the class file or preamble\captionsetup
command, or perhaps you are using a class that has built in features, or ...caption
package is not compatible with certain document classes; it is for this reason that various people have asked you for more information about the structure of your document, beginning with the\documentclass
instruction.