## split a long, multiline formula over two lines

March 29th, 2006 by Lawrence David

to split a long, multiline formula over two lines, import the “amsmath” package and use the “split command” and double slashes.

for instance, to produce the above equation, use the following code:

\usepackage{amsmath}

…\begin{split}

\arg\max_\Theta\left[\sum_zP(\mathcal{G}|\mathcal{D},\mathcal{S})

P(\mathcal{G}|\mathcal{S},\Theta_n)\log{P(\mathcal{D}|\mathcal{G},

\mathcal{S},\Theta)}\right. \\

+

\left.\sum_zP(\mathcal{G}|\mathcal{D},\mathcal{S})P(\mathcal{G}|

\mathcal{S},\Theta_n)\log{P(\mathcal{D}|\mathcal{G},\mathcal{S},\Theta)}\right]

\end{split}

on 19 Nov 2007 at 12:51 amRoozbehHi!

You didn’t get anything wrong here. I just wanted to tell you that your website is perfect!

Roozbeh

on 02 Oct 2008 at 2:10 pmAlfredoGreat tip! do you know a good way to guaranty that in your example, the square brakets are the same size.

In your example they look similar in height but this is only a coincidence if the top line didn’t have a \sum then the brakets will have different sizes.

I am having that problem right now. (I know you can hack it and add a invisible symbols but thats not the solution I am looking for).

on 03 Oct 2008 at 7:22 amLawrence Davidsorry – no idea!

if you figure it out, feel free to leave a note here in the comments!

on 12 Aug 2009 at 6:46 pmOliverThanks for the tip! Had a nasty equation that was covering up its own number, but managed to fix it with this

on 16 Apr 2012 at 10:35 amecnto have [ of the same size

type \right. before first \\,

then \left. at the start and \right]

as usual in the end, or smth like this.