# Math mode summation text top and bottom

I would like the text, that is i=1 and N, on the summation to be top, and bottom. something like this

I'm using the packages, amsmath, relsize, and physics.

$$\label{eq: TEST} TEST = \mathlarger{\frac{{\mathlarger{\sum}}_{i=1}^{N}\frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}}{m_{\mathrm{i}}}}{N}}$$


Secondly, I get lots of errors for this equation:

./Chapter3/section1.tex:524: Missing $inserted.<inserted text>$
l.524

I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
./Chapter3/section1.tex:524: Display math should end with $$.<to be read again> \par l.524 The ' that I just saw supposedly matches a previous $$'.
So I shall assume that you typed ' both times.
./Chapter3/section1.tex:526: LaTeX Error: Bad math environment delimiter.
./Chapter3/section1.tex:526: You can't use \eqno' in vertical mode.\endmathdisplay@a ...\df@tag \@empty \else \veqno
\alt@tag \df@tag \fi \ifx ...
l.526


What am I doing wrong?

• I get no error from your code (after loading amsmath, physics and relsize). – egreg Sep 8 '16 at 8:01

You have several possibilities, none of which involves \mathlarger:

\documentclass{article}
\usepackage{amsmath,physics}

\begin{document}

$$\label{eq:TESTa} T = \frac{ \displaystyle\sum\limits_{i=1}^{N} \frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}} {m_{\mathrm{i}}} }{N}$$

$$\label{eq:TESTb} T = \frac{ \sum\limits_{i=1}^{N} \frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}} {m_{\mathrm{i}}} }{N}$$

$$\label{eq:TESTc} T = \frac{ \sum_{i=1}^{N} \frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}} {m_{\mathrm{i}}} }{N}$$

$$\label{eq:TESTd} T = \frac{1}{N}\biggl(\, \sum_{i=1}^{N} \frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}} {m_{\mathrm{i}}} \,\biggr)$$

$$\label{eq:TESTe} T = \frac{1}{N} \sum_{i=1}^{N} \frac{\abs{M_{\mathrm{i}} - m_{\mathrm{i}}}} {m_{\mathrm{i}}}$$

\end{document}


My preference would go to (3), (4) or (5)

• In the last format, the parentheses can even be omitted – egreg Sep 8 '16 at 8:32
• I prefer the last one tbh – tandem Sep 8 '16 at 8:34

The error is because you have a blank line in an equation environment.

For your \sum question I would start by removing all the \mathlarger commands, then if you really must, use \frac{\displaystyle \sum_....}{..} to force a displaystyle setting in the fraction, or perhaps better \frac{\sum\limits_{i=0}..... to force the limits setting just on the sum without affecting the rest of the numerator.

Incidentally why do you have a math italic i in _{i=0} but an upright i in M_{\mathrm{i} ?

• Ah, thanks for point out the last part. I will fix that – tandem Sep 8 '16 at 8:31