 Output - Maple Help

DocumentTools[Layout]

 Output
 generate XML for an Output element Calling Sequence Output( t ) Parameters

 t - The result from the Textfield constructor Description

 • The Output command returns an XML function call which represents an output element of a Worksheet or Document.
 • 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.
 • The argument to the Output command is the result of a call to the Textfield constructor.
 • The result of the Output command is suitable as an argument to the Group command, in the sense that an Execution Group  of a worksheet can contain an output region.
 • An output region is preceded in an execution group by the an input region. This corresponds to the results of the Input and Output constructors being the arguments of the Group constructor. Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$

Executing the Output command produces a function call.

 > $\mathrm{Outp}≔\mathrm{Output}\left(\mathrm{Textfield}\left(\mathrm{Equation}\left(\mathrm{int}\left({x}^{2},x\right)\right)\right)\right)$
 {\mathrm{Outp}}{≔}{\mathrm{_XML_Output}}{}\left({\mathrm{_XML_Text-field}}{}\left({"alignment"}{=}{"centred"}{,}{"style"}{=}{"Text"}{,}{"layout"}{=}{"Normal"}{,}{\mathrm{_XML_Equation}}{}\left({"executable"}{=}{"false"}{,}{"style"}{=}{"2D Output"}{,}{"display"}{=}{"LUkmbWZyYWNHNiQlKnByb3RlY3RlZEcvJSttb2R1bGVuYW1lR0ksVHlwZXNldHRpbmdHNiRGJSUoX3N5c2xpYkc2JC1JJW1zdXBHNiRGJS9GJ0YoNiQtSSNtaUc2JEYlL0YnRig2I1EieDYiLUkjbW5HNiRGJS9GJ0YoNiNRIjNGN0Y4"}{,}{"LCQqJCUieEciIiQjIiIiRiU="}\right)\right)\right) (1)

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

 > \mathrm{Inp}≔\mathrm{Input}\left(\mathrm{Textfield}\left("int\left(x^2,x\right);",\mathrm{alignment}=\mathrm{left},\mathrm{prompt}=">",\mathrm{style}=\mathrm{MapleInput}\right)\right):$\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Inp},\mathrm{Outp}\right)\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$
 > $\mathrm{int}\left({x}^{2},x\right)$
 $\frac{{{x}}^{{3}}}{{3}}$ (2)

The next example illustrates using 2-D Math input with an executable statement, accompanied by the corresponding output.

 > $\mathrm{Ein}≔\mathrm{Equation}\left('\mathrm{factor}\left(\mathrm{sum}\left({i}^{2},i=1..n\right)\right)',\mathrm{style}=\mathrm{TwoDimInput},\mathrm{executable}=\mathrm{true}\right):$$\mathrm{Eout}≔\mathrm{Equation}\left(\mathrm{factor}\left(\mathrm{sum}\left({i}^{2},i=1..n\right)\right),\mathrm{style}=\mathrm{TwoDimOutput}\right):$\mathrm{Tin}≔\mathrm{Textfield}\left(\mathrm{Ein},\mathrm{alignment}=\mathrm{left},\mathrm{prompt}=">",\mathrm{style}=\mathrm{MapleInput}\right):$\mathrm{Tout}≔\mathrm{Textfield}\left(\mathrm{Eout}\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Tin}\right),\mathrm{Output}\left(\mathrm{Tout}\right)\right)\right)\right):$
 > $\mathrm{factor}\left(\sum _{i=1}^{n}{i}^{2}\right)$
 $\frac{{n}{}\left({n}{+}{1}\right){}\left({2}{}{n}{+}{1}\right)}{{6}}$ (3) Compatibility

 • The DocumentTools:-Layout:-Output command was introduced in Maple 2015.
 • For more information on Maple 2015 changes, see Updates in Maple 2015.