Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Breaking long equations?

409 views
Skip to first unread message

BigMan

unread,
Aug 26, 2005, 8:37:33 AM8/26/05
to
How do I break a long equation so that LaTeX displays it into a couple
of lines?

Morten Høgholm

unread,
Aug 26, 2005, 8:42:11 AM8/26/05
to
On Fri, 26 Aug 2005 14:37:33 +0200, BigMan <Big...@abv.bg> wrote:

> How do I break a long equation so that LaTeX displays it into a couple
> of lines?

Try the amsmath package. Running

texdoc amsldoc

from a command prompt should bring up the documentation on any TeX system.
--
Morten

BigMan

unread,
Aug 26, 2005, 10:10:14 AM8/26/05
to
I tried the multline tag, but I have 2 problems with it:
1. it always breaks equations; isn't it better if they break only if
necessary?
2. I could not make it produce an equation number and I'm splitting
without alignment;

Could s.o. provide sample code?

Morten Høgholm

unread,
Aug 26, 2005, 10:15:41 AM8/26/05
to
On Fri, 26 Aug 2005 16:10:14 +0200, BigMan <Big...@abv.bg> wrote:

> I tried the multline tag, but I have 2 problems with it:
> 1. it always breaks equations; isn't it better if they break only if
> necessary?

So you want LaTeX to do it automatically? That's not what you said
initially. In that case you will have to go for the `breqn' package.

> 2. I could not make it produce an equation number and I'm splitting
> without alignment;
>
> Could s.o. provide sample code?

Huh? Last time I checked, the manual had plenty of examples.
--
Morten

Angel Tsankov

unread,
Sep 2, 2005, 2:29:28 AM9/2/05
to
I fount the breqn package useful, but what about breaking mathematical
expressions as in a math environment? For example,

The following expression is too long to fit on a single line and should
be split: $<an expression comes here>$.

Morten Høgholm

unread,
Sep 2, 2005, 3:30:59 AM9/2/05
to

It depends on what you have there. Stuff like $A+B=C$ will break with no
problems using the default settings but other constructs might not. You
can tell LaTeX to allow a break with \allowbreak.
--
Morten

Angel Tsankov

unread,
Sep 2, 2005, 4:03:25 AM9/2/05
to
LaTeX seems not to break subexpressions in parenthesis, even if I put
an \allowbreak command just before it:

The following expression is too long and should be split: $a + b +
\allowbreak \left( c + d + f + b + c + d + f \right) = c$.

Morten Høgholm

unread,
Sep 2, 2005, 4:13:21 AM9/2/05
to

Using \left...\right creates an unbreakble object so when trying to find a
break point here, TeX could probably not use the place where your
\allowbreak is (which doesn't have that great an effect coming right after
a +). If you need the delimiters above to scale you might want to use
\bigl etc. as these don't have the effect of freezing the inner expression.
--
Morten

Angel Tsankov

unread,
Sep 2, 2005, 5:14:55 AM9/2/05
to
Well, should I use ( and ) or \left( and \right) for expression such as

a + b + c + d + f + b + c + d + f = c?

Piet van Oostrum

unread,
Sep 2, 2005, 5:44:32 AM9/2/05
to
>>>>> "Angel Tsankov" <Big...@abv.bg> (AT) wrote:

>AT> Well, should I use ( and ) or \left( and \right) for expression such as
>AT> a + b + c + d + f + b + c + d + f = c?

Just ( and ). \left( and \right) are for those cases when there are tall
parts inside.
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi...@vanoostrum.org

Morten Høgholm

unread,
Sep 2, 2005, 5:55:19 AM9/2/05
to
On Fri, 02 Sep 2005 11:14:55 +0200, Angel Tsankov <Big...@abv.bg> wrote:

> Well, should I use ( and ) or \left( and \right) for expression such as
>
> a + b + c + d + f + b + c + d + f = c?

You should almost never use \left ...\right for inline mathematics. If you
have something hat is so large as to require the automatic scaling then it
will probably not look very good as inline material. The line spacing will
be pretty bad.
--
Morten

Angel Tsankov

unread,
Sep 2, 2005, 8:37:15 AM9/2/05
to
I'd rather use \left... \right... for promotion/demotion purposes.

Morten Høgholm

unread,
Sep 2, 2005, 8:40:16 AM9/2/05
to
On Fri, 02 Sep 2005 14:37:15 +0200, Angel Tsankov <Big...@abv.bg> wrote:

> I'd rather use \left... \right... for promotion/demotion purposes.

Then you'll just have to learn to live with it.
--
Morten

Angel Tsankov

unread,
Sep 2, 2005, 8:46:42 AM9/2/05
to
I'm stunned! LaTeX would NOT break the following expression no matter
whether I insert \allowbreak commands or not:

\[
a = n + n + n + n + n + n + n + n + n + n + n + n + n + n + n + n + n +
n + n + n + n + n + n + n + n + n + n + n + n
\]

Angel Tsankov

unread,
Sep 2, 2005, 8:49:12 AM9/2/05
to
OK, but how am I supposed to break long equations and expressions?!
breqn does not break expressions in math environment. Furthermore, it
has problems with other packages.

What else could I try?

Morten Høgholm

unread,
Sep 2, 2005, 8:52:50 AM9/2/05
to

Of course not, this is not inline math. If you want to break display math
(that's what you have here), you must either use breqn to do it
automatically or use the amsmath facilities to do it manually.
--
Morten

0 new messages