Application Center - Maplesoft

App Preview:

You can switch back to the summary page by clicking here.

? Maplesoft, a division of Waterloo Maple Inc., 2009

Introduction

To create a custom task template, you first create all of the content that you would like to be included in your task template. Once created, you can give content optional markers to make your task template more robust. You then save your task template to a help database of your choosing. Once saved, you have the option to share your task template with others.

In this Tips and Techniques, we give a brief overview on using task templates, and then explain how to create your own custom templates and save them into a Maple help database so they can be re-used and shared.

To use task templates, you simply browse to the desired template and insert it into your document. You can then fill out the required fields and execute it as you would any other content in your Maple document.

Step

Result

Select Tools > Task > Browse...

You will now see a list of task templates in the left pane of the Browse Tasks window. You can expand folders and click on any task to preview it. The preview displays in the right pane of the window.

Select Curve Fitting > B?zier Curves. You will see a preview of this task template in the right window.

Select Insert Default Content.

(Selecting Insert Minimal Content will insert the task template without non-essential content such as titles, descriptions, and other template embellishments.)

The task template will be inserted into your document after your cursor. You can then use and modify the task template just as you would any content in your Maple document. If there were any placeholders, you would first add your own content into these placeholders. This task template, however, has opted for embedded components to simplify the inputting and execution of mathematics.

Generate B?zier Curves

A B?zier curve is a polynomial determined by a set of points in such a way that it interpolates the first and last points, but has its shape determined by the remaining points.  This task allows you to interactively define the points and view the curve.

 B?zier Curves Use the slider to select , the degree of the B?zier curve.     n =     Press to initialize/clear the plot window.   Click to insert control points  Make sure that the pointer is , execute code.   Drag control points to modify the B?zier curve.   Below, find the B?zier curve

To create a task template, you start with a blank document, just as you normally would in Maple. You then create content for your task template, using tables, embedded components, text and math.  For the purposes of this Tips and Techniques, a simple task template has already been constructed to demonstrate the different features of custom task templates.

Example: Transfer Function and Bode Plot

The custom task template shown here takes a function and displays its corresponding transfer function and Bode plot.

 Figure 2: This is what our task template looks like when it is being created with the option View > Task Elements enabled. The highlighted content has been marked to have special features when inserted into your document - see the section below on Placeholders, Optional, and Non-Insert content.

Previously Assigned Variables

It is possible that a task template will use variable names that are already assigned in the worksheet into which it is being inserted. For that reason, it is important that all parameter and variable names in custom task templates are enclosed by double underscores. For our example, we enclose the variable as .  Enclosing these in double underscores prompts Maple to check and see if the variable name has been assigned earlier in the document. If it has, Maple will prompt you to enter a new name for the variable that will be inserted.

 Figure 2: When you insert a task template with a variable name that is already in use, you are prompted by Maple to enter a new name in the New Name   column - in this case, func2.

Tip: When editing variable names, you may find that typing an underscore [_] places your cursor in the subscript position when you actually wanted to type in the underscore symbol. You can instruct Maple to insert the underscore symbol itself by typing a forward slash [\] first, followed by an underscore.

Placeholders, Optional, and Non-Insert Content

When creating task templates, you may want to control which of your content is immediately visible when the template is inserted into a worksheet, and you may want to help guide a user through filling out your template. Maple provides some options to make this possible.

Placeholders

Placeholders are parameters which are meant to be replaced by the user once the task has been inserted into a worksheet. They typically include expressions, variables, and options. The text or math will appear in purple, rather than the default black font.

To mark content as a placeholder, highlight the content and select Format > Task Authoring > Mark As Placeholder. The color of the content will change to indicate that you have successfully marked it as a placeholder.

In our example above, we have set the variable as a placeholder.

Tip: When you set variables as placeholders, you can then tab through them just as if you were inserting an expression from the Expression Palette.

Optional Content

Optional content is content in your task template that is inserted only when the user inserts it by clicking on the Insert Default Content. Inserting a task template by clicking on Insert Minimal Content will not insert any optional content. This is useful if you only wish to insert the parts of the task template that are necessary for its functionality. Content such as titles, descriptions, and other embellishments are usually marked as optional.

To mark content as optional, highlight the content and select Format > Task Authoring > Mark As Optional.

In the example above, the optional content is highlighted blue.

Non-Insert Content

Non-insert content is content that only appears in the browsing section of the task templates library. This content will not be inserted into your worksheet regardless of the insertion method you choose. Content typically marked for non-insertion includes sections that would be included in help files, such as See Also sections, but there are no limits to what can be marked for non-insertion.

To mark content as non-insertion, highlight the content and select Format > Task Authoring > Mark As Non-Insert.

Non-insert content in our example above is highlighted red.

Tip: To view which of your content has been marked as placeholders, optional content, or non-insert content, go to View > Task Elements. Placeholders appear highlighted green, optional content appears highlighted blue, and non-insert content appears highlighted red.

When you are finished creating your task template, you must save it into a help database so that it can be used. To save the file into a help database, follow these steps: