2

我正在尝试使用beamer. 我想要有两列来演练一些代数运算。左边是所采取的步骤的解释,右边是结果。

\documentclass{beamer}
\begin{document}

   \begin{frame}[t]
   Not in a column
   \begin{columns}[t]
      \begin{column}{0.5\textwidth}
            \only<2->{Some text}

            \only<3->{
                      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                     }
      \end{column}
      \begin{column}{0.5\textwidth}
         \only<2->
         {
         \begin{equation}
            E = mc^2
         \end{equation}
         }

         \only<3->
         {
         \begin{equation}
            F = ma
         \end{equation}
         }
      \end{column}
   \end{columns}
   \end{frame}
\end{document}

这里有一些 LaTeX 可以做到这一点(带有垃圾词和方程式)。编译时,文本和数学没有相互对齐。我真的不希望它们是,因为 LaTeX 会单独将文本定位在每一列中,而不关心其他框架。

有没有人对如何实现我所追求的结果有任何想法。我根本不致力于列,但我致力于方程式编号。

4

2 回答 2

2

使用编号获得对齐方程的首选方法是 amsmath 包的align环境。请参阅其文档以获取帮助。这很简单,例如:

\begin{align}
     f(x) & = \cos^2 x \\
     g(x) & = \sin^2 x
\end{align}

有很多变体试图满足大多数可能的方程对齐需求(再次查看文档)。

至于你的两列证明格式,我不确定最好的方法。一种快速而肮脏的方法是将其添加为环境中的第二列,例如:

\begin{align}
     f(x) & = \cos^2 x & \text{this is the first function} \\
     g(x) & = \sin^2 x & \text{this is the second function} 
\end{align}

但这不利于多行解释,并将编号放在文本的右侧。我会尝试并想出一种方法(一种不涉及很多自定义环境的方法,因为肯定有人以前做过)。

编辑:作为一个起点,这个[排序]有效:

您不能在 align 环境中进行任何对齐(& 会混淆事物),并且存在一些垂直对齐问题 - align 环境在上方和下方填充自身,以及右侧单元格中的文本。不过,也许它正朝着一个好的方向前进!

\begin{tabular}{p{3 in}|l}
\begin{align} f(x) = \sin^2 x \end{align} & 
this is the first equation \\
\begin{align} g(x) = \cos^2 x \end{align} & 
this is the second equation
\end{tabular}
于 2009-09-29T15:37:57.650 回答
0

通常你会使用 amsmath 的 align 或 align* 环境,但不幸的是它不能很好地与 beamer 配合使用(出于没有人想要修复的根本原因)。

Beamer 用户指南在第 106 页有一个关于此的部分,它完全按照您所做的。显然,该文档中也描述了一种解决方法。

于 2011-10-30T23:58:42.403 回答