2

I want to resize the figure captions in an rmarkdown beamer template, so I added \usepackage[font={small,it}]{caption} to my header.tex. But it doesn't work - the options are ignored. I didn't find any similar problem so far. Any ideas? thank you.

.rmd file:

---
title: "Presentation"
output:
  beamer_presentation:
    includes:
      in_header: header.tex
      fig_caption: true
---
\begin{figure}[htbp]
\centering
\includegraphics[width=.5\textwidth]{image.jpg}
\caption{Lorem ipsum dolor sit amet}
\end{figure}

header.tex:

\usepackage[absolute,overlay]{textpos}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage[font={small,it}]{caption}
\addtobeamertemplate{title page}{%
\begin{textblock*}{25mm}(10cm,0.5cm)
\includegraphics[width=0.8\textwidth]{logo.png}
\end{textblock*}
}

\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{25mm}(10cm,0.5cm)
\includegraphics[width=0.8\textwidth]{logo.png}
\end{textblock*}}

\setbeamertemplate{footline}[text line]{%
  \parbox{\linewidth}{\vspace*{-8pt} Institute | Hans Dampf \hfill\insertshortauthor\hfill\insertpagenumber}}

\setbeamertemplate{navigation symbols}{}
1
  • Please give us a small but complete document which shows the problem and which we can compile (MWE). Having only code snippets we cannot reproduce your problem and therefore it's difficult to help.
    – user2574
    Apr 28, 2016 at 19:09

1 Answer 1

2

beamer and the caption package are not the best friends, but you can simply use beamers font mechanism to control the caption size:

\documentclass{beamer}

\setbeamerfont{caption}{size=\tiny, shape=\itshape}

\begin{document}
\begin{frame}
\begin{figure}
\includegraphics[width=\textwidth]{example-image}
\caption{test}
\end{figure}
\end{frame}
\end{document}

enter image description here

1
  • Shouldn't it be shape=\itshape in the definition of the caption font?
    – user94293
    Feb 18, 2017 at 14:37

You must log in to answer this question.

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