LaTeX对齐堆叠求和
我正在写一个基本的求和证明,并想写这个
1 + 2 + 3 + ... + n-2 + n-1 + n
+ n + n-1 + n-2 + ... + 3 + 2 + 1
= n+1 + n+1 + n+1 + ...
等等。我希望符号对齐,以便很容易看到垂直相加。我如何在 LaTeX 中做到这一点? align
环境不能很好地处理多个要对齐的内容,并且创建 tabular
环境很烦人,因为它不处于数学模式。
I am writing an elementary summation proof and would like to write that
1 + 2 + 3 + ... + n-2 + n-1 + n
+ n + n-1 + n-2 + ... + 3 + 2 + 1
= n+1 + n+1 + n+1 + ...
and so on. I want the symbols to line up so that it's easy to see the vertical addition. How do I do this in LaTeX? The align
environment doesn't do so well with multiple things to align on, and creating a tabular
environment is annoying because it's not in math mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
array
环境是这里的最佳选择。这个解决方案在某些方面比 Jack Kelly 的更好,但在其他方面更差:在列规范中需要注意的两件事:我们使用
*{6}{spec}
来获取列的六个副本规范规范
。我们还使用@
指定每个列分隔符应该看起来像一个六点间隙、一个加号和另一个间隙。有关
@
技巧的更多信息此处 。The
array
environment is the way to go here. This solution is better in some ways than Jack Kelly's, and worse in other ways:Two things to notice in the column specification: we use
*{6}{spec}
to get six copies of a column with specificationspec
. We also use@
to specify that each column separator should look like a six-point gap, a plus sign, and another gap.More on the
@
trick here.我的 LaTeX 有点生锈了,但这里是这样的:
My LaTeX is a little rusty, but here goes: