# How to change font size of caption in a table [duplicate]

I need to change the font size to 9 pt in particular for captions in tables. If 9 was not required I would have used caption package and would have used captionsetup and set the font to small. Can I use a similar setup with a particular font size like 9?

Here is a minimal example (ijcai17.sty):

\usepackage{ijcai17}% http://pastebin.com/LiATA1sV
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{booktabs}
\usepackage{caption}

\begin{document}
\section{Test}
Test document

\begin{table}[h!]
\centering
\captionsetup{font=small}
\caption{Classification accuracy of RF-Feature selection and RF-Default for 1s, 3s, 5s, 10s segment lengths}
\label{table:3}
\resizebox{0.47\textwidth}{!}{%
\begin{tabular}{c||c|c|c|c}
\toprule
& 1s & 3s & 5s & 10s\\
\hline
2-class RF-Default & $88.6\%$ & $97.38\%$ & $94.69\%$ & $99.03\%$ \\ \hline
2-class RF-Feature selection & $89.08\%$ & $95.17\%$ & $96.62\%$ & $99.03\%$ \\ \hline
3-class RF-Default & $68.38\%$ & $76.38\%$ & $80.10\%$ & $78.64\%$\\ \hline
3-class RF-Feature selection & $68.76\%$ & $76.97\%$ & $82.04\%$ & $81.55\%$\\
\bottomrule
\end{tabular}%
}
\end{table}
\end{document}


## marked as duplicate by Werner, Community♦Nov 29 '16 at 7:33

• Do you supply any particular font size in your \documentclass option? Like \documentclass[10pt], say? – Werner Nov 29 '16 at 7:05
• No, I am not. However, I am using a .sty file, through usepackage, and I assume that maintains font sizes? I have a standard template upon which I am writing the document. – tacqy2 Nov 29 '16 at 7:08
• Well, please supply something that provides the context. We call that a minimal example. It starts with \documentclass and ends with \end{document}. It is possible to define a specific 9pt font size for the caption, but more context should help. – Werner Nov 29 '16 at 7:09
• I have added the .sty file and loaded the packages. Hope that helps. Thanks. – tacqy2 Nov 29 '16 at 7:21

If you're using a default document class (report, book or article) with the 10pt [11pt] document class option, then \small [\footnotesize] results in a 9pt font. That is,

\documentclass[10pt,..]{<default>}% \documentclass[11pt,..]{<default>}

\usepackage{caption}
\captionsetup{font=small}% \captionsetup{font=footnotesize}


Alternatively, if you want to force a 9pt font for the caption, you can declare that style using

\usepackage{caption}
\DeclareCaptionFont{ninept}{\fontsize{9pt}{11pt}\selectfont #1}
\captionsetup{font=ninept}