DocumentTools/Canvas/Script/Highlight - Maple Help

DocumentTools[Canvas][Script]

 Highlight
 highlight all or part of a math canvas element
 HighlightOff
 remove highlights from all or part of a math canvas element

 Calling Sequence Highlight(script,ex,options) HighlightOff(script,ex,options)

Parameters

 script - DocumentTools:-Canvas:-Script object ex - (optional) a subexpression of the active math expression id - (optional) id=string; id of a particular marked subexpression

Description

 • The Highlight command adds a background color to highlight all or part of the math in the active canvas element.
 • The HighlightOff command removes the highlights added by a previous call to Highlight.
 • A "canvas" is an interactive section of a Maple document created by the NewCanvas command, or a shared web-based Maple Learn document.   See the Script command for a more complete description.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Canvas}\right):$
 > $\mathrm{cv}≔\mathrm{NewCanvas}\left(\left["Einstein"\right]\right):$
 > $\mathrm{ShowCanvas}\left(\mathrm{cv}\right)$
 > $\mathrm{sc}≔\mathrm{Script}\left(\right):$
 > $\mathrm{SetActive}\left(\mathrm{sc},"0:0"\right)$
 > $\mathrm{SetMath}\left(\mathrm{sc},E=m{c}^{2},'\mathrm{where}'="below"\right)$
 > $\mathrm{Highlight}\left(\mathrm{sc},c\right)$
 > $\mathrm{Annotate}\left(\mathrm{sc},"the speed of light"\right)$
 > $\mathrm{HighlightOff}\left(\mathrm{sc}\right)$
 > $\mathrm{Highlight}\left(\mathrm{sc},m\right)$
 > $\mathrm{Annotate}\left(\mathrm{sc},"mass"\right)$
 > $\mathrm{HighlightOff}\left(\mathrm{sc}\right)$
 > $\mathrm{Highlight}\left(\mathrm{sc},E\right)$
 > $\mathrm{Annotate}\left(\mathrm{sc},"energy"\right)$
 > $\mathrm{HighlightOff}\left(\mathrm{sc}\right)$
 > $\mathrm{Annotate}\left(\mathrm{sc},""\right)$

recreate the whole example with all of the script steps attached so that it can be played back in Maple Learn

 > $\mathrm{cv2}≔\mathrm{NewCanvas}\left(\left["Einstein"\right],\mathrm{sc}\right):$
 > $\mathrm{ShareCanvas}\left(\mathrm{cv2}\right)$

Compatibility

 • The DocumentTools[Canvas][Script][Highlight] and DocumentTools[Canvas][Script][HighlightOff] commands were introduced in Maple 2021.