Today's Random Photos:
René van Bevern
view out of a train window


The left formula shown below is set using LaTeX without any special options. The wide limit under the sum operator gives the formula an inadequate spacing.

Sum with wide limits Sum with wide limits smashed

Instead of adding negative space manually, the right formula, has been set using the smashoperators macro from the mathtools package. It works as follows:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\[\smashoperator{\sum_{v\in V\setminus (S\cup X)}}|N(v)|\]
\end{document}

This gives a much nicer spacing. Using the optional parameters [l] or [r], one can choose which side of the operator to smash. The mathtools package gives a lot more options to tune formulas in LaTeX. In particular it can also center the colon in ":=" vertically using

\mathtoolsset{centercolon}

© 2010 René van Bevern. Last modified 2010-03-23.