Feed on
Posts
Comments


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}


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

5 Responses to “split a long, multiline formula over two lines”

  1. on 19 Nov 2007 at 12:51 am Roozbeh

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

  2. on 02 Oct 2008 at 2:10 pm Alfredo

    Great 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).

  3. on 03 Oct 2008 at 7:22 am Lawrence David

    sorry – no idea!

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

  4. on 12 Aug 2009 at 6:46 pm Oliver

    Thanks for the tip! Had a nasty equation that was covering up its own number, but managed to fix it with this :)

  5. on 16 Apr 2012 at 10:35 am ecn

    to 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.

Did I get this wrong? Let me know!

Trackback URI | Comments RSS