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

Multiline math expressions

1,541 views
Skip to first unread message

bill

unread,
Jul 11, 2002, 8:25:27 AM7/11/02
to

What's the best way to produce effects like this in LaTeX:

p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +
p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +
(1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))

This is not an equation, but just a long math expression that needs to
be broken into several lines.

Thanks.

b.

Lars Madsen

unread,
Jul 11, 2002, 8:32:29 AM7/11/02
to
bill wrote:

the amsmath package defines a multline environment

try that one (a bit information on how to use it can be found in the new
version of The LaTeX Companion chapt. 8, can be found at CTAN,
www.ctan.org/info/)

\begin{multline*} % nonumber


p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +\\
p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +\\
(1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))

\end{multline}

to get more control there's the \shoveright and \shoveleft commands, but
have a look in the chapter above

--

/daleif
F2.10 - Institut for Matematiske Fag, Matematisk Afdeling
Århus Universitet

Cameron, Charles B.

unread,
Jul 11, 2002, 8:29:50 AM7/11/02
to
Try \begin{multiline} ... \end{multiline} in the amsmath package.

--

Charles B. Cameron


Lars Madsen

unread,
Jul 11, 2002, 8:33:47 AM7/11/02
to
Lars Madsen wrote:

oops, that should end with \end{multline*} ofcourse

Fredrik Engström

unread,
Jul 11, 2002, 8:31:52 AM7/11/02
to
Use
\begin{multline}

p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) \\
+ p_g(a_1) p_g(a_2) (1 - p_g(a_3)) \\
+ (1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))
\end{multline}

or if you don't want labels use \begin{multline*} \end{multline*}. You
have to have AMSLaTeX to do that.

Also.. you should break the line _before_ binary operations (such as +),
but _after_ relation symbols (such as =). I think...

Cheers,
Fredrik Engström

bill

unread,
Jul 11, 2002, 9:49:11 AM7/11/02
to

In <3D2D7ADD...@imf.au.dk> Lars Madsen <dal...@imf.au.dk> writes:

>the amsmath package defines a multline environment

I tried

...

\usepackage{amsmath}

...

\begin{document}

...

\begin{multline*}


p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +\\
p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +\\
(1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))

\end{multline*}

...


I get:

! LaTeX Error: Environment multiline* undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.228 \begin{multiline*}

?

I get identical results whether I bracket the whole thing between $$'s
or not.

>try that one (a bit information on how to use it can be found in the new
>version of The LaTeX Companion chapt. 8, can be found at CTAN,
>www.ctan.org/info/)

There's nothing at http://www.ctan.org/info (HTTP error, basically).

b.


Herbert Voss

unread,
Jul 11, 2002, 9:53:22 AM7/11/02
to
bill wrote:

> I tried


>
> \begin{multline*}
> p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +\\
> p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +\\
> (1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))
> \end{multline*}
>
> ...
>
>
> I get:
>
> ! LaTeX Error: Environment multiline* undefined.


I suppose you tired multi instead of mult

Herbert

bill

unread,
Jul 11, 2002, 9:55:47 AM7/11/02
to
In <agk2cn$rq3$1...@reader1.panix.com> bill <bill...@hotmail.com> writes:
>I get:

> ! LaTeX Error: Environment multiline* undefined.
>
> See the LaTeX manual or LaTeX Companion for explanation.
> Type H <return> for immediate help.
> ...
>
> l.228 \begin{multiline*}
>
> ?

In fact, the following grep

% grep -i multiline /usr/share/texmf/tex/latex/amsmath/*

produces no output. The version of amstex.sty I'm using is dated year
2000.

b.

Herbert Voss

unread,
Jul 11, 2002, 10:14:02 AM7/11/02
to
Herbert Voss wrote:


>
>
> it's better to read some docs ... ;-)
> here is an example for the multline environment


and it's better to give an url ..

http://www.lyx.org/help/mathstuff/equations/node16.html

Herbert

Herbert Voss

unread,
Jul 11, 2002, 10:13:10 AM7/11/02
to
bill wrote:

it's better to read some docs ... ;-)
here is an example for the multline environment

Herbert


ginak

unread,
Jul 11, 2002, 10:21:43 AM7/11/02
to
In <3D2D8DD2...@perce.de> Herbert Voss <vo...@perce.de> writes:

>I suppose you tired multi instead of mult

That was my mistake. Sorry.

Thanks.

bill

Lars Madsen

unread,
Jul 11, 2002, 10:37:57 AM7/11/02
to
bill wrote:

I said multline!!! not multiline !!!, common mistake.

the environment is called multline

Donald Arseneau

unread,
Jul 11, 2002, 5:39:32 PM7/11/02
to
Lars Madsen <dal...@imf.au.dk> writes:

> the environment is called multline

I never realized that!! (Shows how often I use it...)

Donald Arseneau as...@triumf.ca

David Kastrup

unread,
Jul 11, 2002, 6:33:13 PM7/11/02
to
Lars Madsen <dal...@imf.au.dk> writes:

> bill wrote:
>
> > In <3D2D7ADD...@imf.au.dk> Lars Madsen <dal...@imf.au.dk> writes:
> >
> > >the amsmath package defines a multline environment
> >
> > I tried
> >

> > \begin{multline*}
> > p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +\\
> > p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +\\
> > (1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))
> > \end{multline*}
> >

> > I get:
> >
> > ! LaTeX Error: Environment multiline* undefined.
> >
>

> I said multline!!! not multiline !!!, common mistake.
>
> the environment is called multline

Uh, no. It is called multline*. Multline would have equation
numbers all over the place.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David....@t-online.de

Herbert Voss

unread,
Jul 12, 2002, 2:05:03 AM7/12/02
to
David Kastrup wrote:

> Lars Madsen <dal...@imf.au.dk> writes:
>
>
>>bill wrote:
>>
>>
>>>In <3D2D7ADD...@imf.au.dk> Lars Madsen <dal...@imf.au.dk> writes:
>>>
>>>
>>>>the amsmath package defines a multline environment
>>>>
>>>I tried
>>>
>>>\begin{multline*}
>>>p_g(a_1) (1 - p_g(a_2)) (1 - p_g(a_3)) +\\
>>> p_g(a_1) p_g(a_2) (1 - p_g(a_3)) +\\
>>> (1 - p_g(a_1)) p_g(a_2) (1 - p_g(a_3))
>>>\end{multline*}
>>>
>>>I get:
>>>
>>> ! LaTeX Error: Environment multiline* undefined.
>>>
>>>
>>I said multline!!! not multiline !!!, common mistake.
>>
>>the environment is called multline
>>
>
> Uh, no. It is called multline*. Multline would have equation
> numbers all over the place.


I get only one for the last row ... :-)


Herbert


Lars Madsen

unread,
Jul 12, 2002, 8:09:19 AM7/12/02
to
Herbert Voss wrote:

me too :-), think it's designed to be used in splitting one very long line of
math

Dan Luecking

unread,
Jul 12, 2002, 1:09:19 PM7/12/02
to
On Fri, 12 Jul 2002 14:09:19 +0200, Lars Madsen <dal...@imf.au.dk>
wrote:

An opinion amsldoc shares with you :-)

For the full story: amsldoc section 3.3, where useful things like
\multlinegap are also discussed.

Dan

--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701

Donald Arseneau

unread,
Jul 12, 2002, 4:40:16 PM7/12/02
to
luec...@uark.edu (Dan Luecking) writes:

> For the full story: amsldoc section 3.3, where useful things like
> \multlinegap are also discussed.

Does it also explain what the AMS has against the letter "i"?
Or was it a set-up for ........

The environment is named multiline, but the i is imaginary.

(Boooo hissss)

Donald Arseneau as...@triumf.ca

Herbert Voss

unread,
Jul 12, 2002, 4:36:17 PM7/12/02
to
Donald Arseneau wrote:

> luec...@uark.edu (Dan Luecking) writes:
>
>
>>For the full story: amsldoc section 3.3, where useful things like
>>\multlinegap are also discussed.
>>
>
> Does it also explain what the AMS has against the letter "i"?
> Or was it a set-up for ........
>
> The environment is named multiline, but the i is imaginary.


something like i=sqrt(-1) ... :-)

Herbert

David Kastrup

unread,
Jul 12, 2002, 5:09:16 PM7/12/02
to
Donald Arseneau <as...@triumf.ca> writes:

Should have been multlne n that case, shouldn't t?

Donald Arseneau

unread,
Jul 12, 2002, 9:11:57 PM7/12/02
to
David Kastrup <David....@t-online.de> writes:

> > The environment is named multiline, but the i is imaginary.

> Should have been multlne n that case, shouldn't t?

\begin{multiline}
\end{-multlne}

Donald Arseneau as...@triumf.ca

Dan Luecking

unread,
Jul 12, 2002, 9:18:59 PM7/12/02
to
On 12 Jul 2002 13:40:16 -0700, Donald Arseneau <as...@triumf.ca> wrote:

>luec...@uark.edu (Dan Luecking) writes:
>
>> For the full story: amsldoc section 3.3, where useful things like
>> \multlinegap are also discussed.
>
>Does it also explain what the AMS has against the letter "i"?

My theory is it had a different name that was later rejected, and the
person responsible for making the change mistyped multiline.

Being somewhat dislexic myself, I can sympathize, and be thankful
we don't have a mutiline environment

>Or was it a set-up for ........
>
>The environment is named multiline, but the i is imaginary.
>
>(Boooo hissss)

Those mathematicians, they're such cut-ups!

Michael J Downes

unread,
Jul 15, 2002, 5:27:29 PM7/15/02
to
luec...@uark.edu (Dan Luecking) writes:

> On 12 Jul 2002 13:40:16 -0700, Donald Arseneau <as...@triumf.ca> wrote:
>
> >Does it also explain what the AMS has against the letter "i"?
>
> My theory is it had a different name that was later rejected, and the
> person responsible for making the change mistyped multiline.

Nothing so complicated. Most of what is in the amsmath package today
is simply the same nomenclature, by direct descent, that got originally
used in AMS-TeX (circa 1983). I hesitate to blame Spivak for choosing
"multline" over "multiline" because I wasn't there at the time and I
don't know that it was his idea.

Practically speaking, it might be a good idea for amsmath to define both
variants. At one time there was a genuine need to avoid using more
control sequence names than necessary, but that is not much of an issue
any more with the current versions of TeX.

0 new messages