0

Why in the above formula the subscript and superscript for summation symbol is different from the below one?

\documentclass[hidelinks,review]{elsarticle}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{equation} \textrm{R}^{2}=1-\frac{\sum_{i=1}^{n}(a_{i}-p_{i})^{2}}{(\mu_{a}-p_{i})^{2}} \end{equation}

\begin{equation} \textrm{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(a_{i}-p_{i})^{2}} \end{equation}

\end{document}

enter image description here

please note that it is numbered formula

Bernard
  • 271,350
Ahmad Turani
  • 291
  • 1
  • 13
  • 2
    The two components of fractions are set in text-mode math (to save space). If you insist you can use \frac{\displaystyle \sum ... }{ ...} – daleif Apr 03 '22 at 08:33

1 Answers1

2

As explain @daleif in his comment, nominators and denominators in fractions are set in text-mode math. This can be changed by \displaystyle and \limits:

\documentclass[hidelinks,review]{elsarticle}
\usepackage{mathtools}

\begin{document}

\begin{equation} \mathrm{R}^{2}=1-\frac{\sum_{i=1}^{n}(a_{i}-p_{i})^{2}}{(\mu_{a}-p_{i})^{2}} \end{equation}

\begin{equation} \mathrm{R}^{2}=1-\frac{\sum\limits_{i=1}^{n}(a_{i}-p_{i})^{2}}{(\mu_{a}-p_{i})^{2}} \end{equation}

\begin{equation} \mathrm{R}^{2}=1-\frac{\displaystyle\sum_{i=1}^{n}(a_{i}-p_{i})^{2}}{(\mu_{a}-p_{i})^{2}} \end{equation}

\begin{equation} \mathrm{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(a_{i}-p_{i})^{2}} \end{equation}

\end{document}

enter image description here

daleif
  • 54,450
Zarko
  • 296,517