If I'm in a displayed equation but I want the \sum symbol to appear as it does in inline formulas, I can just put \textstyle in my equation. I thought that writing \textstyle would also force \pmod to use the spacing it uses for inline formulas, but for some reason it won't work. Why is that, and how can I force \pmod to use the non-display style spacing when I'm in a displayed equation?




This is inline math: $ \sum {a\pmod b} $

This is display math: \[ \sum {a\pmod b} \]

This is display math with $\backslash$textstyle: \[ \textstyle \sum {a\pmod b} \]


enter image description here

  • 1
    The amsmath display environments set \if@display to true, but \textstyle has no influence over it, so you get the \mkern18mu nonetheless. You either want to modify the definition of \pod or to define a variant \tpmod command. By the way it should be \sum a\pmod{b}.
    – egreg
    Nov 29, 2015 at 22:56
  • @egreg okay, so you're suggesting I use a \mathchoice command?
    – justin
    Nov 29, 2015 at 23:01
  • 1
    Not at all; I suggest using \tpmod defined like \newcommand{\tpmod}[1]{\mkern 8mu({\operator@font mod}\mkern 6mu#1)}
    – egreg
    Nov 29, 2015 at 23:08
  • @egreg that looks like an answer:-) Jan 30, 2016 at 21:20

1 Answer 1


The amsmath package sets \if@display to true in displays; the primitive \textstyle has no influence over it. Since the standard definition of \pmod checks \if@display, you get the additional space nonetheless.

You have two strategies available. First strategy: redefine \pod (which \pmod depends on) so it doesn't add the space. This can be done with

\renewcommand{\pod}[1]{\allowbreak\mkern 8mu(#1)}

You should also change \mod to be consistent:

\renewcommand{\mod}[1]{\allowbreak\mkern 12mu{\operator@font mod}\,\,#1}

Second strategy. If you want to be able to choose between the standard spacing and the reduced one, define a new command

\newcommand{\tpmod}[1]{\mkern 8mu({\operator@font mod}\mkern 6mu#1)}

You must log in to answer this question.

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