Purpose: control line spacing inside a figure caption for the beamer class.
I can control the font size with:
\setbeamerfont{caption}{size=\scriptsize}
How can I control linespacing?
Until a few minutes ago I was using the caption package with various options. The caption package is not recommended with the beamer class, which wasn't a problem until a LaTeX package update broke everything (I tried to roll back the update, but did not manage). I would like to do away with the caption package altogether. I used to have this:
\makeatletter
\newcommand\hyper@makecurrent[1]{}
\makeatother
\usepackage{caption}
\captionsetup{%
compatibility = {false},% fix for bug in beamer/caption, January 2014
justification = {justified},
singlelinecheck = {false},%turns off centering of short captions
font = {scriptsize,singlespacing},%
labelfont = {small},%
labelsep = {space},%
belowskip=0pt,% skip between caption and surrounding text
aboveskip=6pt,% skip between table content and caption
parskip = \baselineskip,% skip between lines
labelformat = {empty},%
figurename = {},%clear labelformat if used
tablename = {}%clear labelformat if used
}%
So to the extent that it is possible, I would like to replicate this output:
For information, the caption package gives the following error message:
Package caption Info: Begin \AtBeginDocument code.
Package caption Info: End \AtBeginDocument code.
! Undefined control sequence.
<argument> \@@magyar@captionfix
l.22 \begin{document}
I am primarily interested in not using the caption package. I have on several occasions applied patches to fix incompatibility issues, but the latest breakage motivates me to do away with the package (I still use it very happily with the article class!).
In addition to \setbeamerfont{caption}{size=\scriptsize}, I have tried \setbeamerfont{caption}{size*={8pt}{6pt}}, but the second argument (6pt) is ignored. I have tried to add \selectfont{} and linespread{0.5} and a few other things, to no avail.
This is what I get currently. I want much less inter-line spacing.
MWE:
\PassOptionsToPackage{usenames,dvipsnames,svgnames}{xcolor}% named colors
\documentclass[11pt,table,t]{beamer}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}{\insertcaption}% removes colon in caption
\setbeamerfont{caption}{size=\scriptsize}
\begin{document}
\begin{frame}
\begin{figure}
\centering
\includegraphics[width=\linewidth,height=0.7\textheight,keepaspectratio]%
{Okies-on-highway-Dorothea-Lange-1938}
\caption{\textbf{Okies:} They were refugees from the Southern Plains farms who migrated to California in the 1930s to escape the Great Depression and the Dust Bowl. This family traveled $124$ miles on foot across Oklahoma. Californians used the term ``Okies'' as an insult and it stuck. Image: Dorothea Lange, ``Family walking on highway, five children'', Works Progress Administration, Library of Congress, June 1938.}
\end{figure}
\end{frame}
\end{document}



\captionto always have a paragraph break at the end? I have dozens of presentations that would be affected, it would be quite tedious to change every file (but yes I know how to do it in bulk). As for the options of thexcolorpackage, that's a line I did not intend to include, but your alternative way of including it in thedocumentclassis nice. Thanks! – PatrickT Jul 13 '18 at 16:36\setbeamerfont{caption}{...}“forgets” to take care of the paragraph break, which IMHO is by design: Don’t include large chunk of text in a presentation slide. The alternative solution would be using\usepackage{caption} \captionsetup{font=scriptsize,labelformat=empty}. – Ruixi Zhang Jul 13 '18 at 16:52\let\origcaption\captionand\renewcommand\caption[2][]{\origcaption{#2\par}}. This I found here: https://tex.stackexchange.com/questions/99839/can-listoffigures-use-the-long-caption-instead – PatrickT Jul 13 '18 at 16:54captionpackage no longer works (I have the latesttexlivefor MacOS updated and all, and the MWE above fails), so it's not a solution. But the workaround I give redefines the\captioncommand and seems to work well. – PatrickT Jul 13 '18 at 16:57captionsolution worked just fine in my TeX distribution (MiKTeX on Windows). You may want to check the update. Can’t say for sure. – Ruixi Zhang Jul 13 '18 at 17:01