55

The spacing between the 3rd and 4th stars is non-existent. Anyone know what's up?

enter image description here

\documentclass[11pt]{article}

\usepackage{amsmath}

\begin{document}

\begin{gather*}
\star\star\star\star \\
\star\star\star\,\star \\
\star\star\star\star\star
\end{gather*}

\end{document}
3
  • 4
    \star is a \mathbin so looking for something to each side to give even spacing. Cf. just \star\star. Add {} after the final \star to get uniform wide spacing back. Commented May 30, 2017 at 6:30
  • 3
    Sorry I'm not familiar with the term, and googling didn't help elucidate anything either. What does being a mathbin have to do with 4 consecutive occurrences and the use of {}?
    – user217285
    Commented May 30, 2017 at 6:48
  • 5
    I am not sure, if you are asking about why does this happen, or how to deal with it. But you can wrap every \star into braces: {\star} Commented May 30, 2017 at 7:10

1 Answer 1

78

Math symbols have different classifications and \star like - is a classed as binary operator. TeX assigns different space between symbols of each type, but also binary operators if not appearing in "infix" position, essentially revert to being an ordinary operator \mathord rather than \mathbin).

The motivation here can be seen better with -

enter image description here

1-2 the - is spaced as an infix operator but when not used between two symbols it reverts to closer spacing for -2.

When you have one or two - they are ordinary symbols with no space, but if you have three then the middle one acquires its natural mathbin spacing. Then the fourth, being between the third (which is a mathord) and the end of the math list, is again mathord so gets no space.

enter image description here

\documentclass{article}

\begin{document}

[$1-2$]

[$-2$]

[$-$]

[$--$]

[$---$]

[$----$]

[${}----{}$]

[${-}{-}{-}{-}$]

\end{document}

The final two lines show two ways of getting even space, with \mathbin or \mathord spacing.

2
  • 1
    +1 for the ability of turn TeX mysteries as plain as the nose in your face.
    – Fran
    Commented May 31, 2017 at 6:22
  • It was your the answer :-) +1.
    – Sebastiano
    Commented Feb 8, 2023 at 12:39

You must log in to answer this question.

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