cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Translate the entire conversation x

Using and editing superscipt's in math region variable names

RE_12882698
5-Regular Member

Using and editing superscipt's in math region variable names

A sample of a variable name containing a superscript and subscript in the math formatted region is provided in the attached Mathcad Prime 10 file. I would like to edit the superscript to make a new variable name. I can edit everything except the superscript. Please advise on how this can be done? Please see attached file for more information.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:RE_12882698)

Mathcad dos not support variable names with superscripts.

What looks like superscript "a" is a "normal" sized character from the font used.

You can create that character either by inserting it from the Windows App "charmap"

Werner_E_0-1744404201779.png

or, as its the character with ASCII code 170 (unicode U+00AA) you can use the keyboard shortcut "ALT 0170" with numbers from the numeric keypad.

The fonts usually do only contain superscript number and a couple of letters (not all!) and some other symbols like an superscript  underline, degree symbol, apostrophe, etc.

A superscript "a" can also be found as Unicode letter U+0363 but the letters there look more like coming from a sansserif font.

Werner_E_1-1744404727863.png

So the fazit is that you can use some superscript letters but its a bit cumbersome and you can't edit such a variable name the 'usual' way by simply typing from the keyboard.

 

View solution in original post

8 REPLIES 8

Hi,

Superscripts do not form part of the definition of variable names in Prime

From the help:

Variable and Function Names
Variable names, function names, unit names, constant names, etc, are generically referred to as identifiers.
Identifiers can contain any valid Unicode character from the Base Multilingual Plane (BMP) with the exception of white space and control characters, and with the additional limitation that the first character cannot be a decimal digit (0-9). Unicode BMP characters are defined as having a code in the range 0-65535.
The label associated with an identifier is considered part of its name when distinguishing it from another identifier. This makes it possible to define a new function mean with the Variable label, and still be able to refer to the built-in function mean by specifying the Function label. However, if you define a new function mean with the Function label, you will be hiding the built-in definition of that function.
Identifiers are case-sensitive, can be of any length, and may contain any combination of valid characters:
Letters—Uppercase and lowercase letters.
Digits—0 through 9, but not as the first character of a name. PTC Mathcad interprets leading digits in combination with letters as either an imaginary number (2i or 3j) or as a number times a variable (3x).
Dot—A single, punctuation character, period can be used any where; including as the first character.
Symbols:
Underscore _.
Any symbol listed on the Math tab, in the Operators and Symbols group, in the Symbols list. To enter a Greek character, type the Roman character followed by Ctrl+G. For pi, type p and then Ctrl+G.
Any constant listed on the Math tab, in the Operators and Symbols group, in the Constants list.
Other standard symbols. You can refer to the Windows Character Map dialog box for special symbol codes.
To access the MS Windows character map, click Start > Windows Accessories > Character Map.
Literal subscripts—Any combination of valid characters; including a number as first character.
A subscript may be placed anywhere in the identifier.
An identifier may contain multiple subscripts such as H2SO4.
Additional Information
Identifiers cannot contain symbols that have special meaning to PTC Mathcad, such as those listed under the Math tab, in the Operators and Symbols group, in the Operators list.
You can assign different labels to the same name. For example, you can enter the expression f(x) and label it as a function and then enter the expression f and label it as a variable.
Certain names are already used for built-in constants, variables, or functions. If you redefine these names, their built-in meanings no longer work after the redefinition. For example, if you define a function called mean, you override the functionality of the mean built-in function.
RE_12882698
5-Regular Member
(To:terryhendicott)

Thank you. I appreciate your response.

Werner_E
25-Diamond I
(To:RE_12882698)

Mathcad dos not support variable names with superscripts.

What looks like superscript "a" is a "normal" sized character from the font used.

You can create that character either by inserting it from the Windows App "charmap"

Werner_E_0-1744404201779.png

or, as its the character with ASCII code 170 (unicode U+00AA) you can use the keyboard shortcut "ALT 0170" with numbers from the numeric keypad.

The fonts usually do only contain superscript number and a couple of letters (not all!) and some other symbols like an superscript  underline, degree symbol, apostrophe, etc.

A superscript "a" can also be found as Unicode letter U+0363 but the letters there look more like coming from a sansserif font.

Werner_E_1-1744404727863.png

So the fazit is that you can use some superscript letters but its a bit cumbersome and you can't edit such a variable name the 'usual' way by simply typing from the keyboard.

 

RE_12882698
5-Regular Member
(To:Werner_E)

Thank you. I appreciate the explanation of how the "a" superscript was created in the sample in the Mathcad file. Very helpful.

Use Exponentiation Operator ^ 1. So any variable name with superscipt can use.

image.pngimage.png

image.pngimage.png       image.pngimage.png

image.pngimage.pngimage.pngimage.pngimage.png

Werner_E
25-Diamond I
(To:ttokoro)


@ttokoro wrote:

Use Exponentiation Operator ^ 1. So any variable name with superscipt can use.


...but only when you evaluate it or use it in a calculation, not when you want to assign a value to it!!
IMHO this is a huge shortcoming and restriction.

Furthermore you have to create variables and assign them the value 1 if you intend to use them as a superscript and hide that assignment either in a collapsed region or to the right of the right margin. This can be a hindrance and a nasty source of errors, especially if the superscript is only to be one letter and a variable with the same name is already in use for other, real calculation purposes.

So using this method would be too much of a hassle for me ...

RE_12882698
5-Regular Member
(To:Werner_E)

Thank you.

RE_12882698
5-Regular Member
(To:ttokoro)

Thank you.
Hopefully a future release of Mathcad Prime will provide a means to use superscript text in variable names. However, until then, it is good to know of potential work-arounds.

Announcements

Top Tags