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?
MWE:
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\begin{document}
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} \]
\end{document}
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}
.\mathchoice
command?\tpmod
defined like\newcommand{\tpmod}[1]{\mkern 8mu({\operator@font mod}\mkern 6mu#1)}