beamer 标题:控制行距

beamer 标题:控制行距

目的:控制图形标题内的行距对于 beamer 类

我可以使用以下方法控制字体大小:

\setbeamerfont{caption}{size=\scriptsize} 

我如何控制行距?

几分钟前我还在使用caption带有各种选项的软件包。caption不建议在beamer课程中使用这个软件包,这本来不是什么问题,直到 LaTeX 软件包更新破坏了一切(我尝试回滚更新,但没有成功)。我想caption完全废除这个软件包。我以前有这样的情况:

\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
}%

所以在可能的范围内,我想复制这个输出:

在此处输入图片描述

供参考,该caption软件包给出了以下错误消息:

 Package caption Info: Begin \AtBeginDocument code.
 Package caption Info: End \AtBeginDocument code.
  ! Undefined control sequence.
  <argument> \@@magyar@captionfix 

l.22 \begin{document}

我主要感兴趣的是不是使用该caption软件包。我曾多次应用补丁来修复不兼容问题,但最近的故障促使我废除了该软件包(我仍然很高兴地在课堂上使用它article!)。

除了 之外\setbeamerfont{caption}{size=\scriptsize},我还尝试了\setbeamerfont{caption}{size*={8pt}{6pt}},但第二个参数 (6pt) 被忽略了。我尝试添加\selectfont{}linespread{0.5}以及其他一些内容,但无济于事。

这是我目前得到的结果。我希望行间距更小。

在此处输入图片描述

梅威瑟:

\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}

答案1

您必须先结束段落,然后才能关闭标题。请参阅这个答案了解更多信息。另外,您可以以不同的方式传递包的选项usenamesdvipsnames和(可在svgnamesxcolorbeamer请参阅文档。

\documentclass[xcolor={usenames,dvipsnames,svgnames},11pt,table,t]{beamer}
% Pass options of `xcolor' like the above
\setbeamertemplate{navigation symbols}{} 
\setbeamertemplate{caption}{\insertcaption}% removes colon in caption
\setbeamerfont{caption}{size=\scriptsize}

\begin{document}
\begin{frame}
\begin{figure}
\centering
I don't have your picture
\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.\par}% End paragraph
\end{figure}
\end{frame}
\end{document}

修正了行距

相关内容