cortex-js / cortexjs.io

Source for the cortexjs.io website
http://cortexjs.io/
48 stars 18 forks source link

frac{12} #42

Open primayanuaristya opened 12 months ago

primayanuaristya commented 12 months ago

Why if math field \frac{1}{2} return \frac12? If \sqrt{\frac{1}{2}} return \sqrt{\frac{12}}

primayanuaristya commented 12 months ago

Screenshot_2023-09-15-23-24-07-216_com android chrome

Only single numerator or denumerator

arnog commented 12 months ago

In LaTeX, some commands can have "single-token arguments", including \frac and \sqrt. This means that \frac12 is identical to \frac{1}{2} and \sqrt2 is identical to \sqrt{2}. Wether to use single-token variants or not is a style preference. The MathLive serializer uses the shorthand version when the numerator and denominator are both single digits.

primayanuaristya commented 12 months ago

In LaTeX, some commands can have "single-token arguments", including \frac and \sqrt. This means that \frac12 is identical to \frac{1}{2} and \sqrt2 is identical to \sqrt{2}. Wether to use single-token variants or not is a style preference. The MathLive serializer uses the shorthand version when the numerator and denominator are both single digits.

how make single with {} for example \sqrt{4} not \sqrt4 withouth regex?