LaTeX/Beamer、柱环境。叠加层的水平对齐
我正在尝试使用 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 会将文本单独放置在每一列中,而不关心其他框架。
有谁对如何实现我想要的结果有任何想法。我根本不致力于专栏,但我致力于方程式数字。
I am trying to prepare a presentation using beamer
. I want to have two columns that walkthrough some algebraic manipulations. On the left an explanation of the steps taken, on the right the results.
\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}
And here's some LaTeX which does that (with junk words and equations). When this is compiled the text and maths are not aligned with each other. I wouldn't really expect them to be either as LaTeX will position the text in each column individually, not caring about the other frames.
Does anyone have any ideas on how to achieve the result I am after. I'm not committed to the columns at all, but I am committed to the equation numbers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过编号获得对齐方程的首选方法是 amsmath 包的
align
环境。请参阅其文档以获取相关帮助。这很简单,就像:有很多变体试图满足大多数可能的方程对齐需求(再次,请查看文档)。
至于你的两列证明格式,我不确定最好的方法。一种快速而肮脏的方法是将其添加为环境中的第二列,例如:
但这对于多行解释没有好处,并将编号放在文本的右侧。我会尝试想出一种方法(一种不涉及大量自定义环境的方法,因为肯定有人以前这样做过)。
编辑:作为一个起点,这[有点]有效:
您不能在对齐环境中进行任何对齐( & 混淆了事情),并且存在一些垂直对齐问题 - 对齐环境本身在上方和下方进行填充,以及右侧单元格中的文本。不过,也许它正朝着好的方向发展!
The preferred way to get aligned equations with numbering is amsmath package's
align
environment. See its documentation for help with that. It's quite simple, something like:There are a lot of variations trying to cover most conceivable equation alignment needs (again, check out the documentation).
As for your two-column proof format, I'm not as sure about the best way. A quick and dirty way would be to add it as a second column within the environment, something like:
but this is no good for multi-line explanation, and puts the numbering to the right of the text. I'll try and think of a way (one that doesn't involve a lot of custom-defined environments, since surely someone's done this before).
Edit: As a starting point, this [sort of] works:
You can't do any alignment within the align environment (the & confuses things), and there are some vertical alignment issues - the align environment pads itself above and below, and the text in the right-hand cell. Maybe it's heading in a good direction, though!
通常你会使用amsmath的align或align*环境,但不幸的是它与beamer不能很好地配合(出于根本原因,没有人愿意修复)。
Beamer 用户指南有一个关于第 106 页的这个完全符合您所做的操作。显然该文档中也描述了一种解决方法。
Usually you'd use amsmath's align or align* environment, but unfortunately it doesn't play nicely with beamer (for fundamental reasons that nobody wants to fix).
The Beamer user guide has a section on this at page 106 that does exactly what you've done. Apparently there's a workaround described in that document too.