# MathJax command for \coloneqq

Previously, I used $:=$ when defining notation. Until I discovered the preferred $\coloneqq$ or $\colonequals$ command.

This command doesn't work on math.stackexchange. I presume because MathJax doesn't support it.

What would be a good alternative for use on the math.stackexchange website?

• If you can find a Unicode character which looks like that, you could use it. But I only find &#x2254; which looks like this in Math Mode $:=$. (I am not sure whether it is any improvement compared to $\colon=$ $\colon=$.) You could also have this command or some similar commands are defined in the packages they come with. If the same syntax works in MathJax, you could perhaps create your own macro. (Although you would have to add it at the beginning of every post where you want to use it.) – Martin Sleziak Jan 14 '17 at 11:04
• I have seen that answer; it covers LaTeX, not MathJax. Point being: it doesn't work on the math.stackexchange website. – Mussé Redi Jan 14 '17 at 11:10
• I have linked to that answer because it mentions which packages those commands come from and also some other possible definitions. So if you want to try to define your own macro to use on this site, knowing how the \coloneq macro (and some other similar macros) are defined might be helpful. (Of course, it is possible - or even likely - that the same macro will not work in MathJax.) – Martin Sleziak Jan 14 '17 at 11:15
• Hmm, ok. In the best case scenario, this feature could be included in the next version of MathJax right? So that it can be used with a single command, as oppose to having to define the same macro instance when you need it in a post. So it would be constructive to make a feature request to the MathJax developers? – Mussé Redi Jan 14 '17 at 11:21
• BTW is \coloneq a typo and you meant \coloneqq from mathtools package? – Martin Sleziak Jan 16 '17 at 4:22
• Yes, indeed, I meant \coloneqq from the mathtools package. I've added an edit. – Mussé Redi Jan 16 '17 at 7:42

This is somewhere half-way between an answer and a long comment, but since I did not want to continue a long discussion with many comments, I have decided to post this as an answer.

I hope that somebody with better knowledge of MathJax, LaTeX (and perhaps Unicode), will post a better answer.

One possibility I can think of is using Unicode.

If you can find a Unicode character which looks like that, you could use it. But I only find &#x2254; which looks like this in Math Mode $≔$. (I am not sure whether it is any improvement compared to $\colon=$ $\colon=$ or $:=$ $:=$.)

Other possibility is to look how it is done in LaTeX and test whether you can make some similar macro in MathJax. (Notice that in MathJax you can use \newcommand.) Of course, not every macro which works in LaTeX will also work in MathJax and another obvious disadvantage is that you would have to add the macro to every post where you want to use it.

Anyway this TeX.SE post mentions several ways how this symbol could by typeset in LaTeX: How to typeset $:=$ correctly?

Since you explicitly mentioned \coloneq I checked how this is defined in mathtools package:

\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
\providecommand\ordinarycolon{:}
...
\providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}


My attempt to replicate this in MathJax looks as follows:
\newcommand{\coloneqqb}{\mathrel{\mathop:}\mathrel{\mkern-1.2mu}=}

Perhaps a reasonable thing to try is also to simply include the "naive solutions" into \mathrel.
\newcommand{\coloneqqc}{\mathrel{:=}}
\newcommand{\coloneqqd}{\mathrel{\colon=}}
\newcommand{\coloneqqe}{\mathrel{≔}}

And this is Davide Cervone's suggestions from a comment:
\newcommand{\coloneqqf}{\mathrel{\vcenter{:}}=}


I am sure there are many other possibilities worth trying if you want to try this way (by creating your own macro).

• I would say that \coloneq still looks notably better then the solutions provided here. How would we go about adjusting the vertical height of the equal sign downwards, for a fraction, in either \coloneqqa, \coloneqqb or \coloneqqc? – Mussé Redi Jan 14 '17 at 11:57
• @MusséRedi I do not know how something like that can be done in LaTeX (and, by extension, I do not know about a solution in MathJax). You can try to wait whether somebody more qualified answers or you can try by yourself to find some LaTeX solution and then whether it works in MathJax. – Martin Sleziak Jan 14 '17 at 12:06
• Would you call this case, development material for the next version of MathJax? I mean, even if a macro solution is found, this would be beneficial to be part of the core, wouldn't it: \coloneq can be said to me "missing" in MathJax, or wouldn't you phrase it like that? – Mussé Redi Jan 14 '17 at 12:10
• @MusséRedi That is probably more of a question for MathJax developers. (And some of them visit this meta occasionally, so there is some chance that you will get some response from one of them.) – Martin Sleziak Jan 14 '17 at 12:11
• Perhaps \mathrel{\vcenter{:}}= is what you are looking for. – Davide Cervone Jan 15 '17 at 22:09