views:

50

answers:

3

How do i define, that formula should not be computed, but rather displayed in Traditional format. Here are 2 examples, where 1'st one is displayed like I want it, but 2'nd 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]
+2  A: 

Use HoldForm to print an expression without evaluating it.

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

If I undestand you correctly -- you don't want Limit[c, x -> a] to be evaluated. Standart way to stop something from evaluation is to use "Hold".

  Print["7. ", Hold[Limit[c, x -> a]], "=", c]

But the result is not good:

  7. Hold[Limit[c, x -> a]] = c

The HoldForm command does the trick -- it holds evaluation but doesn't show up:

  Print["7. ", HoldForm[Limit[c, x -> a]], "=", c]
  7. Limit[c, x -> a] = c
Kostya
+3  A: 
Michael Pilat
Also good answer.
Margus