1

I need a caption of my table/figure to be 9pt size. The whole text should stay 12pt-sized, while only table/figure caption should be 9pt size.

I also need the caption to appear above the table, and below the figure (I managed to do this, see MWE below). Unfortunately, I can't really work out how to handle caption sizes. I tried: \fontsize{9}{11}\selectfont {\caption{My awesome table}} with no effect (the effect was that the text INSIDE the table was modified to fit 9pt size, caption stayed the same ...).

Any ideas? Thank you so much for help and your time!

\documentclass[12pt]{article}
\usepackage{floatrow}
\usepackage{graphicx}
\usepackage[draft]{pgf}

\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=bottom}

\begin{document}

\begin{table}
    \fontsize{9}{11}\selectfont {\caption{My awesome table}}
    \begin{tabular}{*4{l}}
        A & B & C & D\\
        x & w & y & z\\
        1 & 2 & 3 & 4\\
    \end{tabular}
\end{table}

\begin{figure}
\centering
  \begin{pgfpicture}
    \pgftext{\pgfimage[width=5cm,height=4cm]{scratch.png}}
\end{pgfpicture}
  \fontsize{9}{11}\selectfont {\caption{My awesome picture}}
\end{figure}

\end{document}
  • With scrartcl, for instance, you can set it up with \setkomafont{caption}{\small} (or \addtokomafont). Moreover, I think it offers a \captionabove command… – Manuel May 25 '14 at 13:42
5

Something like this. Move \fontsize{9}{11}\selectfont into the caption {}.

enter image description here

Code

\documentclass[12pt]{article}
\usepackage{floatrow}
\usepackage{graphicx}
\usepackage[draft]{pgf}

%\usepackage[font={scriptsize}]{caption}  % if only the word `Caption` and `Figure` needs to be small too.

\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=bottom}

\begin{document}

\begin{table}
   \caption{\fontsize{9}{11}\selectfont My awesome table}
    \begin{tabular}{*4{l}}
        A & B & C & D\\
        x & w & y & z\\
        1 & 2 & 3 & 4\\
    \end{tabular}
\end{table}


\begin{table}
   \caption{My awesome table}
    \begin{tabular}{*4{l}}
        A & B & C & D\\
        x & w & y & z\\
        1 & 2 & 3 & 4\\
    \end{tabular}
\end{table}

\begin{figure}
\centering
  \begin{pgfpicture}
    \pgftext{\pgfimage[width=5cm,height=4cm]{scratch.png}}
\end{pgfpicture}
\caption{\fontsize{9}{11}\selectfont My awesome picture}
\end{figure}
\end{document}
  • Great! Have only one, tiny, question. Your code resizes the 'Table' word in my captions (and so the caption) but do not resize the word 'Figure' (however, the caption is small). How to deal with this? – yak Jun 1 '14 at 10:09
  • 1
    Hi, the code does not affect the Table and Figure heading/word, it only affects the content of the caption. If you want to resize the Table and Figure heading, remove the percentage % in line 6. However, be aware that not only the heading but also the content will be resized simultaneously. So you need to play a few cases to find your need. The following link is for your reference tex.stackexchange.com/q/24599/34618 – Jesse Jun 1 '14 at 10:43
  • Thanks for the answer. Forgot to write - already emoved the % but still - the code U provided resizes only the Table word, not the Figure word. Any ideas why? – yak Jun 1 '14 at 17:05
  • 1
    Hi, I just copy and paste the code and Figure heading is resized after removing %. – Jesse Jun 1 '14 at 17:37
  • 1
    @yak -- When you were not there, I also find this link for your information. tex.stackexchange.com/a/101594/34618 – Jesse Jun 1 '14 at 17:42

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.