1

When \circ is used with math operators and letters inside align environment, the spacing around it is not correct in some cases.

Code:

\documentclass{article}

\usepackage{amsmath}

\DeclareMathOperator{\pr}{pr}

\begin{document}
  \begin{align*}
    \pr \circ f \\
    \pr &\circ f \\
    \\
    f \circ f \\
    f &\circ f \\
    \\
    \pr \circ \pr \\
    \pr &\circ \pr \\
    \\
    f \circ \pr \\
    f &\circ \pr
  \end{align*}
\end{document}

produces:

enter image description here

The last six lines of formulas look fine. But for the first two lines, the space between \circ and f is too small in the first line where \circ is not behind &; while in the second line where \circ is behind a &, the space is normal, just as the following lines.

Why do the spacings behave this way?

AaronS
  • 111
  • I think the topic has already been discussed. The & can only confuse the matter, but basically, if \pr is used in that context, then it's not a math operator. – egreg May 17 '17 at 06:04
  • @egreg Thanks for the link. So it's basically about symbol types. But the problem regarding align still confuses me. After further testing I find that, when I put \circ f in odd columns(which are right-aligned), there are no space between \circ and f, and if in the even columns(which are left-aligned), the space is normal. How does this happen? – AaronS May 17 '17 at 07:08
  • Even numbered columns effectively start with {}, which does as an ordinary symbol, but odd numbered columns don't end with {}. For instance, in some cases one needs = in odd numbered colums in align; in this case ={}& is required. – egreg May 17 '17 at 07:12
  • As suggested in https://tex.stackexchange.com/a/16699, I would recommend defining \newcommand{\pr}{\mathop{\mathrm{pr}}\mathopen{}\mathord{}}. – Watson Jan 08 '21 at 17:27

0 Answers0