ToBoxes

ToBoxes[expr]

generates boxes corresponding to the printed form of expr in StandardForm.

ToBoxes[expr,form]

gives the boxes corresponding to output in the specified form.

Details

Examples

open allclose all

Basic Examples  (3)

Box representation of a polynomial:

Display boxes as formatted:

Box representation of a graphic:

A special function in StandardForm and TraditionalForm:

Scope  (8)

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.:

Special Output Forms  (2)

Some objects use a special output representation with interpretation:

Some objects use an elided output representation:

Properties & Relations  (5)

ToBoxes evaluates expr, while MakeBoxes does not:

Use ToExpression to interpret boxes:

Use DisplayForm to see how the boxes display:

Use formatting rules added through Format:

Add formatting for bin:

Use formatting rules added through MakeBoxes:

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

Text

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

CMS

Wolfram Language. 1996. "ToBoxes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ToBoxes.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_toboxes, author="Wolfram Research", title="{ToBoxes}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ToBoxes.html}", note=[Accessed: 25-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_toboxes, organization={Wolfram Research}, title={ToBoxes}, year={1996}, url={https://reference.wolfram.com/language/ref/ToBoxes.html}, note=[Accessed: 25-November-2024 ]}