Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latex: how break a line when summing over two things

Tags:

latex

Lets say I want to sum over i \in S and i \in T. Currently I use:

\displaystyle \sum_{i \in S, i \in T} i

But this will display the sum-overs one after the other and not one above the other like I want.

How can I do this?

thanks

like image 911
Guy Avatar asked Dec 23 '09 13:12

Guy


1 Answers

\atop doesn't give the right spacing. You should use amsmath and use \substack:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\sum_{i \in S \atop i \in T} i
\end{equation}

\begin{equation}
\sum_{\substack{i \in S\\ i \in T}} i
\end{equation}

\end{document}

The results, first with \atop on the left and \substack on the right:

limits using atop http://www.astro.virginia.edu/~as8ca/SO/atop.png limits using substack http://www.astro.virginia.edu/~as8ca/SO/substack.png

And then one above the other, first \atop:

limits using atop http://www.astro.virginia.edu/~as8ca/SO/atop.png

then \substack:

limits using substack http://www.astro.virginia.edu/~as8ca/SO/substack.png

like image 185
Alok Singhal Avatar answered Nov 03 '22 18:11

Alok Singhal