2
$\begingroup$

I could not find any especial typesetting for mixed fractions in Pallets.

In text cell, when I put fraction $\frac{1}{2}$ and after put $5%$ in front of it it automatically becomes $5 * \frac{1}{2}$.

How do I make Mathematica display $5\frac{1}{2}$ in text cell?

$\endgroup$
3
  • $\begingroup$ possible duplicate Q/A: Mixed fraction input $\endgroup$
    – kglr
    Commented Nov 17, 2023 at 20:42
  • 1
    $\begingroup$ @kglr No. My question is about mixed numbers in the text cell. The question in your link is about input cell. $\endgroup$
    – vasili111
    Commented Nov 17, 2023 at 21:11
  • 1
    $\begingroup$ vasili111, if you replace DisplayFunction -> ... in Carl's answer with DisplayFunction -> (RowBox[{#1, "\[ImplicitPlus]", FractionBox[#2, #3]}] &) you can also use the alias "mf" in text cells and input cells. $\endgroup$
    – kglr
    Commented Nov 17, 2023 at 21:25

1 Answer 1

4
$\begingroup$
Row[{5, 1/2}]

$$5\frac{1}{2}$$

Using \[ImplicitPlus\] to write it in text cell press 5, press esc, press +, press esc, press 1, press Ctrl together with /, press 2:

5esc+esc1ctrl+/2

$\endgroup$
7
  • $\begingroup$ Thank you. Your answer is not working in the text cell. I need to write mixed fraction in the text cell. $\endgroup$
    – vasili111
    Commented Nov 17, 2023 at 21:13
  • $\begingroup$ @vasili111: I added how to do it. $\endgroup$ Commented Nov 17, 2023 at 21:26
  • $\begingroup$ Thank you. That works. Solved. $\endgroup$
    – vasili111
    Commented Nov 17, 2023 at 21:30
  • $\begingroup$ It seems second variant also works in Input cell. What for is this shortcut ESC + ESC? What it instructs to do to Mathematica? $\endgroup$
    – vasili111
    Commented Nov 17, 2023 at 21:52
  • $\begingroup$ @vasili111: reference.wolfram.com/legacy/language/v13/ref/character/… $\endgroup$ Commented Nov 17, 2023 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.