5

What’s a good way to reduce the horizontal space around this big sigma? Ideally, I’d like to be able to tell LaTeX to always ignore the width of a subscript by default.

This example compiles with pdflatex:

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

[\text{Pr}[x\oplus e\in D_x,\wedge, T]\leq \sum_{\substack{x\in C, \ e\text{ satisfying }T \\text{ where }x\oplus e\in D_x}}\text{Pr}[\text{we pick }x\text{ and }e]]

\end{document}

And it generates this: an equation with a large amount of horizontal space around a summation sign with a wide subscript at the bottom

2 Answers2

6

Another possibility with the \smashoperator command, also defined by mathtools. I took the liberty to simplify a bit your code.

Unrelated: you don't have to load amsmath when you load mathtools, as the latter does it for you.

\documentclass{article}
\usepackage{mathtools}

\begin{document}

[ \Pr[x\oplus e\in D_x,\wedge, T] \leq \smashoperator{\sum_{\substack{x\in C, \ e\text{ satisfying }T \\text{ where }x\oplus e\in D_x}}}\Pr [\text{we pick }x\text{ and }e]]

\end{document}

enter image description here

Bernard
  • 271,350
  • Ah, thank you! Is that \Pr command loaded by mathtools or is it just available without loading any packages? – Sophie Weigle Jul 29 '21 at 21:41
  • Not sure. I suppose it's defined by (a recent version of) mathtools, because I first coded with \DeclareMathOperator{\Pr}{Pr} and the log file answered it was already defined. – Bernard Jul 29 '21 at 21:47
4

You can use the \mathclap command from the \mathtools package. If I compile this:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
  \[\text{Pr}[x\oplus e\in D_x\,\wedge\, T]\leq
    \sum_{\mathclap{\substack{x\in C, \\ e\text{ satisfying }T
          \\\text{ where }x\oplus e\in D_x}}}\text{Pr}[\text{we pick
    }x\text{ and }e]\]
\end{document}

I get this:

enter image description here