2
$\begingroup$

Mixed fractions have too much space, which they don't in other $\TeX$ systems; for instance, 1\frac12 produces $1\frac12$, with the fraction too far away from the integer part.

$\endgroup$
3
  • 1
    $\begingroup$ A workaround is \!\frac{1}{2}: $1\frac12$ vs. $1\!\frac12$. Or even two negative spaces: $1\!\!\frac12$. You can define it as \def\mixedfrac#1#2{\!\frac{#1}{#2}} or even \def\mixedfrac#1#2#3{#1\!\frac{#2}{#3}} $\endgroup$ Mar 7 '12 at 21:57
  • 3
    $\begingroup$ I'm wondering if it might be better (or, at least, complementary), to raise this issue with the MathJax community instead. $\endgroup$
    – cardinal
    Mar 8 '12 at 0:06
  • 1
    $\begingroup$ I think this has been mentioned before. Generally, spacing is all messed up in MathJax. I often have to force spacing using \: or \! etc. What's even more irritating is that the behavior changes between versions, e.g. the recent upgrade seriously messed up many of my carefully formatted posts. $\endgroup$ Mar 8 '12 at 3:15
9
$\begingroup$

Don't use Arturo's workaround. As Bill Dubuque said, version changes in MathJax can easily make your $\frac12$ end up sitting on top of the $1$. Instead, put the \frac in braces or \mathord

This is what $1\frac12$ looks like: $1\frac12$.

This is what $1{\frac12}$ looks like: $1{\frac12}$.

And this is what $1\mathord{\frac12}$ looks like: $1\mathord{\frac12}$.

By placing the expression inside braces or using \mathord, you are preventing the extra space (due to the way MathJax is being slightly less sophisticated about handling fractions: outside of mixed fractions the spacing is generally preferred) from being inserted. This way even if MathJax were to be updated to reflect the usual logic that "fractions after a numeral is to be interpreted as mixed fractions without the customary extra space" your expression won't break.

For example:

This is $1\!{\frac12}$: $1\!{\frac12}$

And this is with two negative spaces: $1\!\!{\frac12}$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .