如何更改 Beamer 中引用环境的缩进/边距

如何更改 Beamer 中引用环境的缩进/边距

itemize我需要在 中的项目之间添加引号beamer frame。如果我itemize在引号附近停止并重新开始,结果根本不会缩进:

\documentclass{beamer}

\usetheme{CambridgeUS}
\usefonttheme{serif}
\setbeamerfont{quote}{shape=\upshape,family=\rmfamily}

\beamerdefaultoverlayspecification{<+->}

\begin{document}

\begin{frame}{Frame}

\begin{itemize}

\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. 

\end{itemize}

\begin{quote}Sed vitae purus facilisis, blandit odio eget, tincidunt nisi. Aliquam pulvinar, ipsum ac aliquet facilisis, neque quam tincidunt lacus, at eleifend ante lorem quis neque. Suspendisse potenti. \end{quote}

\begin{itemize}

\item Nulla vel bibendum ligula. Sed imperdiet felis lacus, a vulputate urna egestas at.

\end{itemize}

\end{frame}

\end{document}

但如果我不重新启动,引文就会缩进太多:

\documentclass{beamer}

\usetheme{CambridgeUS} \usefonttheme{serif} \setbeamerfont{quote}{shape=\upshape,family=\rmfamily}

\beamerdefaultoverlayspecification{<+->}

\begin{document}

\begin{frame}{Frame}

\begin{itemize}

\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. \smallskip{}

\begin{quote}Sed vitae purus facilisis, blandit odio eget, tincidunt nisi. Aliquam pulvinar, ipsum ac aliquet facilisis, neque quam tincidunt lacus, at eleifend ante lorem quis neque. Suspendisse potenti. \end{quote}

\item Nulla vel bibendum ligula. Sed imperdiet felis lacus, a vulputate urna egestas at.

\end{itemize}

\end{frame}

\end{document}

我猜我必须quote从 重新定义环境beamerbaselocalstructure.sty。那该怎么办?它可能在beamer用户指南中,但我找不到它。

答案1

使用changepage环境adjustwidth来调整引文周围的边距:

在此处输入图片描述

\documentclass{beamer}

\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764

\usepackage{changepage}

\usetheme{CambridgeUS}
\usefonttheme{serif}
\setbeamerfont{quote}{shape=\upshape,family=\rmfamily}

\beamerdefaultoverlayspecification{<+->}

\begin{document}

\begin{frame}{Frame}

\begin{itemize}

\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. \smallskip{}

\begin{quote}
Sed vitae purus facilisis, blandit odio eget, tincidunt nisi. Aliquam pulvinar, ipsum ac aliquet facilisis, neque quam tincidunt lacus, at eleifend ante lorem quis neque. Suspendisse potenti.
\end{quote}

\begin{adjustwidth}{1em}{1em}
Sed vitae purus facilisis, blandit odio eget, tincidunt nisi. Aliquam pulvinar, ipsum ac aliquet facilisis, neque quam tincidunt lacus, at eleifend ante lorem quis neque. Suspendisse potenti.
\end{adjustwidth}

\item Nulla vel bibendum ligula. Sed imperdiet felis lacus, a vulputate urna egestas at.

\end{itemize}

\end{frame}

\end{document}

您可以使用(例如)对quote环境进行完全替换adjustwidth

\renewenvironment{quote}[1][1em]
  {\begin{adjustwidth}{#1}{#1}}
  {\end{adjustwidth}}

上述重新定义提供了

\begin{quote}[<margin>]
  <quote>
\end{quote}

带有一个可选<margin>参数,用于调整左边距和右边距。

相关内容