Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The code part looks like this

\begin{equation}
   \frac
    {
        \left(\sum_i r_{ik}x_{ij}\right) - 
        \mu'_{kj}\left(\sum_i r_{ik}\right) +
        (\alpha-1)-\mu'_{kj}(\alpha+\beta-2)
    }
    {
        \mu'_{kj}(1-\mu'_{kj}) 
    } = 0
\end{equation}
\begin{equation}
    \left(\sum_i r_{ik}x_{ij}\right) - 
    \mu'_{kj}\left(\sum_i r_{ik}\right) +
    (\alpha-1)-\mu'_{kj}(\alpha+\beta-2)
     = 0
\end{equation}
\begin{equation}
    \mu'_{kj} \left[\left(\sum_i r_{ik}\right)+\alpha+\beta-2\right] 
    = \left(\sum_i r_{ik} x_{ij}\right)+\alpha-1
\end{equation}
\begin{equation}
    \mu'_{kj} = \frac{
        \left(\sum_i r_{ik} x_{ij}\right)+\alpha-1
    }
    {
        \left(\sum_i r_{ik}\right)+\alpha+\beta-2
    }
\end{equation}

For the first and last equation the \sum_i gets rendered as it should but for the two mid-equations the \sum_i gets rendered as \sum\limits_i which doesn't look good at all.

What has happened with my code?! The rest of the code can be found here: https://github.com/Jim-Holmstroem/dd2447/blob/map_first/homework/assignment2/doc.tex#L266

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

This is a displaystyle mathmode vs inline mathmode issue.

In your particular case, it comes down to using \sum in a \frac or not. You'll notice that in your first and last equation you haven't used \sum inside of a \frac. In your middle two equations, you have used it inside a \frac.

By default, TeX will display a \sum inside of a \frac as inline mode. You can change this by using \displaystyle immediately before it, or (better) \dfrac from the amsmath package.

If you're in displaystyle mode and you want it look like inline, then you can use the \textstyle command, which is (kind of) the opposite of \displaystyle. For example

\begin{equation}
    \textstyle\sum_i
\end{equation}

works fine, but I'm not sure how recommendable it is :)

share|improve this answer
    
I'd use \sum\limits_i in this case. –  egreg Nov 23 '12 at 18:09
add comment

Your Answer

 
discard

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.