Text - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


DocumentTools[Canvas]

  

Text

  

create a text structure with metadata

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Text(caption)

Text(caption, options)

Text(format, arguments, options)

Parameters

caption

-

string

format

-

string containing "%1"

arguments

-

anything

Description

• 

The Text command is used by GetMath when extracting math and text from a canvas.  It packages a text expression up into a record where it can be saved alongside other information relevant to the context of the canvas application, such as the id, position, and annotation.

• 

It can be useful to use the Text command when constructing a canvas that will later be deployed to Maple Learn.

• 

The Text command supports mixed text and math notation.  When given a first argument format string that contains the % character followed by a number, n, the text will display the nth argument in place of %n.  

• 

The Text command supports the following style options:

  

bold = true;  when true, make the text bold

  

color = string or ColorTools:-Color;  set the color of the text

  

fontsize = posint; control the size of the font

  

sans = true;  use a sans-serif font

  

container = "group" or "textbox";  Maple Learn has two kinds of boxes that can contain text: a textbox or a group.  Use this option to indicate which kind of box the text should be added to.

  

custom = string;  use this option to give a custom name to this text area, which can be used by GetElements to locate this item later.

  

position = [x,y];  use this option to specify a pixel-position for the top left corner of the text

Examples

withDocumentTools:-Canvas:

cvNewCanvasText Example,TextMix text and %1,sqrtx21y,TextSum %1 and %2,a2,b2,TextThe %1,_BOLDPythagorean Theorem,Matha2+b2=c2:

ShowCanvascv

Text records are returned from GetMath

urlhttps://learn.maplesoft.com/?d=OULPGFDHIFNKDLJJGGMKJKNOARBJLHGRPOOKHKCQHPMFKMOTBFEHCUBUCQFNOGKSAMDOCUEFGMAJMQELFLEQEGOMETNULHFSCUGU:

cvGetCanvasurl:

MGetMathcv,keeptext:

M1:-text

M1:-id

M1:-position

Compatibility

• 

The DocumentTools[Canvas][Text] command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

• 

The DocumentTools[Canvas][Text] command was updated in Maple 2022.

See Also

Annotate

GetCanvas

Math

NewCanvas

Script

ShareCanvas