Path: sparky!uunet!UB.com!pacbell.com!ames!olivea!charnel!psgrain!ee.und.ac.za!tplinfm From: gmaltby@unpcs1.cs.unp.ac.za (Gavin Maltby) Newsgroups: comp.text.tex Subject: latex notes: 4 of 4 Summary: part 4 of 4 Keywords: latex notes Message-ID: <gmaltby.121.728117728@unpcs1.cs.unp.ac.za> Date: 27 Jan 93 06:55:29 GMT Organization: University of Natal, Pietermaritzburg, South Africa Lines: 594 NNTP-Posting-Host: pc038.cc.unp.ac.za

Now let's see how to set a sub- or superscript that consists of more than just one character. This is no more difficult than before if we remember the following rule: _ and ^ set the group that follows them as a sub- and superscripts to the group that precedes the sub- and superscript symbols. We see now now that our initial examples worked by considering a single character to be a group by itself. Here are some examples:

\begin{mathegs}
\verb@$a^2b^3$@ & $a^2b^3$\\
\verb@$2^{21}$@ & $2^{21}$\\
\ver...
... & $\Gamma_{\alpha\beta\gamma}$\\
\verb@${}_1A_2$@ & ${}_1A_2$\\
\end{mathegs}

In the very last example we see a case of setting a subscript to an empty group, which resulted in a kind of ``pre-subscript''. With some imagination this can be put to all sorts of uses.

In all of the above examples the sub- and superscripts were set to single-character groups. Nowhere did we group an expression before sub- or superscripting it. Even in setting the expression (x + 1)3, the superscript 3 was really only set to the character ). If we had wanted to group the (x + 1) before setting the superscript, we would have typed ${(x+1)}^3$ which gives (x+1)3, with the superscript slightly raised. One has to go to this trouble because, to most people, something like (xa)b is just as acceptable and as readable as (xa)b. It also has the advantage of aligning the base lines in expressions such as

(ab)-2 = [(ab)-1]2 = [b-1a-1]2 = b-1a-1b-1a-1

which looks more pleasing than if we use additional grouping to force

(ab)-2 = [(ab)-1]2 = [b-1a-1]2 = b-1a-1b-1a-1    ,

and the latter has rather more braces in it that require balancing.

Here are some more examples, showing how LATEX will set things just as we want without any further work on our part:

\begin{mathegs}
\verb@$x^{y^z}$@ & $x^{y^z}$\\
\verb@$2^{(2^2)}$@ & $2^{(2^2)}$...
...^{2^{2^{\aleph_0}}}$\\
\verb@$\Gamma^{z_c^d}$@ & $\Gamma^{z_c^d}$
\end{mathegs}

We can also make use of empty groups in order to stagger sub- and superscripts to an expression, as in

0.1

$\Gamma_{\alpha\beta}{}^{\gamma}{}_\delta$
which will yield

Γαβγδ

One can specify the sub- and superscripts to a group in any order, but it is best to be consistent. The most natural order seems to be to have subscripts first, but you may think otherwise. It is also a good idea to always include your sub- and superscripts in braces (i.e. make them a group), whether they consist of just a single character or not. This enhances readability and also helps avoid the unfortunate case where you believe that a particular control word gives a single symbol yet it really is defined in terms of several.