在投影機文件中使用「引用」環境時 \hbox 溢出

在投影機文件中使用「引用」環境時 \hbox 溢出

為什麼Overfull \hbox每當我在 Beamer 中使用quotation清單中的環境時都會收到警告?以這個文件為例:

\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
\begin{frame}
  \frametitle{Example}
  \begin{itemize}
  \item See:
   \begin{quotation}
      \lipsum[1]
   \end{quotation}
 \end{itemize}
\end{frame}
\end{document}

如果我編譯它,我會收到警告

Overfull \hbox (21.90005pt too wide) in paragraph at lines 12--12

答案1

由於這是一個很長的段落,因此內容溢出頁面也就不足為奇了。如果您將quotation環境放入一個\fbox將在其內容周圍顯示框架的環境中,您會發現它增加了相當大的邊距。

\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
\begin{frame}
  \frametitle{Example}
  \begin{itemize}
  \item See:
   \fbox{\parbox{\textwidth}{%
       \begin{quotation}
      \lipsum[1]
   \end{quotation}
   }}
 \end{itemize}
\end{frame}
\end{document}

在此輸入影像描述

如果您想要稍微靈活的解決方案,您可以嘗試引用包裹。

您可以利用leftmargin/rightmargin允許自訂當前\textwidth.

見下文

\documentclass{beamer}
\usepackage{lipsum}
\usepackage[leftmargin=0pt,rightmargin=0pt]{quoting}
\begin{document}
\begin{frame}
    \frametitle{Example}
    \begin{itemize}
        \item See:
              \begin{quoting}
                  \lipsum[1]
              \end{quoting}
    \end{itemize}
\end{frame}
\end{document}

在此輸入影像描述

相關內容