0

I'm trying to use the summation symbol in fractions, but I found that the superscript and subscript of the summation symbol go to the side, is this allowed mathematically? Or am I writing the Latex code wrong?

$$
    \begin{aligned}
        w = \frac{
            \frac{1}{m} \sum_{i = 0}^{m} (-2x_1y_1)
        }{
            2\frac{1}{m} \sum_{i = 0}^{m} x_1^2
        }
    \end{aligned}
$$

enter image description here

aszswaz
  • 267

1 Answers1

1

I think this is allowed in maths. This is the inline mode which can be inserted in text if with only the denominator for example.

Consider the following code

\documentclass{article}

\begin{document} [ w = \frac{ \frac{1}{m} \sum_{i = 0}^{m} (-2x_1y_1) }{ 2\frac{1}{m} \sum_{i = 0}^{m} x_1^2 } ]

[ w = \frac{ \frac{1}{m} \sum\limits_{i = 0}^{m} (-2x_1y_1) }{ 2\frac{1}{m} \sum\limits_{i = 0}^{m} x_1^2 } ] \end{document}

which yields

Result

Adding \limits after the \sum does the trick.

By the way, \[ \] is preferrable to $$ $$.