0

I'm writing a double sum over elements of a set and its complement, and I would like the result to look better. The elements I use as indices are not aligned due to the presence of $\overline{S}$; this code:

$$\sum_{u\in S}\sum_{v\in \overline{S}}f(u, v)$$

yields that result:

enter image description here

  • 1
    Please post a minimal working example. You have 2427 rep, you should know the importance of MWEs. – frougon Apr 04 '20 at 09:00
  • 1
  • @frougon: I do, and it does not make much sense in this case since this is as basic as it gets and does not depend on anything. But for the sake of completeness, here's a one-liner: \documentclass{minimal}\begin{document}\[\sum_{u\in S}\sum_{v\in \overline{S}}f(u, v)\]\end{document} – Anthony Labarre Apr 04 '20 at 11:02
  • 1
    By doing so, you are wasting the time of people trying to help you. By the way, the minimal class is not designed for such uses, better use article. – frougon Apr 04 '20 at 11:14

1 Answers1

4

Multiple subscripts under different objects often require manual adjustment because of conflicting shapes.

Use a phantom.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\sum_{u\in S}\sum_{v\in\overline{S}} c(u,v)
\qquad
\sum_{u\in S\vphantom{\overline{S}}}\sum_{v\in\overline{S}} c(u,v)
\qquad
\sum_{\substack{u\in S \\ v\in\overline{S}}} c(u,v)
\end{equation*}

\begin{equation*}
\sum_{u\in S}\sum_{v\in\bar{S}} c(u,v)
\qquad
\sum_{u\in S\vphantom{\bar{S}}}\sum_{v\in\bar{S}} c(u,v)
\qquad
\sum_{\substack{u\in S \\ v\in\bar{S}}} c(u,v)
\end{equation*}

\end{document}

I added alternative ways with \substack and \bar, which is generally preferable to \overline.

enter image description here

egreg
  • 1,121,712