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

4
  • 1
    Please post a minimal working example. You have 2427 rep, you should know the importance of MWEs. – frougon Apr 4 '20 at 9:00
  • 1
    Don't use $$ in LaTeX, see Why is \[ … \] preferable to $$? – egreg Apr 4 '20 at 9:10
  • @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 4 '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 4 '20 at 11:14
5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.