I'm having trouble displaying "△
ABC" using MathJax. I'm using AsciiMath input for simplicity, with back-tick delimiters, and it's working very well for the rest of the math I want to display, except for the triangle symbol.
When I use `triangleABC`, the input jax seems to get it right, but my output looks like this: △
ABC, with extra spacing between the triangle symbol and the ABC. When I look at the MathJax output that appears on my web page, I see the triangle symbol is being rendered as follows:
<span id="MJXc-Node-46" class="mjx-mo" style="padding-left: 0.333em; padding-right: 0.333em;">
<span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.415em; padding-bottom: 0.364em;">△</span>
</span>
I was able to change the style of mjx-mo nodes by adding a style sheet to my web page (thanks to this stackexchange page:
https://stackoverflow.com/questions/19413989/css-for-mathjax )
<style type="text/css">
.mjx-mo {
padding-right: 0px !important;
}
</style>
But this is no good, because it eliminates the right padding on a lot of other symbols. For instance, in
y =3
x +4 the spacing after the equal and plus signs is gone.
I spent quite a bit of time trying to find an easy way to post-process the MathJax output, figuring that I could use jQuery to find nodes that contain the triangle symbol and change their padding-right style. I couldn't find a simple example of how to do the post-processing, and I'm not expert enough in MathJax to figure it out without a lot of gnashing of teeth and pulling of hair. Besides, doing an entire post-processing step after MathJax runs seems like overkill.
My best strategy at the moment is to use a class (e.g., "rPad0") and specify this style:
<style type="text/css">
.rPad0 .mjx-mo {
padding-right: 0px !important;
}
</style>
and then to enclose every MathJax element that contains a triangle symbol in an element with class="rPad0". For instance, <span class="rPad0">`triangleABC`</span>
This seems rather cumbersome, and will cause problems if I ever need to use △
ABC in a MathJax expression that includes other operators.
Can anyone suggest a simpler solution?
PS. I know that I could use Delta: `DeltaABC`. But an upper-case Delta isn't really the same as a triangle symbol, and I'm too much of a stickler for good math notation to do this, except as a last resort.