3

For external usage, I set output in MathMLForm by using $PrePrint=MathMLForm

Everything goes well but makes graphics rendered in MathMLForm as well. How could I make graphics rendered as image?

enter image description here


New added:

Thanks for @Kuba, But I am facing another problem when execute script like:

Table[Plot[f[x], {x, -2 Pi, 2 Pi}, Exclusions -> {1/f[x] == 0}], 
      {f, {Tan, Cot, Csc, Sec}}]

The final result is not a type of graphics, but it contains graphics. So it rendered in MathML finally.

enter image description here

Kuba
  • 136,707
  • 13
  • 279
  • 740
Michael
  • 491
  • 2
  • 9

1 Answers1

5

Edit:

$PrePrint =.;

$PrePrint = With[{expr = #}, 
                 If[MemberQ[expr, _Graphics | _Graphics3D | _Graph, {0, ∞}], 
                            expr, 
                            MathMLForm[expr]]] &;

Before edit:

$PrePrint =.;

$PrePrint = If[MatchQ[#, _Graphics | _Graphics3D | _Graph], #, MathMLForm[#]] &;

Is this what you are after?

Kuba
  • 136,707
  • 13
  • 279
  • 740