2

Is there some way to increase the horizontal space around \circ when it is in script style? For example, the label over the arrows in a commutative diagram is often put in script style, and left almost no extra space around \circ:

enter image description here

This usually won't be a big problem, but in some cases the labels look quite ugly (for example, the vertical labels in the following diagram):

enter image description here

I wonder if there is some way to have the normal thin space around \circ as in text or display mode?

Below is a MWE to play with.

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
    \bullet & \bullet
    \arrow["a \circ a",from=1-1, to=1-2]
\end{tikzcd}

\( a \circ a \)

\( \scriptstyle a \circ a \)

\end{document}
2

1 Answer 1

1

I'm not sure you can coerce tikz-cd to apply this to all labels, but it works with the explicit command.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}

\newcommand{\cdl}[1]{\text{$\medmuskip=0.6\medmuskip#1$}}

\begin{document}

\begin{tikzcd}
\bullet \arrow[r,"\cdl{a\circ a}"] & \bullet \\
\bullet \arrow[r,"a\circ a"] & \bullet
\end{tikzcd}

\end{document}

enter image description here

I reduced \medmuskip because the standard value seems too large in this case.

Why does this work? Because \text appears in \scriptstyle, so it uses \sf@size inside it, but math is in text style.

I believe that in LuaTeX you can change the behavior that in script style no space around binary operation symbols is added.

2
  • That looks okay, but what about the (non-centered) \circ in the labels on the vertical arrows in the question? Jun 12, 2022 at 0:24
  • @barbarabeeton That’s done with the same method
    – egreg
    Jun 12, 2022 at 10:47

You must log in to answer this question.

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