[Tex/LaTex] Adding horizontal space between fraction in mathjax latex code


Here is the equation written in mathjax

$$y=\frac{1 eV x^2}{2 md v^2}y$$

but it renders like this
enter image description here

but i want to show like this

enter image description here

i know one idea like this


is there anyway i could write using only \frac one time? It would be better isn't it than writing \frac theree times and this may be just be example 🙂

thank you .

Best Answer

TeX and MathJax are not clairvoyant. If you tell them to typeset one fraction, they happily comply. But one fraction will have just one fraction line.

Your formula should be typeset as three separated fractions:

\frac{1}{2} \frac{eV}{md} \frac{x^{2}}{v^{2}}

or, maybe better,

\frac{1}{2} \, \frac{eV}{md} \, \frac{x^{2}}{v^{2}}

(spaces are optional, but make for good reading).

enter image description here

This is a MathJax rendering of the same:

enter image description here

but remember this is browser and machine dependent.

Using {1\over 2} is deprecated in LaTeX, so, unless you use Plain TeX for your documents, it's better to use \frac also in MathJax. There would be no advantage with it, because \over makes just one fraction line, just like \frac.

Related Question