For Programmers: Free Programming Magazines  


Home > Archive > Tex > September 2006 > Using \left\{ and \right\} on multiple lines









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using \left\{ and \right\} on multiple lines
Gary

2006-09-25, 4:17 am

TeXnicians,

I cannot seem to get the larger braces to span across multiple lines. A
minimal example:


\begin{multline}
\frac{\Delta\frac{\partial
\E(y_j|\mathbf{x})}{\partial\text{Premiu
m}}}{\Delta \text{Cover}} =
(\hat\beta_{j1} + \hat\beta_{j4} + \hat\beta_{j5})\phi\left\{
(\hat\beta_{j0} + \hat\beta_{j2} + \hat\beta_{j3}) + \\
(\hat\beta_{j1} + \hat\beta_{j4} +
\hat\beta_{j5})\times\text{Premium} +
\hat\beta_{j6}\text{Experience} + \hat\beta_{j7} \text{NCD} \right\} \\
-
(\hat\beta_{j1} + \hat\beta_{j5})\phi\{(\hat\beta_{j0} +
\hat\beta_{j3}) + (\hat\beta_{j1} +
\hat\beta_{j5})\times\text{Premium} \\ +
\hat\beta_{j6}\text{Experience} + \hat\beta_{j7} \text{NCD} \}
\end{multline}

gives errors. Using "normal" sized { and } looks ugly because of the
numerous parentheses.

Any suggestions?

Thanks

Gary

2006-09-25, 4:17 am

The above wasn't really a minimal example.

Here's another one:

\begin{multline}
\phi\left\{ a + b + c \\
+ d +e +f \right\}
\end{multline}



Gary wrote:
> TeXnicians,
>
> I cannot seem to get the larger braces to span across multiple lines. A
> minimal example:
>
>
> \begin{multline}
> \frac{\Delta\frac{\partial
> \E(y_j|\mathbf{x})}{\partial\text{Premiu
m}}}{\Delta \text{Cover}} =
> (\hat\beta_{j1} + \hat\beta_{j4} + \hat\beta_{j5})\phi\left\{
> (\hat\beta_{j0} + \hat\beta_{j2} + \hat\beta_{j3}) + \\
> (\hat\beta_{j1} + \hat\beta_{j4} +
> \hat\beta_{j5})\times\text{Premium} +
> \hat\beta_{j6}\text{Experience} + \hat\beta_{j7} \text{NCD} \right\} \\
> -
> (\hat\beta_{j1} + \hat\beta_{j5})\phi\{(\hat\beta_{j0} +
> \hat\beta_{j3}) + (\hat\beta_{j1} +
> \hat\beta_{j5})\times\text{Premium} \\ +
> \hat\beta_{j6}\text{Experience} + \hat\beta_{j7} \text{NCD} \}
> \end{multline}
>
> gives errors. Using "normal" sized { and } looks ugly because of the
> numerous parentheses.
>
> Any suggestions?
>
> Thanks


David Kastrup

2006-09-25, 4:17 am

"Gary" <pointless.spam@gmail.com> writes:

> The above wasn't really a minimal example.
>
> Here's another one:
>
> \begin{multline}
> \phi\left\{ a + b + c \\
> + d +e +f \right\}
> \end{multline}


I suggest you read up on what a minimal example is. It is something
that is supposed to pass through LaTeX, and that is hard to do without
a document preamble.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Hendrik Maryns

2006-09-25, 4:17 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gary schreef:
> The above wasn't really a minimal example.
>
> Here's another one:
>
> \begin{multline}
> \phi\left\{ a + b + c \\
> + d +e +f \right\}
> \end{multline}


multline wasn’t designed for this, it is for breaking long equations.
You want to either use a matrix, or aligned or gathered, see amsldoc.pdf

\begin{equation}
\phi \left\{\begin{aligned}
& a & + b & + c \\
& + d & +e & + f
\end{aligned}\right\}
\end{equation}

Untested.

But I think you really don’t need big braces here.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFF54ue+7xMGD3itQRAtfPAJ0f2nlP6sWN
MC6UFxk3HKE4dvYujQCeLHhl
rRXuL0QqfcbPhQ6fKMc9+J8=
=MluM
-----END PGP SIGNATURE-----
Filip Kosjenac

2006-09-25, 4:17 am

Gary <pointless.spam@gmail.com> wrote:
> \begin{multline}
> \phi\left\{ a + b + c \\
> + d +e +f \right\}
> \end{multline}


You should do it like this:

\begin{multline}
\phi\left\{ a + b + c \right. \\
\left. + d +e +f \right\}
\end{multline}

--
Do I dare to eat a peach?
Jonathan Fine

2006-09-25, 8:13 am

"Gary" <pointless.spam@gmail.com> wrote in message
news:1159172467.410535.300580@m7g2000cwm.googlegroups.com...
> TeXnicians,
>
> I cannot seem to get the larger braces to span across multiple lines.


Each line is a group, and the formula between \left and \right
is also a group.

These groups interleave rather than nest, and that is
the cause of your problem.

You've effectively got something like
[ { ] [ } ]

By the way, interleaved grouping is one of the classic
gotchas in typesetting. Italic (or coloured) text
being broken by a page boundary, for example.

To solve you're problem, you'll have to size the braces
by hand, using \bigl and \bigr, or some variant of these
commands. See LaTeX Companion, page 504.

--
Jonathan


Michele Dondi

2006-09-25, 8:13 am

On 25 Sep 2006 01:21:07 -0700, "Gary" <pointless.spam@gmail.com>
wrote:

>I cannot seem to get the larger braces to span across multiple lines. A


You have to fake this yourself. An empty delimiter, ".", is there
exactly for this purpose. Thus you will have

\left\{ \text{whatever} \right. \\
\left. \text{whatever else} \right\}

Sometimes whatever and whatever else have different heights, so you
may want to include a \vphantom{the taller of the two} in the other
one. At least that's how I did it in the past...


Michele
--
>It's because the universe was programmed in C++.

No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"
Gary

2006-09-25, 10:05 pm

Thank you so much for the helpful replies.

I have also found another way, if anyone is interested.

I've found that using \Bigg\{ and \Bigg\} works on equations spanning
on multiple lines.

Thanks again.


Michele Dondi wrote:
> On 25 Sep 2006 01:21:07 -0700, "Gary" <pointless.spam@gmail.com>
> wrote:
>
>
> You have to fake this yourself. An empty delimiter, ".", is there
> exactly for this purpose. Thus you will have
>
> \left\{ \text{whatever} \right. \\
> \left. \text{whatever else} \right\}
>
> Sometimes whatever and whatever else have different heights, so you
> may want to include a \vphantom{the taller of the two} in the other
> one. At least that's how I did it in the past...
>
>
> Michele
> --
> No, no, it was programmed in Forth. See Genesis 1:12:
> "And the earth brought Forth ..."
> - Robert Israel in sci.math, thread "Why numbers?"


Brooks Moses

2006-09-25, 10:05 pm

Gary wrote:
> Thank you so much for the helpful replies.
>
> I have also found another way, if anyone is interested.
>
> I've found that using \Bigg\{ and \Bigg\} works on equations spanning
> on multiple lines.


Indeed; this was Jonathan Fine's suggestion. What you're doing telling
LaTeX what size the braces should be, rather than telling it to size
them automatically as \left\{ and \right\} do.

There are four possible sizing commands in the set: \big, \Big, \bigg,
and \Bigg.

Also, note that to get the correct spacings, you should append an "l"
and an "r" to the command names: \Biggl\{ and \Biggr\}.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
Celtic Steve

2006-09-26, 8:45 am


Gary wrote:
> TeXnicians,
>
> I cannot seem to get the larger braces to span across multiple lines. A
> minimal example:
>
>

I used the following recently quite successfully :-

$ % Enter math mode
\left\{ % Left bracket
\begin{array}{l}
\makebox{First Line}\\
\makebox{Second Line}\\
\makebox{Third Line}\\
\makebox{Fourth Line}\\
\makebox{Fifth Line}\\
\end{array}
\right\} % Right bracket
\makebox{Text to the right of the right brace}
$ % Finished with math mode

The \left\{ can be replaced by \left. if the left brace is not
required, and likewise \right\} by \right. if the right isn't to be
used.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com