[Tex/LaTex] Why are \colon and \mathpunct{:} not equivalent?


According to this answer, \colon is of type \mathpunct. But in the MWE below, the outputs of the two lines are not identical. Why not?




    & g\colon X\to Y\\
    & g\mathpunct{:} X\to Y


enter image description here

Best Answer

  1. The \mathpunct{} (without : inside {}) is the definition of \colon. Link1
  2. Both : and \colon typeset a colon, but \colon is a punctuation symbol, while : is considered as a relation symbol as regards to spacing. Link2