3

How do I reduce the line spacing in captions in beamer? I tried singlespacing but that wouldn't work.

\documentclass[14pt]{beamer}
\usepackage{graphicx}
%\usepackage{setspace}
\usecaptiontemplate{
\footnotesize%\singlespacing
\structure{\insertcaptionname~\insertcaptionnumber:}\insertcaption}

\begin{document}
\frame{{Test} 
\begin{figure}
\caption{A very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long caption.}
\centering
\includegraphics[width=0.8\linewidth]{test.png}
\end{figure}}
\end{document}

enter image description here

1 Answer 1

3

Simply place a \par following the caption to use the baselineskip of the \footnotesize. If you need a more precise control, you can define the fontsize and the baselineskip seperatly using \setbeamerfont{caption}{size*={10pt}{6pt}}

\documentclass[14pt]{beamer}

%\setbeamerfont{caption}{size*={10}{6}}
\setbeamerfont{caption}{size=\footnotesize}
\setbeamertemplate{caption}{%
    \structure{\insertcaptionname~\insertcaptionnumber:}
    \insertcaption\par
}

\begin{document}
\frame{{Test} 
\begin{figure}
\caption{A very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long caption.}
\centering
\includegraphics[width=0.8\linewidth]{example-image}
\end{figure}}
\end{document}

enter image description here

3
  • wow! thanks a lot. this must be the shortest answer to any question I have ever seen, just add \par;-)
    – joergW3673
    Nov 9, 2016 at 9:20
  • @PatrickT Works fine for me. Can you make a minimal working example (MWE) that demonstrates your problem? Jul 13, 2018 at 20:32
  • @samcarter, thanks for your comment. On a second look, I realize I was too hasty and hadn't read everything properly. I didn't have the \par at the end of the caption and without it the linespacing doesn't work. You do explain this very clearly. Sorry for wasting your time! Thanks again.
    – PatrickT
    Jul 14, 2018 at 17:37

You must log in to answer this question.

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