wolfram-mathematicatypesettingmathematical-typesetting

How to print out equations in Mathematica


How do I define that a formula should not be computed, but rather displayed in Traditional format? Here are 2 examples, where the first one is displayed like I want it, but the second one is simplified.

Print["5. ", Limit[f[x]/g[x], x -> a], "=", Limit[f[x], x -> a]/Limit[g[x], x -> a], ", where ", Limit[g[x], x -> a] != 0];
Print["7. ", Limit[c, x -> a], "=", c]

Solution

  • Use HoldForm to print an expression without evaluating it.

    Print["7. ", HoldForm[Limit[c, x -> a]], "=", c]
    (* /*        ^^^^^^^^                      */ *)