1

How to tweak unicode-math so that u+003A colon behaves like AMS's \colon, and u+2236 like a relation symbol (potentially assuming amsmath is loaded)?

2

Change \colon to use U+2236 and make U+003A math active, defined to yield \colon.

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{etoolbox}

\ExplSyntaxOn
\AtBeginDocument
 {
  \char_set_active_eq:nN { `: } \colon
  \mathcode`:="8000
 }
\ExplSyntaxOff
\patchcmd{\colon}{:}{∶}{}{}% first is U+003A, second is U+2236

\begin{document}

$f:A\to B$ % U+003A

$f∶f$      % U+2236

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.