beamer - tiny - itemize - itemize 导致行距(和字体大小)不正确

beamer - tiny - itemize - itemize 导致行距(和字体大小)不正确

我使用带有小字体大小的 beamer(因为否则文本会非常大)\begin{tiny} ... \end{tiny}。有时我会使用 double itemize(因此有两个级别)。这会产生以下两个意想不到的效果:

  • 在内部 itemize 环境中,字体大小变为正常
  • 在内部逐项列举环境中以及在内部逐项列举环境之前的最后一项中,行距发生了改变(可能变为正常大小文本中的行距)。

示例代码

\documentclass[11pt]{beamer}
\usetheme{Darmstadt}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usetheme{Dresden}

\begin{document}

%next slide
\begin{frame}{title}
\begin{tiny}
\begin{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\begin{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\end{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\end{itemize}
\end{tiny}
\end{frame}

\end{document}

已解决部分

第一个问题的解决方式是\begin{tiny} ... \end{tiny}在内部项目化环境中的文本周围放置另一个项目(纠正字体大小)并在内部项目化环境结束之前留一个空行(纠正内部项目化环境中的行距​​)。

\documentclass[11pt]{beamer}
\usetheme{Darmstadt}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usetheme{Dresden}

\begin{document}

%next slide
\begin{frame}{title}
\begin{tiny}
\begin{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\begin{itemize}
\begin{tiny}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 

\end{tiny}
\end{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\end{itemize}
\end{tiny}
\end{frame}

\end{document}

这是可行的,但显然不是预期的方式,而且是一种肮脏的黑客行为。

未解决部分

我找不到任何方法来解决第二个问题(内部项目环境之前的最后一项中的行距)。

解决方案思路

  • \renewcommand{\baselinestretch}{.55}在相关项目的开头。这给出了看起来正确的项目间距。但它非常不通用,.55 是通过反复试验得出的,我担心每当我更改某些内容时,这可能会崩溃。
  • 设置较小的文档默认字体大小\documentclass[8pt]{beamer}。8pt 是可以接受的最小字体大小,但仍然很大。

解决这个问题的通用方法是什么?我确信我不是第一个遇到这个问题的人。

答案1

我建议使用 beamers 自己的字体机制:

\documentclass[11pt]{beamer}
\usetheme{Darmstadt}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usetheme{Dresden}

\begin{document}

%next slide
\begin{frame}{title}
\setbeamerfont{itemize/enumerate body}{size=\tiny}
\setbeamerfont{itemize/enumerate subbody}{size=\tiny}
\begin{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\begin{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\end{itemize}
  \item word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word 
\end{itemize}
%\end{tiny}
\end{frame}

\end{document}

相关内容