DocumentTools[Layout] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Layout : DocumentTools/Layout/Equation

DocumentTools[Layout]

  

Equation

  

generate XML for an Equation element

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Equation( expr, opts )

Parameters

expr

-

(optional) ; an expression, or sequence of expressions

opts

-

(optional) ; one or more keyword options as described below

Options

• 

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.

Description

• 

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.

Examples

withDocumentTools:

withDocumentTools:-Layout:

Executing the Equation command produces a function call.

EEquationsqrtxπ

E_XML_Equationexecutable=false,style=2D Output,display=LUkmbWZyYWNHNiQlKnByb3RlY3RlZEcvJSttb2R1bGVuYW1lR0ksVHlwZXNldHRpbmdHNiRGJSUoX3N5c2xpYkc2JC1JJm1zcXJ0RzYkRiUvRidGKDYjLUkjbWlHNiRGJS9GJ0YoNiNRIng2Ii1GMjYjUSUmcGk7Rjc=,KiYlInhHIyIiIiIiIyUjUGlHISIi

(1)

By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.

xmlWorksheetGroupInputTextfieldE:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

xπ

The Equation constructor can accept multiple arguments, and handle them as an expression sequence.

EEquationsqrtxπ,Γx,Sumfi,i=1..n:InsertContentWorksheetGroupInputTextfieldE:

xπ,Γx,i=1nfi

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.

E1Equationsumi,i=1..n,style=TwoDimInput:E2Equationfactorsumi,i=1..n,style=TwoDimInput,typesetting=extended:TTextfieldThe sum of the first n positive integers ,E1, is equal to ,E2,alignment=left:InsertContentWorksheetGroupInputT:

The sum of the first n positive integers i=1ni is equal to nn+12

The next examples illustrate using 2-D Math for both input and output.

EinEquationBesselJ0,x+factorsumi,i=1..n,style=TwoDimInput,executable=true:EoutEquationBesselJ0,x+factorsumi,i=1..n,style=TwoDimOutput,typesetting=standard:TinTextfieldEin,alignment=left,prompt=> ,style=MapleInput:ToutTextfieldEout:InsertContentWorksheetGroupInputTin,OutputTout:

BesselJ0,x+factori=1ni

BesselJ0,x+12nn+1

(2)

Note the effect of the typesetting option.

EoutEquationBesselJ0,x+factorsumi,i=1..n,style=TwoDimOutput,typesetting=extended:ToutTextfieldEout:InsertContentWorksheetGroupInputTin,OutputTout:

BesselJ0,x+factori=1ni

BesselJ0,x+nn+12

(3)

The options typesetbold, typesetcolor, typesetitalic, and typesetsize are used in the next example to override the default styles for 2D Math input and output.

EinEquationBesselJ0,x+factorsumi,i=1..n,style=TwoDimInput,executable=true,typesetting=extended,typesetbold=true:EoutEquationBesselJ0,x+factorsumi,i=1..n,style=TwoDimOutput,typesetting=extended,typesetsize=18,typesetcolor=black,typesetitalic=false:TinTextfieldEin,alignment=left,prompt=> ,style=MapleInput:ToutTextfieldEout:InsertContentWorksheetGroupInputTin,OutputTout:

BesselJ0,x+factori=1ni

BesselJ0,x+nn+12

(4)

Compatibility

• 

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