使用列环境的错误

使用列环境的错误

这是我的 Latex 文件:

\documentclass{beamer}
\title{Here is my Title}
\author{}
\date{}

\begin{document}

\begin{frame}
\begin{columns}[t] % contents are top vertically aligned
\begin{column}[5cm] % each column can also be its own environment
Contents of first column \\ split into two lines
\end{column}
\begin{column}[T]{5cm} % alternative top-align that's better for graphics Line 13
Contents of second column \\ split into two lines
\end{column}
\end{columns}
\end{frame} % Line 17

\end{document}

这是编译的输出:

line 17: Missing number, treated as zero \end{frame}
line 17: Illegal unit of measure (pt inserted) \end{frame}
line 17: Missing number, treated as zero \end{frame}
line 17: Illegal unit of measure (pt inserted) \end{frame}
line 13:  This package is obsolete and no longer needed on input line 13. This package is obsolete and no longer needed
line 0:  Option `pdfpagelabels' is turned off(hyperref) because \thepage is undefined.
line 17: Overfull \hbox (33.76253pt too wide) in paragraph
line 17: Overfull \hbox (8.82085pt too wide) in paragraph
line 17: Overfull \hbox (17.76335pt too wide) in paragraph
line 17: Overfull \hbox (16.6075pt too wide) in paragraph
line 17: Overfull \hbox (20.01422pt too wide) in paragraph
line 17: Overfull \hbox (19.04083pt too wide) in paragraph
line 17: Overfull \hbox (17.70251pt too wide) in paragraph
line 17: Overfull \hbox (16.30333pt too wide) in paragraph
line 17: Overfull \hbox (19.95334pt too wide) in paragraph
line 17:  Font shape `OT1/cmss/m/n' in size <4> not available(Font) size <5> substituted on input line 17. Font shape `OT1/cmss/m/n' in size <4> not available(Font) size <5> substituted
line 0:  Size substitutions with differences(Font) up to 1.0pt have occurred.

\begin{column}如果我删除和之间的部分\end{column},一切都会好起来。我想知道如何修复错误?谢谢!


更新:

更改\begin{column}[5cm]为后\begin{column}{5cm},这是新的错误

line 0: Emergency stop
line 13:  This package is obsolete and no longer needed on input line 13. This package is obsolete and no longer needed
line 0:  Option `pdfpagelabels' is turned off(hyperref) because \thepage is undefined.
line 17:  Font shape `OT1/cmss/m/n' in size <4> not available(Font) size <5> substituted on input line 17. Font shape `OT1/cmss/m/n' in size <4> not available(Font) size <5> substituted

答案1

在第一列中

\begin{column}[5cm]

应该是

\begin{column}{5cm}

因为列的宽度是一个强制参数,应该用花括号括起来。

答案2

大多数都Overfull \hbox只是警告. 有些可以忽略,不会对结果产生太大影响。

我曾经见过这种特殊的组合,但我记不起在哪里了。诀窍是给环境提供根据的columns选项。同时给totalwidth\linewidth每个列调用类似的缩放宽度:

\documentclass{beamer}
\usepackage{lipsum}
\begin{document}

\begin{frame}
 \begin{columns}[totalwidth=\linewidth]
  \begin{column}{.5\linewidth}
   \lipsum[1]
  \end{column}
  \begin{column}{.5\linewidth}
   \lipsum[2]
  \end{column}
 \end{columns}
\end{frame}
\end{document}

相关内容