# : is set to \colon, but the spacing is still wrong

This question explains how to make : behave as \colon. Except that the solution in the most upvoted answer doesn't work 100%. That solution says to make : behave in such a way, one has to use the command \DeclareMathSymbol{:}{\mathpunct}{operators}{"3A}.

With that command it looks like this (how it looks for \colon was added as an optical reference):

So one can see, that the :, although it should look like \colon actually has the spacing a bit different. Question 1: Is there a way to fix this ?

For completeness, this is how it looks, when the above command is disabled, and : is displayed as it normally would:

Question 2: Does activating this option change in any way the spacing of : when it is not used in math mode?

In a minimal document there is no difference:

\documentclass{article}

\usepackage{amssymb}
\DeclareMathSymbol{:}{\mathpunct}{operators}{"3A}

\begin{document}

$$f\colon \mathbb R \to \mathbb R$$

$$f: \mathbb R \to \mathbb R$$

\end{document}


However if you load amsmath then the difference you describe does occur:

\documentclass{article}

\usepackage{amssymb,amsmath}
\DeclareMathSymbol{:}{\mathpunct}{operators}{"3A}

\begin{document}

$$f\colon \mathbb R \to \mathbb R$$

$$f: \mathbb R \to \mathbb R$$

\end{document}


The reason is that the definition of \colon is changed in amsmath to

\renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
\mkern-\thinmuskip{:}\mskip6muplus1mu\relax}


giving greater spacing. Thus the simple redefinition of the other answer is not sufficient. You need to use the more complicated version provided by egreg there instead; his solution loads mathtools which loads amsmath.

As regards your second question: no, neither of the solutions to the other question affect colons outside of math mode.

• Thanks for your good explanation. Before I accept your answer, could you please also answer question 2 ? And could you please tell me, which version of : should be used when defining functions as above for most professional looking documents: The one where Carlisle's redefinition changes :, the one with \colon or the standard : ? Also, if you're interested, your answer generated a follow-up question, tex.stackexchange.com/questions/264401/…, which pertains to :=, as egregs answer also has his rough corners. Sep 2 '15 at 15:51
• I would say the AMS (= American Mathematical Society) definition is the better one for spacing. Sep 2 '15 at 16:27
• So you mean the use of \colon (or a redefinition of : that looks like that) is best ? Could you please answer question 2 ? Sep 2 '15 at 16:30
• 1. Yes - the AMS use this for professional typesseting of their journals. 2. Done. Sep 2 '15 at 16:42