[NTG-context] Math literal colon

Hans Aberg haberg-1 at telia.com
Mon Jul 20 18:09:28 CEST 2015


> On 20 Jul 2015, at 17:50, Manuel Blanco <manuelbl at ucm.es> wrote:
> 
> A little bit more of intelligence can be given with
> 
>    \begingroup\lccode`\~=`\:\lowercase{\endgroup
>      \unexpanded\def~}{\futurelet\tmptoken\docolon}
>    \unexpanded\def\docolon{\ifx=\tmptoken\mathrel{\mathop{\mathchar`\:}}\else\colon\fi}
>    \mathcode`\:="8000 %
> 
> That lets you do $f: A \to B$ and $f(x) := x^2$

For the second, one can use ≔ COLON EQUALS U+2254. But it is a good point, though.




More information about the ntg-context mailing list