Mathjax fractions and dollar signs incompatible, fraction display also off

StackOverflow https://stackoverflow.com/questions/21897290

  •  13-10-2022
  •  | 
  •  

Question

I am trying to render dollar signs in Mathjax in a fraction. I am able to use dollar signs elsewhere in Mathjax, by wrapping them in a $, but in the fraction - which I believe does not like any html- it will not work with the trick, so I do not use it there - they do not display. 2 of them render as a blank space- so Mathjax interpreted it as an expression and did not display, but any odd number ie 1, 3, 5 will display as gibberish. Seems like an uncompleted expression - ie one dollar sign but no end dollar sign, so it gets confused. Any solutions anyone? I have tried everything- escaping it, etc, etc.

I also am using a custom font, and when it displays ,it has the numerator and denominators a tad bit too far up and down from the fraction bar. Anyone know of any way to tighten this?

Thanks!

Était-ce utile?

La solution

Try $\frac{\$100.00}{\$10.00}$, which is the usual TeX approach to handling dollar signs within an expression. If that doesn't work for you, then you will have to give more details about the situation where you are using MathJax (such as your MathJax configuration block, and whether you are using a content-management system to enter your text, etc.).

As for the font issue, you will need to give more details about what. MathJax is only designed to work with the fonts that is comes with, and it has the bounding box information only for those fonts. MathJax doesn't have the bounding box information for other fonts, so it will have to guess about that, and likely gets it wrong.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top