Input - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


DocumentTools[Layout]

  

Input

  

generate XML for an Input element

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Input( t )

Parameters

t

-

The result from the Textfield constructor, or a sequence of such results

Description

• 

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.

Examples

> 

with⁡DocumentTools:

> 

with⁡DocumentTools:-Layout:

Executing the Input command produces a function call.

> 

Inp≔Input⁡Textfield⁡Some text.

Inp≔_XML_Input⁡_XML_Text-field⁡alignment=centred,style=Text,layout=Normal,Some text.

(1)

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.

> 

InsertContent⁡xml:

Some text.

Text can also surround inlined typeset 2D Math expressions.

> 

E1≔Equation⁡sum⁡i,i=1..n,style=TwoDimInput:E2≔Equation⁡factor⁡sum⁡i,i=1..n,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⁡sum⁡i2,i=1..n,style=TwoDimInput,executable=true:Eout≔Equation⁡factor⁡sum⁡i2,i=1..n,style=TwoDimOutput:Tin≔Textfield⁡Ein,alignment=left,prompt=> ,style=MapleInput:Tout≔Textfield⁡Eout:InsertContent⁡Worksheet⁡Group⁡Input⁡Tin,Output⁡Tout:

> 

factor⁡∑i=1n⁡i2

n⁢n+1⁢2⁢n+16

(2)

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.

> 

sin⁡x

Compatibility

• 

The DocumentTools:-Layout:-Input 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

Textfield

XMLTools