Section - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

DocumentTools[Layout]

 Section
 generate XML for a Section element

 Calling Sequence Section( s, t, opt )

Parameters

 s - (optional) ; content of the Section t - (optional) ; the Title of the Section opt - (optional) ; the keyword options a described below

Options

 • collapsed : truefalse:=false ; Whether the section is initially collapsed.

Description

 • The Section command constructs a representation of a worksheet section.
 • A Section element is returned as an XML function call.
 • 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 result of calling the Title element constructor can be optionally supplied, and will be used as the title of the section. All other arguments except for the collapsed keyword option are used as the content of the section.

Examples

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

Executing the Section command produces a function call.

 > $S≔\mathrm{Section}\left(\right)$
 ${S}{≔}{\mathrm{_XML_Section}}{}\left({"collapsed"}{=}{"false"}\right)$ (1)

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

 > $\mathrm{xml}≔\mathrm{Worksheet}\left(S\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$
 > S≔\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading1},\mathrm{layout}=\mathrm{Heading1},\mathrm{alignment}=\mathrm{left},"Introduction"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some introductory text."\right)\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{InlinePlot}\left(\mathrm{plot}\left(\mathrm{sin}\right)\right)\right)\right)\right)\right):
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(S\right)\right):$
 Introduction Some introductory text.

Sections may be nested, as subsections. Sections may also be created initially collapsed.

 > S≔\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading1},\mathrm{layout}=\mathrm{Heading1},\mathrm{alignment}=\mathrm{left},"Plotting"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some introductory text."\right)\right)\right),\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading2},\mathrm{layout}=\mathrm{Heading2},\mathrm{alignment}=\mathrm{left},"2D plots"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some more text."\right)\right)\right),\mathrm{Section}\left(\mathrm{collapsed},\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading3},\mathrm{layout}=\mathrm{Heading3},\mathrm{alignment}=\mathrm{left},"2D animations"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some more text."\right)\right)\right)\right)\right),\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading2},\mathrm{layout}=\mathrm{Heading2},\mathrm{alignment}=\mathrm{left},"3D plots"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some more text."\right)\right)\right)\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(S\right)\right):$

Plotting

Some introductory text.

2D plots

Some more text.

 2D animations Some more text.
 3D plots Some more text.

A Section can be constructed within a Table.

 > S≔\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading2},\mathrm{layout}=\mathrm{Heading2},\mathrm{alignment}=\mathrm{left},"Description"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some text."\right)\right)\right),\mathrm{Section}\left(\mathrm{collapsed},\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading3},\mathrm{layout}=\mathrm{Heading3},\mathrm{alignment}=\mathrm{left},"Details"\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"Some more text."\right)\right)\right)\right)\right):T≔\mathrm{Table}\left(\mathrm{alignment}=\mathrm{center},\mathrm{interior}=\mathrm{none},\mathrm{width}=60.0,\mathrm{Row}\left(\mathrm{InlinePlot}\left(\mathrm{plot}\left(\frac{\mathrm{sin}\left(x\right)}{x}\right)\right),S\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

Description

Some text.

 Details Some more text.

2D Math or a Table can be put into the Title of a Section.

 > \mathrm{S1}≔\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading2},\mathrm{layout}=\mathrm{Heading2},\mathrm{alignment}=\mathrm{left},"Summation example:",\mathrm{Equation}\left(\mathrm{style}=\mathrm{TwoDimInput},'\sum _{i=1}^{N}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}f\left(x\right)'\right)\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"The body of the section."\right)\right)\right)\right):
 > \mathrm{S2}≔\mathrm{Section}\left(\mathrm{Title}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{Heading2},\mathrm{layout}=\mathrm{Heading2},\mathrm{alignment}=\mathrm{centered},\mathrm{Table}\left(\mathrm{width}=50,\mathrm{Row}\left("Some description",\mathrm{InlinePlot}\left(\mathrm{height}=200,\mathrm{plot}\left(\mathrm{sin}\left(x\right)\right)\right)\right)\right)\right)\right),\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{alignment}=\mathrm{left},"The body of the section."\right)\right)\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{S1},\mathrm{S2}\right)\right):$
 Summation example: $\sum _{i=1}^{N}f\left(x\right)$ The body of the section.

 Some description

The body of the section.

Compatibility

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

 See Also