Format

Format[expr]

prints as the formatted form of expr. Assigning values to Format[expr] defines print forms for expressions.

Format[expr,form]

gives a format for the specified form of output.

Details

  • Standard forms for formatted output are:
  • CFormC language input form
    FortranFormFortran input form
    InputFormonedimensional form suitable for direct keyboard input
    MathMLFormMathML form
    OutputFormcharacterbased 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 the Wolfram Language will be able to interpret this output format if it is used as input.
  • Definitions given for Format are used before those given for MakeBoxes.

Examples

open allclose all

Basic Examples  (1)

See an expression formatted in TraditionalForm:

In[1]:=
Click for copyable input
Out[1]=

Scope  (3)

Properties & Relations  (1)

See Also

ToString  ToBoxes  MakeBoxes  MakeExpression  FormatType  Interpretation

Tutorials

Introduced in 1988
(1.0)
| Updated in 2003
(5.0)