如何在行上分解一个长方程? [英] How do I break a long equation over lines?

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

问题描述

我正在尝试在新行中添加一个方程式.问题是方程对于该行来说太长了,我需要手动将其破坏.否则,它只会重叠到右边的列或右边距(看起来很丑...). LaTeX是否可以为我制衡方程式,所以看起来不错吗?

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:

\begin{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\right) \\
          &= A(n)-0-X-D(n)\cdot d-\left(0-0-0-0\right) \\
          &= A(n)-X-D(n)\cdot d
\end{align*}

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

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

推荐答案

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

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}
\begin{document}
\begin{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\right)
          = A(n)-0-X-D(n)\cdot d-\left(0-0-0-0\right)
          = A(n)-X-D(n)\cdot d
\end{dmath}
\end{document}

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

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

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

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