How do I make mathematica treat $5\frac{1}{2}$ as a mixed fraction rather than 5 times one-half?
I'm using typesetting keyboard shortcuts (if that's important)
Currently I'm using $(5 + \frac{1}{2})$ to achieve this.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityYou can add an input alias to do this. For example:
CurrentValue[EvaluationNotebook[], {InputAliases, "mf"}] = TemplateBox[
{"\[SelectionPlaceholder]","\[Placeholder]","\[Placeholder]"},
"MixedFraction",
DisplayFunction->(RowBox[{#1, FractionBox[#2,#3]}]&),
InterpretationFunction->(RowBox[{#1,"+", FractionBox[#2,#3]}]&)
];
Here is a short animation showing it in action:
\[ImplicitPlus]
can be entered as ESC+ESC:
5\[ImplicitPlus](1/2)
(* 11/2 *)
It works for entering in the Front End, but it is automatically converted to Plus
: