【问题标题】:LaTeX/Beamer, column environment. Horizontal alignment of overlaysLaTeX/Beamer,列环境。叠加层的水平对齐
【发布时间】:2020-02-22 14:50:31
【问题描述】:

我正在尝试使用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


    【解决方案1】:

    使用编号获得对齐方程的首选方法是 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}
    

    【讨论】:

      【解决方案2】:

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

      Beamer user guide 在第 106 页有一个关于此的部分,它与您所做的完全一样。显然,该文档中也描述了一种解决方法。

      【讨论】:

        猜你喜欢
        • 2019-12-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-05
        • 1970-01-01
        • 2010-10-29
        • 2011-09-28
        • 1970-01-01
        相关资源
        最近更新 更多