[Tex/LaTex] Math mode summation text top and bottom

equationsmath-mode

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.

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

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 \end{equation}

What am I doing wrong?

Best Answer

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

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

\begin{document}

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

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

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

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

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

\end{document}

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

enter image description here

Related Question