LaTeX / Beamer,列环境。叠加层的水平对齐

问题描述 投票:2回答: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会将文本分别放置在每一列中,而不关心其他框架。

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

latex alignment beamer
2个回答
2
投票

使用编号获取对齐方程的首选方法是amsmath程序包的align环境。有关帮助,请参见its documentation。这很简单,类似于:

\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}

0
投票

通常,您将使用amsmath的align或align *环境,但不幸的是,它在Beamer上不能很好地发挥作用(由于根本原因,没有人想要修复)。

Beamer user guide在第106页上有一节与您所做的完全一样。显然,该文档中也描述了一种解决方法。

© www.soinside.com 2019 - 2024. All rights reserved.