DisableFormatting

DisableFormatting[expr]

is a form that disables the formatting of expr when it appears inside held expressions, but gives expr as soon as evaluation occurs.

Details

Examples

open allclose all

Basic Examples  (3)

Prevent an expression from formatting:

Release the hold to let it format:

Prevent an unevaluated expression from formatting:

Releasing the hold allows evaluation and, subsequently, formatting to occur:

DisableFormatting must appear inside held expression or it will evaluate away:

Scope  (3)

DisableFormatting works inside any function with held attributes like HoldAll:

HoldRest:

HoldFirst:

HoldAllComplete:

Disable the formatting in held expressions:

Evaluate held parts to restore the normal formatting:

DisableFormatting is invisible in StandardForm and TraditionalForm:

InputForm and FullForm show DisableFormatting:

Properties & Relations  (5)

Hold, HoldForm and other functions that hold their arguments prevent evaluation but not typesetting:

DisableFormatting inside of Hold prevents the unevaluated expression from typesetting:

However, DisableFormatting does not by itself hold its argument or prevent typesetting:

In a HoldFirst or HoldRest function, DisableFormatting only affects the held arguments:

Defer prevents an expression from evaluating but not typesetting:

If copied and pasted, that expression will then evaluate:

If using DisableFormatting along with Defer, the expression will neither evaluate nor typeset:

However, on copy and paste, it evaluates and therefore typesets normally:

Interpretation assigns an arbitrary appearance to an output expression:

If copied and pasted, normal interpretation and typesetting follow:

However, the original expression remains unevaluated:

With DisableFormatting, the normal evaluation and formatting is restored once the hold is released:

On the other hand, copy and paste will preserve the DisableFormatting wrapper:

Inactivate creates an expression that sometimes, but not always, avoids 2D typesetting:

The result is a different expression, where each head h has been replaced by Inactive[h]:

DisableFormatting always avoids 2D typesetting, and the input expression returns unchanged:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_disableformatting, organization={Wolfram Research}, title={DisableFormatting}, year={2016}, url={https://reference.wolfram.com/language/ref/DisableFormatting.html}, note=[Accessed: 21-November-2024 ]}