InterpretationFunction

InterpretationFunction

is an option for TemplateBox that specifies how the box is to be evaluated.

Details

  • InterpretationFunction takes a function that produces a box expression.
  • TemplateBox parameters are substituted into the function to create the box expression that is sent to the kernel when the box is evaluated.
  • The function must be specified as a simple pure function that does not require further evaluation to resolve.

Examples

open allclose all

Basic Examples  (1)

Make a TemplateBox that displays with a frame but evaluates as the contents of the frame:

Properties & Relations  (1)

A cell with TextClipboardType"InputText" will copy the interpretation to an external text editor:

Here is the pasted form:

fowl

With TextClipboardType"PlainText", the display will be copied instead:

Here is the pasted form:

fish

Possible Issues  (1)

The function must produce a valid box expression after substitution of its arguments:

Functions that require evaluation may not produce a valid result:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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