generate XML for an Input element
Input( t )
The result from the Textfield constructor, or a sequence of such results
The Input command returns an XML function call which represents an Input 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 Input command is the result of a call to the Textfield constructor.
The result of the Input command is suitable as an argument to the Group command, in the sense that an Execution Group of a worksheet can contain an input region.
An input region, represented here by the result of a call to the Input command, can be used in two key ways. One way consists of containing a Textfield comprising paragraphs of text, plots, or tables. Another way consists of containing a Textfield comprising executable statements, and this can be accompanied in an execution group by the result of the Output constructor.
Executing the Input command produces a function call.
Inp ≔ Input⁡Textfield⁡Some text.
By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.
xml ≔ Worksheet⁡Group⁡Inp:
That XML representation of a worksheet can be inserted directly.
Text can also surround inlined typeset 2D Math expressions.
E1 ≔ Equation⁡'∑i=1ni',style=TwoDimInput:E2 ≔ Equation⁡factor⁡∑i=1ni,style=TwoDimInput: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
A Textfield within an input region can also contain objects such as a plot or a table constructed respectively by the InlinePlot or Table constructors.
P ≔ InlinePlot⁡plot⁡sin⁡xx,height=200:Inp ≔ Input⁡Textfield⁡P:InsertContent⁡Worksheet⁡Group⁡Inp:
The next example illustrates using 2-D Math input with an executable statement, accompanied by the corresponding output.
Ein ≔ Equation⁡'factor⁡∑i=1ni2',style=TwoDimInput,executable=true:Eout ≔ Equation⁡factor⁡∑i=1ni2,style=TwoDimOutput:Tin ≔ Textfield⁡Ein,alignment=left,prompt=> ,style=MapleInput:Tout ≔ Textfield⁡Eout:InsertContent⁡Worksheet⁡Group⁡Input⁡Tin,Output⁡Tout:
The next example uses multiple lines of input, which can be a mix of text and math.
T1 ≔ Textfield⁡alignment=left,This is a first line of text.:T2 ≔ Textfield⁡alignment=left,This is a second line of text.:T3 ≔ Textfield⁡alignment=left,prompt=> ,style=MapleInput,sin(x);:InsertContent⁡Worksheet⁡Group⁡Input⁡T1,T2,T3:
This is a first line of text.
This is a second line of text.
The DocumentTools:-Layout:-Input command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
Download Help Document
What kind of issue would you like to report? (Optional)