DocumentTools[Layout]
Textfield
generate XML for a Textfield element
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Textfield( c, opts )
c
-
(optional) ; content for the element
opts
(optional) ; one or more keyword options as described below
alignment : identical(centered,right,left,none):=centered The horizontal alignment.
layout : identical(Normal,Maple,Heading1,Heading2,Heading3):=Normal; Specifies the layout description of the element.
prompt : string:=NULL The string used to represent the prompt, eg. for a line in an execution group.
style : identical(Text,MapleInput,TwoDimOutput,Heading1,Heading2,Heading3):=Text Specifies the formatting style for the contents of the element.
The Textfield command in the Layout Constructors package returns an XML function call which represents a Textfield element.
The generated XML may be used with the results of other 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.
with⁡DocumentTools:
with⁡DocumentTools:-Layout:
Executing the Textfield command produces a function call.
S≔Textfield⁡Some Text
S≔_XML_Text-field⁡alignment=centred,style=Text,layout=Normal,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⁡Input⁡S:
That XML representation of a worksheet can be inserted directly.
InsertContent⁡xml:
Some Text
The next example illustrates something other than text as content of the Textfield element.
S≔Textfield⁡alignment=left,InlinePlot⁡plot⁡sin:
InsertContent⁡Worksheet⁡Group⁡Input⁡S:
A Textfield can contain multiple objects.
p≔plot⁡sin⁡xx2:
im≔Array⁡1..40,1..9,1..3,i,j,k↦evalhf⁡irem⁡k,4⋅sin⁡jπsqrt⁡i,datatype=float8,order=C_order:
sep≔ :
T≔Textfield⁡Some text.,sep,InlinePlot⁡p,height=120,width=200,sep,Equation⁡sqrt⁡xπ,sep,Image⁡im,height=60,width=120:
InsertContent⁡Worksheet⁡Group⁡Input⁡T:
Some text. xπ
In each of the next three examples input and output regions are inserted within an execution group. The first example shows 1D Maple Notation input and 2D Math output. The second example shows 2D Math input and 2D Math output. The third example shows 1D Maple Notation input and 1D plaintext output.
Each of these three examples place the inserted execution group in a single cell in a table, simply for visual clarity.
Tin≔Textfield⁡prompt=> ,alignment=left,style=MapleInput,sprintf⁡%a;,sin⁡π:
Tout≔Textfield⁡style=TwoDimOutput,sprintf⁡%a,sin⁡π:
InsertContent⁡Worksheet⁡Table⁡Column⁡,Row⁡Cell⁡Group⁡Input⁡Tin,Output⁡Tout:
sin⁡π
0
Tin≔Textfield⁡prompt=> ,alignment=left,layout=Normal,style=MapleInput,Equation⁡executable=true,style=TwoDimInput,sqrt⁡4⁢x2:
Tout≔Textfield⁡style=TwoDimOutput,Equation⁡executable=true,style=TwoDimOutput,sqrt⁡4⁢x2:
4⁢x2
2⁢x2
Tout≔Textfield⁡alignment=none,layout=TextOutput,style=TextOutput,sprintf⁡ %a,sin⁡π:
The DocumentTools:-Layout:-Textfield 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
XMLTools
Download Help Document