1

I would like to create an equation with sigma where the yellow element is under the sigma sign as follows.

expected

Here is the code in overleaf with TeX Live 2022.

\documentclass[journal]{IEEEtran}
\usepackage{mathtools}
\usepackage{amsmath}
\begin{document}

\begin{equation} \footnotesize \label{eq:R5} R_5(A^\prime_x) = (\frac{1}{1 + \sum_{\tau \in H(A^\prime_x)} \tau} )(n + 2 + |A^\prime_x|)w + (n+2)v + \sum_{P\in A^\prime_x} P) \quad \forall A^\prime_x \in S^\prime \ \end{equation} \end{document}

Since it is two column format, hence I use footnote font to ensure all the equation within one column. Unfortunately, the result shows that the yellow highlighted element is not under the sigma sigma thus it is over the two columns format as follows.

result

Is there anyway to make sure that the yellow highlighted element under the sigma sign so that the equation will fit into the format?

Thank you.

3 Answers3

3

Don't scale equation!

\documentclass{IEEEtran}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\lipsum
\begin{equation}
\begin{aligned}
R_5(A'_x) & = \biggl((n + 2 + |A'_x|)w + (n+2)v + \sum_{P\in A'_x} P\biggr)                                                \\
          & \phantom{{}={}}\times\biggl(\frac{1}{1 + \sum\limits_{\tau \in H(A'_x)} \tau}\biggr) \quad \forall A'_x \in S' \\
\end{aligned}
\end{equation}
\lipsum
\end{document}

enter image description here

Clara
  • 6,012
0

You would be able to write it like this:

\begin{equation} \footnotesize \label{eq:R5}
   R_{5}\left( A^{\prime}_{x} \right) = \left( \frac{1}{1 + \sum\limits_{\tau \in H\left( A^{\prime}_{x} \right)} \tau} \right) \cdot \left( \left( n + 2 + \left| A^{\prime}_{x} \right| \right) \cdot w + \left( n + 2 \right) \cdot v + \sum\limits_{{P \in A^{\prime}_{x}}} P \right),\, \forall A^{\prime}_{x} \in S^{\prime}\\
\end{equation}

What this gives you:

enter image description here


Tips:

  • You should use \left( and \right) or \left| and \right|. Then brackets become as large as what they are supposed to bracket, so they completely enclose it, which usually makes the formulas nicer.
  • With \sum\limits_{} the index under the sum is usually correctly and nicely formatted, which is quite useful.
  • Using \cdot between parentheses for the multiplication sign isn't necessary here, but I think it makes the equation more layered and nicer. In addition, you can "structure" longer formulas with the use of different multiplication signs e.g. \times or ast.
  • The scaling of equations can also mess up some programs, which is why it is better not to scale them.
  • This code throws a lot of warnings. Furthermore, suggesting to use \left and \right indiscriminately is usually bad advice, see https://tex.stackexchange.com/q/173717/82917 (and countless examples on this site). – campa Mar 19 '23 at 21:39
0

An alternative to @Clara nice answer (+1) solution with uzing \multlineand\matclap`:

\documentclass[journal]{IEEEtran}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}

\usepackage{lipsum}

\begin{document} \lipsum[1]

\begin{multline}\label{eq:R5} R_5(A^\prime_x) = \frac{1}{1 + \sum\limits_{\mathclap{\tau \in H(A^\prime_x)}} \tau}(n + 2 + \abs{A'})w + {}\ (n+2)v + \sum_{P\in A'_x} P \qquad\forall A^\prime_x \in S^\prime
\end{multline} \lipsum[2-7] \end{document}

enter image description here

Zarko
  • 296,517