>
with DocumentTools :
>
with DocumentTools :- Components :
>
with DocumentTools :- Layout :
Executing the MathContainer command produces a function call.
>
S ≔ MathContainer e , identity = MathContainer0
S ≔ _XML_EC-MathContainer id = 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.
>
xml ≔ Worksheet Group Input Textfield S :
That XML representation of a worksheet can be inserted directly.
>
InsertContent xml :
>
S ≔ MathContainer sqrt y , identity = MathContainer0 , autofit :
>
xml ≔ Worksheet Group Input Textfield S :
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.
>
lookup ≔ InsertContent xml , output = table
lookup ≔ table MathContainer0 = MathContainer1
(3)
>
GetProperty lookup MathContainer0 , expression
The fillcolor can be specified to match that of a parent Table Cell.
>
exprs ≔ FunctionAdvisor sin , identities , quiet
exprs ≔ sin arcsin z = z , sin z = − sin − z , sin z = 2 sin z 2 cos z 2 , sin z = 1 csc z , sin z = 2 tan z 2 1 + tan z 2 2 , sin z = − I 2 ⅇ I z − ⅇ −I z , sin z 2 = 1 − cos z 2 , sin z 2 = 1 2 − cos 2 z 2
(6)
>
S ≔ seq MathContainer identity = cat MathContainer , i , autofit , showborders = false , fillcolor = #ddeeff , i = 1 .. numelems exprs : xml ≔ Worksheet Table alignment = center , width = 300 , widthmode = pixels , Column , seq Row Cell Textfield s , fillcolor = #ddeeff , s = S :
>
cmptab ≔ InsertContent xml , output = table : for i to numelems exprs do SetProperty cmptab cat MathContainer , i , expression , eval exprs , 1 i end do :