 Improved Subscript Handling - Maple Programming Help Improved Subscript Handling

 Changes to subscripts in Maple 17 Type Keystrokes Maple 17 Keystrokes Previous Releases Example Literal Subscript   2D representation: $\mathrm{a__b}$ $\mathrm{a__b}$     Expression Palette: $\mathrm{a__n}$ a _ _ b a  [Ctrl]+[Shift]+_  b $\mathrm{x__min}≔1:$  $\mathrm{x__max}+\mathrm{x__min}$ ${6}$  Table/Matrix/Vector reference   2D representation #1: $a\left[b\right]$ ${{a}}_{{b}}$ 2D representation #2: ${a}_{b}$ ${{a}}_{{b}}$   Expression palette: ${{a}}_{{n}}$ a [ b ] a [Ctrl]+[Shift]+_ b a [ b ] a _ b ${\mathrm{result}}_{2}≔13.7:$   $\mathrm{add}\left({\mathrm{result}}_{i},i=1..4\right)$ ${44.7}$ Variable containing an underscore character   2D representation:  $\mathrm{a_b}$ ${\mathrm{a_b}}$ a  _  b a \ _ b $\mathrm{a_b}≔1:$ $\mathrm{b_c}≔2:$  $\mathrm{a_b}+\mathrm{b_c}$ ${3}$

Details

With Maple 17, we've introduced some new tools and conventions to make it easier to work with the underscore character as well as literal subscripts.

Maple's mathematical typesetting supports two different meanings for subscripts. "Index" subscripts are the typeset representation of a reference to an element of an array or vector, in which the subscript represents the particular element being referred to. "Literal" subscripts are part of the variable name itself that are not interpreted as an index of any kind. Variables with literal subscripts are referred to as Atomic Variables.

Literal Subscripts

By convention, anything following a double-underscore now represents a literal subscript in a variable name.

 > $\mathrm{a__b}$
 $\mathrm{a__b}$ (1.1.1)

For example, a variable with the name a__b represented in Maple Input ("1-D") notation appears as 'a' with a subscript of 'b' in Standard Math ("2-D") notation, but the 'b' is not interpreted as an index of any kind. Previously, such a variable would have a 1-D representation of something like #msub(mi("a"),mi("b")).

By default, Maple will highlight atomic variables using a different color, making it easier to discriminate between index- and literal-style subscripts when examining a worksheet. The appearance is user-modifiable using Maple's style management tools or can be toggled on or off using the View - Atomic Variables menu item.

Working with the underscore character

We have also made it easier to enter names that contain the underscore character in 2-D mode. In previous versions of Maple, it was necessary to insert a backslash character before the underscore in order to make it appear in the expression. In Maple 17, you simply need to enter an underscore as you would in 1-D mode.

This change has made it necessary to update some of the keyboard shortcuts when using 2-D math:

 • To enter an underscore, simply type the underscore key on your keyboard
 > $\mathrm{a_b}$
 ${\mathrm{a_b}}$ (1.2.1)
 • To create an atomic subscript, type the base name followed by two underscores, followed by the subscript.  For example, 'a', '_', '_', 'b'.
 > $\mathrm{a__b}$
 $\mathrm{a__b}$ (1.2.2)
 • To create an indexed subscript, use the key sequence Ctrl-Shift-underscore (Command-Shift-underscore on Mac OS X) or surround the subscript with square brackets.
 > $a\left[b\right]$
 ${{a}}_{{b}}$ (1.2.3)
 Changing the default behaviour for entering the underscore character If you would like to change the default behaviour for underscore entry back to the way it was in previous Maple releases, follow the these steps.    1. Open the Tools Menu    2. Select Options...    3. Select the Interface tab    4. Choose the Inserts non-atomic subscript option from the drop down list next to Underscore Entry    5. Press the Apply Globally button.   Please note that if you revert this setting, in order to create an atomic variable you will need to either right click on your variable and manually convert to an Atomic Variable by going to 2-D Math - Convert To - Atomic Variable, or simply create an atomic variable by adding an atomic variable from the variables palette.