MakeBoxes

MakeBoxes[expr,form]

is the lowlevel function used in Wolfram System sessions to convert expressions into boxes.

MakeBoxes[expr]

is the function to convert expr to StandardForm boxes.

Details

  • MakeBoxes does not evaluate expr.
  • form can be StandardForm, TraditionalForm, or any other format represented using boxes.
  • You can give definitions for MakeBoxes[expr,form] 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 the Wolfram Language.
  • Definitions you give for MakeBoxes will override builtin Wolfram Language rules for generating output.

Examples

open allclose all

Basic Examples  (3)

Box representation of a polynomial:

Box representation of a graphic:

A special function in StandardForm and TraditionalForm:

Scope  (6)

Basic Objects  (2)

Integer, Rational, Real, and Complex numbers:

Arbitrary-precision Real and Complex numbers:

Special constants:

Characters and strings of characters:

Control characters for strings:

Special Input Forms  (4)

Box representations for various Power expressions:

Special typeset expressions:

Different list structures:

Inputs with subscripts, superscripts, etc.:

Applications  (1)

Define the formatting for a function:

Properties & Relations  (3)

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:

Wolfram Research (1996), MakeBoxes, Wolfram Language function, https://reference.wolfram.com/language/ref/MakeBoxes.html (updated 2007).

Text

Wolfram Research (1996), MakeBoxes, Wolfram Language function, https://reference.wolfram.com/language/ref/MakeBoxes.html (updated 2007).

CMS

Wolfram Language. 1996. "MakeBoxes." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/MakeBoxes.html.

APA

Wolfram Language. (1996). MakeBoxes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MakeBoxes.html

BibTeX

@misc{reference.wolfram_2024_makeboxes, author="Wolfram Research", title="{MakeBoxes}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MakeBoxes.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_makeboxes, organization={Wolfram Research}, title={MakeBoxes}, year={2007}, url={https://reference.wolfram.com/language/ref/MakeBoxes.html}, note=[Accessed: 21-December-2024 ]}