# Spacing rules for operatorname

When does extra space get inserted by \operatorname? In the example below it appears extra spacing is inserted in the second and third case, but not the first. Why?

\documentclass{report}
\usepackage{amsmath}
\begin{document}
$\operatorname{T}\{a,b\}$
$\operatorname{T}X$
$\operatorname{T}\big\{a,b\big\}$
\end{document}

• Last one should be \bigl\{a,b\bigr\}. – Manuel Feb 1 '15 at 11:04

\operatorname makes the command use the \mathop primitive to get operator spacing like \log.
TeX assigns a "class" to every atom in a math list and then adds space of various sizes between atoms of different classes. A mathop followed by an ordinary character gets a thin space but a mathop followed by a math-open (like ( ) does not. This is so that \log x gets a thin space separating the operator from the argument which is not needed in \log(x).
• There is a thin space in the last example because \big\{ builds an ordinary symbol and not an opening. – egreg Feb 1 '15 at 11:11
• @egreg, is it a bug? \big\{ should be opening, shouldn't? – Sigur Feb 1 '15 at 11:15
• @Sigur no it's a documented feature, that is why there is a \bigl command. – David Carlisle Feb 1 '15 at 11:16
• @Sigur \bigl\{ does \mathopen{\big\{} and \bigr\} does \mathclose{\big\}}. There's also \bigm, where \bigm| does \mathrel{\big|}. Economy is the only reason for the existence of \big, which should never be used. – egreg Feb 1 '15 at 11:20