6

I have the following code:

\documentclass{article} \usepackage{mathtools} \begin{document} \[S_1 = \frac{1}{2} \left(\sum_{\mathclap{i = n + 1}}^{n + m} a_i t_i \right)\] \end{document} 

And it produces this output:

Code output

As you can see, the bracket partially covers the lower sum limit. How can I avoid this?

2
  • 3
    mathclap stands for "centered overlap" so you are explicitly specifying the width of the subscript should be ignored and it should overlap surrounding text. Don't use \mathclap if you don't want that. Commented Nov 9 at 12:22
  • 1
    also \left makes an over-sized ( here if you used \bigl( the ( wouldn't be interfering with the subscript Commented Nov 9 at 12:27

3 Answers 3

7

If you don't use \mathclap you can add negative space to close up the summand, but the problem is made worse occurs as \left makes over-size delimiters, there is no need to make the delimiters cover the limits here,

enter image description here

\documentclass{article} \usepackage{mathtools} \begin{document} \[S_1 = \frac{1}{2} \left(\;\sum_{\mathclap{i = n + 1}}^{n + m} a_i t_i \right)\] \[S_1 = \frac{1}{2} \left(\sum_{i = n + 1}^{n + m}\! a_i t_i \right)\] \[S_1 = \frac{1}{2} \Bigl(\,\sum_{\mathclap{i = n + 1}}^{n + m} a_i t_i \Bigr)\] \end{document} 
4
  • 1
    The reason why "there is no need to make the delimiters cover the limits here" is somewhat a convention? Commented Nov 9 at 12:41
  • 3
    @Explorer sure there are no rules here. But egreg got half a million of his points for telling people not to use left-right (and the other half a million by saying they had forgotten a %) Commented Nov 9 at 13:28
  • Yes, but maybe I read too little high-qualtity formula typesetting, I don't think \left(\right) in this specific case is "oversized", I might try with \Biggl( and \Biggr). Commented Nov 9 at 14:12
  • 2
    @Explorer think of it like this: we want to avoid the fences taking focus. One can argue left/right aren't that bad here. But then imagine the upper limit weren't there.. Commented Nov 9 at 18:46
6

That's expected, because \mathclap makes a zero width box, so TeX cannot “see” the width of those limits.

I wouldn't use \left and \right, which produce too big delimiters in this case, but \biggl and \biggr, with a little adjustment.

Here I present a few realizations.

  • (1) is clearly wrong;
  • (2) is also wrong because of the too large size and the unwanted space between the fraction and the parenthesis;
  • (3) is better as regards to size and spacing, but the parenthesis clashes with the subscript;
  • (4) fixes the clash;
  • (5) fixes the excess space between the summation and the terms to sum;
  • (6) does the same as (5), but the backing up is too much, in my opinion.

Take your pick. Remember that automation and fine typography don't go along well.

\documentclass{article} \usepackage{mathtools} \begin{document} \begin{alignat}{2} S_1 &= \frac{1}{2} \left(\sum_{\mathclap{i = n + 1}}^{n + m} a_i t_i \right) &\qquad& \text{your attempt} \\ S_1 &= \frac{1}{2} \left(\sum_{i = n + 1}^{n + m} a_i t_i \right) &\qquad& \text{without \texttt{\string\mathclap}} \\ S_1 &= \frac{1}{2} \biggl(\sum_{i = n + 1}^{n + m} a_i t_i \biggr) && \text{with \texttt{\string\bigg}} \\ S_1 &= \frac{1}{2} \biggl(\,\sum_{i = n + 1}^{n + m} a_i t_i \biggr) && \text{with the needed correction} \\ S_1 &= \frac{1}{2} \biggl(\,\sum_{i = n + 1}^{n + m} \hspace{-0.33em} a_i t_i \biggr) && \text{with some back space} \\ S_1 &= \frac{1}{2} \biggl(\,\smashoperator[r]{\sum_{i = n + 1}^{n + m}} a_i t_i \biggr) && \text{with \texttt{\string\smashoperator}} \end{alignat} \end{document} 

output

5

You may want \smashoperator also provided by mathtools?

\documentclass{article} \usepackage{mathtools} \begin{document} \[S_1 = \frac{1}{2} \left(\sum_{i = n + 1}^{n + m} a_i t_i \right)\] \[S_1 = \frac{1}{2} \left(\sum_{\mathclap{i = n + 1}}^{n + m} a_i t_i \right)\] \[S_1 = \frac{1}{2} \left(\smashoperator[r]{\sum_{i = n + 1}^{n + m}} a_i t_i \right)\] \end{document} 

result

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.