Math Container Component - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Components : Math Container Component

DocumentTools[Components]

  

MathContainer

  

generate XML for a MathContainer Component

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

MathContainer( expr, opts )

Parameters

expr

-

(optional) algebraic; an expression.

opts

-

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

Options

• 

autofit : truefalse:=false; Indicates whether the component will automatically resize to fit its contents. The default value is false.

• 

attribute string :=; Specifies the value of an attribute that can be seen only in the component properties.  This may be useful for storing non-visible state.

• 

editable truefalse :=true; Specifies whether the math expression can be edited, or if it should be display-only.

• 

fillcolor : {list(nonnegint),symbol,string}:=[255,255,255] ; Specifies the background color of the component. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.

• 

height  posint:=200; The height in pixels of the component. The default value is 200.

• 

width  posint:=300; The width in pixels of the component. The default value is 300.

• 

minheight  nonnegint:=0; The minimum height in pixels of the component when autofit = true. The default value is 0.

• 

minwidth  nonnegint:=0; The minimum width in pixels of the component when autofit = true. The default value is 0.

• 

identity : {name,string}; The reference name of the component.

• 

scrolldown  truefalse:=false; Specifies whether the component will automatically scroll down when its contents are set, when autofit = false. The default value is false.

• 

showborders : truefalse:=true; Indicates whether the components borders will be shown. The default value is true.

• 

value : string ; MathML representation of the content expression. This option can only be used if no expression argument expr is passed.

• 

visible : truefalse; Indicates whether the component is visible. The default is true.

Description

• 

The MathContainer command in the Component Constructors package returns an XML function call which represents a MathContainer Component.

• 

The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

withDocumentTools:

withDocumentTools:-Components:

withDocumentTools:-Layout:

esqrtx

ex

(1)

Executing the MathContainer command produces a function call.

SMathContainere,identity=MathContainer0

S_XML_EC-MathContainerid=MathContainer0,pixel-width=300,pixel-height=200,dag=LUkmbXNxcnRHNiQlKnByb3RlY3RlZEcvJSttb2R1bGVuYW1lR0ksVHlwZXNldHRpbmdHNiRGJSUoX3N5c2xpYkc2Iy1JI21pRzYkRiUvRidGKDYjUSJ4NiI=,visible=true,show-border=true,scroll-down=false,autofit=false,minimum-pixel-width=0,minimum-pixel-height=0,fillcolor=[255,255,255]

(2)

By using commands from the DocumentTools:-Layout package a nested function call can be produced which represents a worksheet.

xmlWorksheetGroupInputTextfieldS:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

SMathContainersqrty,identity=MathContainer0,autofit:

xmlWorksheetGroupInputTextfieldS:

The previous example's call to the InsertContent command inserted a component with identity "MathContainer0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "MathContainer0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.

The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.

lookupInsertContentxml,output=table

lookuptableMathContainer0=MathContainer1

(3)

lookupMathContainer0

MathContainer1

(4)

GetPropertylookupMathContainer0,expression

y

(5)

The fillcolor can be specified to match that of a parent Table Cell.

exprsFunctionAdvisorsin,identities,quiet

exprssinarcsinz=z,sinz=sinz,sinz=2sinz2cosz2,sinz=1cscz,sinz=2tanz21+tanz22,sinz=I2ⅇIzⅇ−Iz,sinz2=1cosz2,sinz2=12cos2z2

(6)

SseqMathContaineridentity=catMathContainer,i,autofit,showborders=false,fillcolor=#ddeeff,i=1..numelemsexprs:xmlWorksheetTablealignment=center,width=300,widthmode=pixels,Column,seqRowCellTextfields,fillcolor=#ddeeff,s=S:

cmptabInsertContentxml,output=table:foritonumelemsexprsdoSetPropertycmptabcatMathContainer,i,expression,evalexprs,1ienddo:

Compatibility

• 

The DocumentTools:-Components:-MathContainer command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

• 

The fillcolor, width, minheight and minwidth options were introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

• 

The DocumentTools:-Components:-MathContainer command was updated in Maple 2020.

• 

The scrolldown option was introduced in Maple 2020.

• 

For more information on Maple 2020 changes, see Updates in Maple 2020.

• 

The attribute and editable options were introduced in Maple 2024.

• 

For more information on Maple 2024 changes, see Updates in Maple 2024.

See Also

Component Code

Component Constructors

DocumentTools

Embedded Components

XMLTools

 

 


Download Help Document