I am trying to have some environments in my LaTeX document where the font in general is smaller than in the main text. This means that whenever I include a figure, the caption from the \begin{figure}...
should have the same (smaller) font size. I found answers where the change is globally by providing the font size parameter to the caption package. Yet I was wondering if I could do this locally for some figures. Actually, I would like to know if this is possible in the definition of the exercise environment I have:
\usepackage[lastexercise]{exercise} % for exercise environment
% set font for exercise environment
\newcommand\ExerciseFont{\footnotesize}
\renewcommand\AtBeginAnswer{\ExerciseFont}
\renewcommand\AtBeginExercise{\ExerciseFont}
% change format of exercise environment
\renewcommand{\ExerciseHeader}{\ExerciseFont\textsc{
\ExerciseName\ \ExerciseHeaderNB. \ExerciseHeaderTitle
\ExerciseHeaderOrigin}}
% change font for answers header
\renewcommand{\AnswerHeader}{\ExerciseFont\textit{
Solution:\ }}
Can I somehow change the font size for the figures in such environment?
Best Answer
You can define an
\ExerciseCaption
to use within the exercise. By using\captionsetup
incaption.sty
the caption can be changed locally.