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

MakeBoxes

MakeBoxes
is the low-level function used in Mathematica sessions to convert expressions into boxes.
MakeBoxes[expr]
is the function to convert expr to StandardForm boxes.
  • You can give definitions for MakeBoxes to specify your own rules for how expressions should be converted to boxes. »
  • MakeBoxes is not automatically called on the results it generates. This means that explicit MakeBoxes calls must typically be inserted into definitions that are given.
  • If you change the output format for an expression by giving a definition for MakeBoxes, there is no guarantee that output you get will subsequently be able to be interpreted by Mathematica.
  • Definitions you give for MakeBoxes will override built-in Mathematica rules for generating output.
Box representation of a polynomial:
Box representation of a graphic:
A special function in StandardForm and TraditionalForm:
Box representation of a polynomial:
In[1]:=
Click for copyable input
Out[1]=
 
Box representation of a graphic:
In[1]:=
Click for copyable input
Out[1]=
 
A special function in StandardForm and TraditionalForm:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Integer, Rational, Real, and Complex numbers:
Arbitrary-precision Real and Complex numbers:
Special constants:
Characters and strings of characters:
Control characters for strings:
Box representations for various Power expressions:
Special typeset expressions:
Different list structures:
Inputs with subscripts, superscripts, etc.:
Define the formatting for a function:
MakeBoxes does not evaluate expr, while ToBoxes does:
Use MakeExpression to obtain the original expression in a held form:
MakeBoxes uses formatting rules added via Format:
Add formatting for bin:
New in 3