Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want some advice about how to format it better if I have to write a long text below a $\sum$ or a $\prod$ sign. Basically I want to explain the restriction over which the sum or the product is being taken.

For example how can I improve the looks of these equations,

$N_i (\rho) = \sum _ {B \in \rho s.t n_{\delta_j}(B) = 0 
  \forall j \neq i} n_{\delta_i} (B)$

$\sum _{ \rho s.t N_i(\rho) = a_i and M_i(\rho) = b_i} 
  \prod _{B \in \rho} \langle \prod_{i=1}^{n} \delta_i ^{n_{\delta_i}(B)} 
  y_i ^{n_{y_i}(B)} \rangle_c$
share|improve this question
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  egreg Mar 17 '13 at 20:54
    
In addition to following @Herbert's suggestion regarding the use of the \mathclap command, you may want to do the following as well: First, should the "s.t" parts be input as \text{ s.t. }? Second, you may also want to use \biggl\langle and \biggr\rangle, respectively, instead of just \langle and \rangle. –  Mico Mar 17 '13 at 21:31

2 Answers 2

use \mathclap:

\documentclass{scrartcl}
\usepackage{mathtools}

\begin{document}

\[
N_i (\rho) = \sum_{\mathclap{\substack{B \in \rho s.t n_{\delta_j}(B) = 0\\ \forall j \neq i}}} n_{\delta_i} (B)
\]

\[
\sum _{\mathclap{\substack{\rho s.t N_i(\rho) = a_i \text{ and }\\ M_i(\rho) = b_i}}} \prod {B \in \rho} \langle \prod{i=1}^{n} \delta_i ^{n_{\delta_i}(B)} y_i ^{n_{y_i}(B)} \rangle_c
\]

\end{document}

enter image description here

share|improve this answer
    
In the second equation, I think B\in\rho should be typeset below rather than to the right of the first product symbol. If that's the case, you probably don't want to apply \mathclap to the expression associated with the summation symbol. Separately, the i=1 term should probably be typeset below rather than to the right of the second product symbol. –  Mico Mar 17 '13 at 21:47

There's a lot of important information contained in the subscripts of the summation signs. It's almost certainly a good idea to break up the subscript material into two or, better still, three lines to simplify the task of actually reading this material. Breaking up these lines may be achieved with, e.g., the \substack macro provided by the amsmath package.

Separately, I'd recommend using \biggl\langle and \biggr\rangle instead of \langle and \rangle in the second equation. (Using \left and \right would generate "fences" that are clearly too large.) Furthermore, you should probably encase the text phrases s.t. (short for "such that", right?) and and in \text constructs, in order to typeset them in upright text mode. Finally, in the code below, I make use of \! (negative thinspace) directives to tighten up the layout in a couple of places.

enter image description here

\documentclass{article}
\usepackage{amsmath} % provides the \substack macro
\begin{document}
\[
N_i (\rho) = \sum _{\substack {B \in \rho \text{ s.t.} \\ 
      n_{\delta_{\!j}}(B) = 0 \\
      \forall j \neq i}} 
n_{\delta_i} (B)
\]

\[
\sum _{\substack{ \rho \text{ s.t.}\\ 
      N_i(\rho) = a_i \\
      \text{and }M_i(\rho) = b_i} }
\prod _{B \in \rho} 
\biggl\langle 
   \prod_{i=1}^{n} \delta_i ^{n_{\delta_i}(B)} 
   y_i ^{n_{y_i}(B)} 
\biggr\rangle_{\!c}
\]
\end{document}

If you wanted to tighten up the appearance of the first equation still further, you could load the mathtools package and encase the subscript of the summation symbol in a \mathclap macro, as is shown in Herbert's answer. Your second equation, in contrast, does not appear to lend itself to such tightening.


Addendum to address the OP's follow-up questions:

  • The \[ and \] items are LaTeX (not Plain-TeX) commands to start and end a display-style equation. The Plain-TeX method for starting and ending a display-math equation is $$. (As you must know, the $ symbol serves to initiate and terminate inline-math expressions.) When using LaTeX, it's very much preferred to use \[...\] rather than $$...$$.

    For more information on the differences between $$ and \[...\], please see Why is \[ ... \] preferable to $$? For more information on the various ways display-style equations can be set up in Plain-TeX and LaTeX see, e.g., this answer to the question, What are the differences between $$, \[, align, equation and displaymath?

  • I don't see why using the revtex4 document class rather than the article document class should pose any issues.

  • The control sequence \! introduces a "negative thinspace", shifting the subsequent material ever so slightly to the left (backwards). I wanted to move the "c" subscript of the right angle-brace very slightly to the left, so that it wouldn't risk looking forlorn and out of place. The effect is subtle but -- I'd argue -- worth undertaking.

    Compare the look of the following three forms of the final part of your second equation. The expression on the left uses \biggr\rangle_c, the one in the middle uses \biggr\rangle_{\!c}, and the one on the right uses \biggr\rangle_{\!\!c}, i.e., it shifts the "c" subscript twice to the left. In my (naturally subjective!) opinion, I'd say that the expression in the middle looks best. :-)

enter image description here

share|improve this answer
    
Thanks! Why did you put those $[$ and $]$ at the beginning and end of the equations? –  user6818 Mar 19 '13 at 21:30
    
Also I am using $\documentclass[prl, 10pt]{revtex4}$. Is that an issue? I am not getting the lines to come directly below the $\sum$ (as you got) but its to its right (thought it is stacking). –  user6818 Mar 19 '13 at 21:34
    
And why did you change the $_c$ to $_{\!c}$ Whats the difference? –  user6818 Mar 19 '13 at 21:38
    
@user6818 - Thanks for these follow-up questions. I'll address them in an addendum to my answer. –  Mico Mar 19 '13 at 21:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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