This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Format

Format[expr]
prints as the formatted form of expr. Assigning values to Format[expr] defines print forms for expressions.
Format
gives a format for the specified form of output.
  • Standard forms for formatted output are:
CFormC language input form
FortranFormFortran input form
InputFormone-dimensional form suitable for direct keyboard input
MathMLFormMathML form
OutputFormcharacter-based two-dimensional form
StandardFormstandard two-dimensional form
TeXFormTeX input form
TraditionalFormform approximating traditional mathematical notation
  • You can add your own forms for formatted output.
  • Format[s]:=rhs defines a symbol s to print like rhs.
  • Format[f[...]]:=rhs defines a function f to print like rhs.
  • If you specify a new output format for an expression by giving a definition for Format, there is no guarantee that Mathematica will be able to interpret this output format if it is used as input.
See an expression formatted in TraditionalForm:
See an expression formatted in TraditionalForm:
In[1]:=
Click for copyable input
Out[1]=
Format kappa as the Greek letter:
Format a function f differently if it has more than two arguments:
Define formatting for a specific form:
StandardForm output is unaffected:
MakeBoxes and ToBoxes use formatting rules added via Format:
Add formatting for bin:
New in 1 | Last modified in 5