Prev Next subsup

Latex Subscripts and Superscripts

$latex Command $$

Display in Latex mode the subscripts and superscripts specified by Command where Command contains the underbar character _, the caret character ^ or both.

Command Output
x^{2y} @(@ x^{2y} @)@
x_{2y} @(@ x_{2y} @)@
x^{y^{2}} @(@ x^{y^{2}} @)@
x^{y_{1}} @(@ x^{y_{1}} @)@
x^{y}_{1} @(@ x^{y}_{1} @)@
x_{1}^{y} @(@ x_{1}^{y} @)@

Double Scripting
Note that you can not double subscript or double superscript with out enclosing the first level in braces. For example, the input
     $latex x_1_2 $$
would generate an error message. On the other hand the input
     $latex {x_1}_2 $$
would result in the output @[@ {x_1}_2 @]@

OMhelp's Latex groups sequences of letters as a single input token. In addition, Latex numbers are multiple characters and grouped as a single token. For this reason, the input
     $latex x_ab  x_12  x_ab12 $$
will generate the output @[@ x_ab x_12 x_ab12 @]@ Standard Latex, as per Lamport's reference , would output @[@ x_a b x_1 2 x_a b12 @]@ for this input. It may be that future versions of OMhelp will adopt this convention. Thus, if you wish to group more than one character in a subscript or superscript, you should use parenthesis. For example, the following input would obtain the same effect as the input above:
     $latex x_{ab}  x_{12}  x_{ab} 12 $$

Input File: latex/subsup.omh