# What spacing around colon in function notation? [duplicate]

Is there some standard for which spacing is to be preferred in the f: X -> Y notation for a function?

Three possibilities:

$f \colon X \to Y$
\\
$f: X \to Y$
\\
$f \mathpunct{:} X \to Y$

The respective outputs are shown here:

• Personally, I use \colon. – Bernard Aug 2 '16 at 0:49

$f:A\to B$
$f\colon A\to B$