TemplateWith

TemplateWith["name"value,expr]

represents an element of a template object that evaluates expr after replacing TemplateSlot["name"] with value.

TemplateWith[{"name1"value1,"name2"value2, },expr]

evaluates expr with a list of key-value pairs.

Details

  • TemplateWith allows you to define local constants inside a TemplateObject.
  • In an XMLTemplate, TemplateWith can be indicated using <wolfram:with var1="..." var2="...">...</wolfram:with>.

Examples

Basic Examples  (1)

Using TemplateSlot:

Binding multiple variables:

Hold evaluation with TemplateExpression:

Use TemplateWith to transform TemplateSlot data:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2023_templatewith, author="Wolfram Research", title="{TemplateWith}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TemplateWith.html}", note=[Accessed: 18-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_templatewith, organization={Wolfram Research}, title={TemplateWith}, year={2014}, url={https://reference.wolfram.com/language/ref/TemplateWith.html}, note=[Accessed: 18-April-2024 ]}