4

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?

tandem
  • 407

2 Answers2

7

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

egreg
  • 1,121,712
6

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} ?

David Carlisle
  • 757,742