webMathematica > Formatting >

MSPFormat

  • MSPFormat is the key function for formatting results from Mathematica.
  • The formatted result can appear in the different format types that Mathematica provides for output such as OutputForm, InputForm, StandardForm, TraditionalForm, and MathMLForm.
  • The result can be returned as HTML, an image format, or as MathML.
  • The second argument of MSPFormat is a symbol that selects the Mathematica format type, and the third argument is a string that sets the actual content type of the result.
  • The result is correctly escaped to be valid HTML that will work in a web page.
  • Note that the result must be displayed in a fixed-width font for correct alignment of multiline output.
  • An alternative way to format expressions into HTML is provided by the HTML functions.
In[1]:=
In[2]:=
Out[2]=
In[3]:=
Out[3]=
In[4]:=
Out[4]=
In[5]:=
Out[5]=
In[6]:=
In[7]:=
Out[7]=
In[8]:=
Out[8]=