0

I am trying to get the subscript in both summations in the following equation centered under the summation symbol: summation_indices_not_centered

\displaystyle \Phi(H) = \min { \sum_{\substack{i \in S \\ j \notin S}} w_{ij}  \over {\sum_{\substack{i \in S}} \pi_i} }

I have reached the above syntax result, which compiles without error but doesn't output what I am looking for, by following the links below:

Sums in math mode: how to display index under the sigma sign?

Separate long math text under sum symbol into different lines?

\limits doesn't seem to work, i.e the expression:

\[ \displaystyle \Phi(H) = \min { \sum_{\limits{\substack{i \in S \\ j \notin S}}} w_{ij}  \over {\sum_{\limits{i \in S}} \pi_i} } \]

gives the following error message: Limit controls must follow a math operator

If possible, I would like this to work for both inline and displayed formulas

4
  • don't use $$ or \over in latex, both are tex primitives which are somewhat hard to disable but should never be used in latex documents. Feb 27, 2022 at 10:48
  • but as the message says \limits has to follow an operator so \sum\limits_{...} Feb 27, 2022 at 10:49
  • @DavidCarlisle Usage of \frac instead of \over noted. How should I change the above for the equation to render correctly? I only wrote the $$...$$ after reading this: math.meta.stackexchange.com/questions/5020/…
    – aristeidis
    Feb 27, 2022 at 11:41
  • to show the equation use an image as in the accepted answer, we do not have mathjax running on this site, it would be confusing as it doesn't use tex Feb 27, 2022 at 12:58

3 Answers 3

3

Put the \displaystyle in front of the \sums.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
  \Phi(H) = \min \frac{\displaystyle\sum_{\substack{i \in S \\ j \notin S}} w_{ij}}
                      {\displaystyle\sum_{\substack{i \in S}} \pi_i}
\]
\end{document}

I recommend to put the sums into one line: enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
  \Phi(H) = \min \bigg(\sum_{\substack{i \in S \\ j \notin S}} w_{ij} \Big/
                       \sum_{\substack{i \in S}} \pi_i\bigg)    
\]
\end{document}
4
  • Possibly \Big/ would be better in the second case.
    – egreg
    Feb 27, 2022 at 11:01
  • Thank you very much! Could you please elaborate on why \limits is not needed in this case? But looks like it is when writing it inline..
    – aristeidis
    Feb 27, 2022 at 11:33
  • @egreg Not just possibly ... thanks, modified.
    – gernot
    Feb 27, 2022 at 11:45
  • @aristeidis When you use \[...\], then you are in \displaystyle, and the large prefix operators like sum and product put the limits above and below by default. See also tex.stackexchange.com/a/119328/110998
    – gernot
    Feb 27, 2022 at 11:51
1

hm, limits works if they are in correct place (immediately after \sum):

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
  \Phi(H) = \min \frac{\sum\limits_{\substack{i \in S \\ j \notin S}} w_{ij}}
                      {\sum\limits_{\substack{i \in S}} \pi_i}
\]
\end{document}

enter image description here

1

I will use a compact mode to denote the sum into the \min command.

\documentclass{article}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage{eulervm}
\begin{document}
Let be $W=\displaystyle\sum_{\substack{i \in S \\ j \notin S}}{w_{ij}}$ and $T=\displaystyle\sum_{ i \in S}{\pi_{i}}$ we have:
\[
  \Phi(H) = \min \frac{W}{T}
\]
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .