如何打破线条上的长方程? [英] How do I break a long equation over lines?

查看:8
本文介绍了如何打破线条上的长方程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在新行中添加一个方程式.问题是方程对线来说太长了,我需要手动打破它.否则,它只会重叠到右列或右边距(看起来很丑......).有没有办法 LaTeX 可以为我打破方程式,所以看起来不错?

我附上我的乳胶代码:

egin{align*}f(n)-f(0) &= A(n)-B(n)-C(n)-D(n)cdot d-left(A(0)-B(0)-C(0)-D(0)cdot d
ight) \&= A(n)-0-X-D(n)cdot d-left(0-0-0-0
ight) \&= A(n)-X-D(n)cdot d结束{对齐*}

有问题的行是第一行,它太长了.

解决方案

breqn 包旨在自动拆分长方程.它在大多数情况下都能很好地工作,但不如 amsmath 包那么成熟.以下是您编写示例方程式的方式:

<上一页>documentclass{文章}使用包{breqn}开始{文档}开始{数学}f(n)-f(0) = A(n)-B(n)-C(n)-D(n)cdot d-left(A(0)-B(0)-C(0)-D(0)cdot d ight)= A(n)-0-X-D(n)cdot d-left(0-0-0-0 ight)= A(n)-X-D(n)cdot d结束{数学}结束{文档}

请注意,没有对齐或换行的标记,但输出看起来与使用 align 基本相同.

I am trying to add an equation in a new line. The problem is that the equation is too long for the line, and I need to break it manually. Otherwise, it just overlaps to the right column, or to the right margins (and looks ugly...). Is there a way LaTeX can brake the equation for me, so it seems nice?

I'm attaching my latex code:

egin{align*}
f(n)-f(0) &= A(n)-B(n)-C(n)-D(n)cdot d-left(A(0)-B(0)-C(0)-D(0)cdot d
ight) \
          &= A(n)-0-X-D(n)cdot d-left(0-0-0-0
ight) \
          &= A(n)-X-D(n)cdot d
end{align*}

The problematic line is the first line, which is too long.

解决方案

The breqn package is designed to split long equations automatically. It works very well in the majority of situations, but it's not as mature as the amsmath package. Here's how you'd write your example equation:

documentclass{article}
usepackage{breqn}
egin{document}
egin{dmath}
f(n)-f(0) = A(n)-B(n)-C(n)-D(n)cdot d-left(A(0)-B(0)-C(0)-D(0)cdot d
ight)
          = A(n)-0-X-D(n)cdot d-left(0-0-0-0
ight)
          = A(n)-X-D(n)cdot d
end{dmath}
end{document}

Note there is no markup for alignment or newlines, but the output looks essentially the same as if you used align.

这篇关于如何打破线条上的长方程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆