TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to divide this equation into two different lines but I am not able to. I tried to use package breqn but that started giving me some compilation errors on the style file itself.

\frac{ \sum_{n_i\in S_{c_k}} P_{ij} ( x_{i} P(y_i = 1\ |\ x_i = 1) + (1- x_{i}) P (y_i = 1\ |\ x_i=0))}{\sum_{n_i\in S_{c_k}} P_{ij}}

The problem here is \frac{} which prevents me from using align to break the equation.

enter image description here

share|improve this question

migrated from stackoverflow.com Jun 5 '12 at 3:34

This question came from our site for professional and enthusiast programmers.

The equation itself fits on a single line. Where do you want to break it? – Werner Jun 4 '12 at 23:52
There seem to be more } right braces than { left braces in that equation. Are there? – thb Jun 4 '12 at 23:58
The start of that equation looks a little ... odd. Do you really want the P on the denominator of the fraction with the subscript i removed from it? Or did you want P_i there? It's unusual notation to have an empty summation divided by something. – Loop Space Jun 5 '12 at 9:51
Well, the original equation was somewhat longer. I removed some useless parts from it to simplify it. Now it does fit in a line and looks odd. – user1436235 Jun 5 '12 at 16:31
The input and the output don't agree. Anyway, it's impossible to break a fraction across lines. – egreg Jun 5 '12 at 16:40

You can use multline



share|improve this answer
In the sake of minimality, you can omit amssymb ;) As well, some additional relevant information: (1) multline* supresses equation numbering; (2) it goes like this: first line is left-aligned, all middle lines are centered, last line is right-aligned. – yo' Jun 5 '12 at 7:25
amssymb removed – sandu Jun 5 '12 at 9:29
multiline does not seem to work with \frac. Latex complains about missing } – user1436235 Jun 5 '12 at 16:33

Since you mention that this is a simplified version of your actual formula, I am assuming that it won't fit on one line. If so, here is one way you can display a similar equation over multiple lines:

enter image description here




\frac{1}{\sum_{n_i\in S_{c_k}} P_{ij}}
\sum_{n_i\in S_{c_k}} &\phantom{+}P_{ij} \bigl( x_{i} P(y_i = 1\ |\  x_i = 1 ) \\
    &+ (1- x_{i}) P(y_i = 1\ |\ x_i=0)\bigr) \Biggr]
share|improve this answer
I've fixed \bigl and similar ones. Probably multline is better, as it doesn't require finding alignment points. – egreg Jun 5 '12 at 16:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.