2

How to adjust font size of a single \captionof{figure}{} caption?

Scant details in the \captionof{}. Do all the same rules for \caption command apply.

Would like to make font size changes locally, not globally.

2
  • 1
    relsize package offers \smaller and \relsize{int} (negatives are for smaller fonts)
    – user193767
    Commented May 10, 2020 at 16:20
  • 2
    Load the caption package and, inside a group, use \captionsetup{font=footnotesize} before \captionof{…}{…}.
    – Bernard
    Commented May 10, 2020 at 16:22

1 Answer 1

2

Here is an example I did recently. The \usepackage{caption} includes a command \captionof for putting a caption to something that's not a float; for example: \captionsetup{font=footnotesize} lets you set the size of the entire caption, including the "Figure 1" text the precedes the caption text.

 \documentclass[12pt]{article}
\usepackage{caption}
    % Includes a command \captionof for putting a caption to something that?s not a float; for example: minipage
\usepackage[usenames, dvipsnames]{color}
\usepackage{float}
    % Let's you override the placement of figures and lets you specify if you want to figure in a particular place.

\usepackage[framemethod=TikZ]{mdframed}

\usepackage{colortbl}

\usepackage[most]{tcolorbox}

%%%%%%%%%%%%%%%

\begin{document}
 \tcbset{boxrule=1.5pt,colback=gray!10!white,colframe=blue!80!,coltitle=blue!80!,colbacktitle=white}

\vspace{1\baselineskip}

    \begin{tcolorbox}[every float=\centering, drop shadow, title={\strut \bf Historical Note: Gauss as a Student}]
        \begin{minipage}[t]{0.45\linewidth}
        \vspace*{0pt}
        {There is a great story of Gauss as a student.  When he was in elementary school in the late 1700s, he was a bit of a troublemaker.  As a punishment one day, his teacher asked him to add all the integers from 1 to 100 before he could join his friends outside to play.  Gauss amazed his teacher by how fast he calculated the number: 5050.  While he may not have used the formula in Eqn.(), he did a calculation that was similar to what we saw in Method 2.  He knew that you could write the sequence 1 .. 100 and also 100 .. 1.  Adding the numbers pairwise, you always got 101.  The total would be one half of the sums of these sequences.  So $101 \times 100 / 2 = 5050$.}
        \end{minipage}\hfill%
        \begin{minipage}[t]{0.45\linewidth}
        \vspace*{0pt}
            \begin{center}
            \includegraphics[scale=0.09]{gauss_portrait.jpg}
            \captionsetup{font=footnotesize}
            \captionof{figure}{Portrait of Carl Friedrich Gauss (1792 - 1870) taken in 1840. {\it Source: Wikipedia}}
            \label{fig:gauss1}
            \end{center}
        \end{minipage}
    \end{tcolorbox}


\end{document}

enter image description here

You must log in to answer this question.

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