DocumentTools[Layout]
Equation
generate XML for an Equation element
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Equation( expr, opts )
expr
-
(optional) ; an expression, or sequence of expressions
opts
(optional) ; one or more keyword options as described below
executable : truefalse:=false; Specifies whether the content should be executable.
style : identical(TwoDimInput,TwoDimOutput):=TwoDimOutput; Specifies the formatting style for the contents of the element.
typesetting : identical(standard,extended); Specifies the typesetting level. By default the current value returned by interface(typesetting) is used.
typesetbold : truefalse:=false; Specifies whether 2D Math is typeset in bold, if typesetting=extended. If this option is not specified or typesetting is not extended then the default style is used.
typesetcolor : {name,string}; Specifies a color for 2D Math, if typesetting=extended. If this option is not specified or typesetting is not extended then the default style is used.
typesetitalic : truefalse; When true 2D Math is typeset in italic, if typesetting=extended. When false 2D Math is typeset as upright, if typesetting=extended. If this option is not specified or typesetting is not extended then the default style is used.
typesetsize : posint; Specifies the font size for 2D Math, if typesetting=extended. If this option is not specified or typesetting is not extended then the default style is used.
The Equation command encodes expressions for 2D Math input or output storage within an Equation element of an XML representation of a worksheet.
An Equation element is returned as an XML function call.
The generated XML may be used with the results of additional commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.
with⁡DocumentTools:
with⁡DocumentTools:-Layout:
Executing the Equation command produces a function call.
E≔Equation⁡sqrt⁡xπ
E≔_XML_Equation⁡executable=false,style=2D Output,display=LUkmbWZyYWNHNiQlKnByb3RlY3RlZEcvJSttb2R1bGVuYW1lR0ksVHlwZXNldHRpbmdHNiRGJSUoX3N5c2xpYkc2JC1JJm1zcXJ0RzYkRiUvRidGKDYjLUkjbWlHNiRGJS9GJ0YoNiNRIng2Ii1GMjYjUSUmcGk7Rjc=,KiYlInhHIyIiIiIiIyUjUGlHISIi
By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.
xml≔Worksheet⁡Group⁡Input⁡Textfield⁡E:
That XML representation of a worksheet can be inserted directly.
InsertContent⁡xml:
xπ
The Equation constructor can accept multiple arguments, and handle them as an expression sequence.
E≔Equation⁡sqrt⁡xπ,Γ⁡x,Sum⁡f⁡i,i=1..n:InsertContent⁡Worksheet⁡Group⁡Input⁡Textfield⁡E:
xπ,Γ⁡x,∑i=1nf⁡i
The previous examples were formatted using the default value of the style option, which is 2D Math output. The following examples illustrate 2D Math input.
Inlined typeset 2D Math expressions can be surrounded by text.
E1≔Equation⁡sum⁡i,i=1..n,style=TwoDimInput:E2≔Equation⁡factor⁡sum⁡i,i=1..n,style=TwoDimInput,typesetting=extended:T≔Textfield⁡The sum of the first n positive integers ,E1, is equal to ,E2,alignment=left:InsertContent⁡Worksheet⁡Group⁡Input⁡T:
The sum of the first n positive integers ∑i=1n⁡i is equal to n⁢n+12
The next examples illustrate using 2-D Math for both input and output.
Ein≔Equation⁡BesselJ⁡0,x+factor⁡sum⁡i,i=1..n,style=TwoDimInput,executable=true:Eout≔Equation⁡BesselJ⁡0,x+factor⁡sum⁡i,i=1..n,style=TwoDimOutput,typesetting=standard:Tin≔Textfield⁡Ein,alignment=left,prompt=> ,style=MapleInput:Tout≔Textfield⁡Eout:InsertContent⁡Worksheet⁡Group⁡Input⁡Tin,Output⁡Tout:
BesselJ⁡0,x+factor⁡∑i=1n⁡i
BesselJ⁡0,x+12⁢n⁢n+1
Note the effect of the typesetting option.
Eout≔Equation⁡BesselJ⁡0,x+factor⁡sum⁡i,i=1..n,style=TwoDimOutput,typesetting=extended:Tout≔Textfield⁡Eout:InsertContent⁡Worksheet⁡Group⁡Input⁡Tin,Output⁡Tout:
BesselJ⁡0,x+n⁢n+12
The options typesetbold, typesetcolor, typesetitalic, and typesetsize are used in the next example to override the default styles for 2D Math input and output.
Ein≔Equation⁡BesselJ⁡0,x+factor⁡sum⁡i,i=1..n,style=TwoDimInput,executable=true,typesetting=extended,typesetbold=true:Eout≔Equation⁡BesselJ⁡0,x+factor⁡sum⁡i,i=1..n,style=TwoDimOutput,typesetting=extended,typesetsize=18,typesetcolor=black,typesetitalic=false:Tin≔Textfield⁡Ein,alignment=left,prompt=> ,style=MapleInput:Tout≔Textfield⁡Eout:InsertContent⁡Worksheet⁡Group⁡Input⁡Tin,Output⁡Tout:
The DocumentTools:-Layout:-Equation command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
See Also
Component Constructors
DocumentTools
InsertContent
Layout Constructors
XMLTools
Download Help Document