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

2 Answers 2

5

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

2
  • Thanks! Just what I needed.
    – wobtax
    Commented Jul 29, 2021 at 18:31
  • I'm glad I could help. Commented Jul 29, 2021 at 18:33
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

2
  • Ah, thank you! Is that \Pr command loaded by mathtools or is it just available without loading any packages?
    – wobtax
    Commented Jul 29, 2021 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
    Commented Jul 29, 2021 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .