0

This is a MathJax question.

In this answer, Davide Cervone provides a solution to make dobule brackets auto-sizeable (when used with \left and \right), but as a result, \coloneq becomes a text rather than a symbol. I am trying to figure out why and how to fix it. Can you help? The output should have both the brackets and the := symbol, but this is what we have instead:

test

<script src="file:\\[MY_PATH]\MathJax-master\tex-chtml.js" id="MathJax-script" async></script>
<script>
 window.MathJax=
 { startup:
 { ready()
 { MathJax.startup.defaultReady();
 const{Token}=MathJax._.input.tex.Token;
 const{MapHandler}=MathJax._.input.tex.MapHandler;
 const delimiter=MapHandler.getMap('delimiter');
 delimiter.add('\\llbracket',new Token('\\llbracket','\u27E6'));
 delimiter.add('\\rrbracket',new Token('\\rrbracket','\u27E7'));
 }
 },
 tex:
 { inlineMath:
 [ ['$','$'],
 ['\\(','\\)']
 ],
 packages:
 { '[+]':['mathtools']
 }
 },
 loader:
 { load: [ '[tex]/centernot']
 }
 };
</script>
<br><br>\(\left\llbracket\dfrac{a}{b}\coloneq\dfrac{c}{d}\right\rrbracket\)
<br><br>\(a\coloneq{}b\)

Setup specs:

  • Windows 10
  • Firefox 142.0.1 (32-bit)
  • window.MathJax.version: 4.0.0

As a sidenote, one of the MathJax scripts generates an error, but it seems to be an unrelated issue and doesn't interfere with the output (as far as I can tell): TypeError: NetworkError when attempting to fetch resource. speech-worker.js:1:411404 TypeError: can't convert undefined to object: "...for(let r,o=0;r=Object.keys(t)[o];o++){...}..."

asked Sep 16, 2025 at 2:28

1 Answer 1

1

The configuration you give doesn't load the mathtools extension where \coloneq is defined. Instead, it loads centernot, which is not included in your tex.packages configuration. If you add '[tex]/mathtools' to your loader.load array, it works for me. Try it here:

<script>
 window.MathJax=
 { startup:
 { ready()
 { MathJax.startup.defaultReady();
 const{Token}=MathJax._.input.tex.Token;
 const{MapHandler}=MathJax._.input.tex.MapHandler;
 const delimiter=MapHandler.getMap('delimiter');
 delimiter.add('\\llbracket',new Token('\\llbracket','\u27E6'));
 delimiter.add('\\rrbracket',new Token('\\rrbracket','\u27E7'));
 }
 },
 tex:
 { inlineMath:
 [ ['$','$'],
 ['\\(','\\)']
 ],
 packages:
 { '[+]':['mathtools']
 }
 },
 loader:
 { load: ['[tex]/mathtools']
 }
 };
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js" async></script>
<br><br>\(\left\llbracket\dfrac{a}{b}\coloneq\dfrac{c}{d}\right\rrbracket\)
<br><br>\(a\coloneq{}b\)

Note that the configuration should come before loading the MathJax component you are using, so it is in place when MathJax loads. I have changed the URL to the jsdelivr.net CDN, since we don't have access to your local disk, and I removed the unneeded centernot load.

Note that your graphic does not correspond to your description. Commenting out the startup block in the code you give does not produce the result in your graphic:

<script src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js" async></script>
<script>
 window.MathJax=
 { /*startup:
 { ready()
 { MathJax.startup.defaultReady();
 const{Token}=MathJax._.input.tex.Token;
 const{MapHandler}=MathJax._.input.tex.MapHandler;
 const delimiter=MapHandler.getMap('delimiter');
 delimiter.add('\\llbracket',new Token('\\llbracket','\u27E6'));
 delimiter.add('\\rrbracket',new Token('\\rrbracket','\u27E7'));
 }
 },*/
 tex:
 { inlineMath:
 [ ['$','$'],
 ['\\(','\\)']
 ],
 packages:
 { '[+]':['mathtools']
 }
 },
 loader:
 { load: [ '[tex]/centernot']
 }
 };
</script>
<br><br>\(\left\llbracket\dfrac{a}{b}\coloneq\dfrac{c}{d}\right\rrbracket\)
<br><br>\(a\coloneq{}b\)

This is due to the same problem with the mathtools package not being loaded. The fact that \colopneq is not defined has nothing to do with the startup block.

answered Sep 16, 2025 at 14:48
Sign up to request clarification or add additional context in comments.

8 Comments

I really appreciate you responding. As for the "centernot", it was supposed to be "mathtools", that's what I have in my config file: when editing out "centernot" due to it's irrelevance to the topic, I accidentally removed "mathtools" instead. So everything is still as I described. As for the configuration being necessarily loaded before the MathJax, correct me if I'm wrong, but the "async" property implies the order doesn't matter (and the fact that swapping the order didn't help in my case is, I would say, a proof of this).
As for the access to my disk: I simply specified "tex-chtml.js" from the official source folder as the source of the script. The most important thing is that copying and pasting your code left everything unchanged, so everything is still as described earlier (unfortunately).
Actually, I stand corrected: running your code renders \coloneq as text in both cases now, not just when double bracket solution ("startup" property) is active, which is even worse than before.
I should apologize, after reviewing everything thoroughly, your code does work. I wonder why the remote script works, but my local one doesn't. Just a sec.
To my great surprise, I can't reproduce the issue I had before. At least I am glad that everything works now.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.