<< . 3( 7) >>
Let™s review the notation
• (0, 1) is an open interval
• [0, 1] is a closed interval

So, why the dollars around (0,1) also? Since (0,1) and [0,1] are mathematical entities,
the correct way to typeset them is to include them within braces in the input, even when
there is no trouble such as with \item as seen above. (By the way, do you notice any
difference between (0,1) produced by the input (0,1) and (0, 1) produced by $(0,1)$?)
In addition to all these tweaks, there is also provision in LTEX to design your own
A

˜custom™ lists. But that is another story.
TUTORIAL VII

ROWS AND COLUMNS

The various list environments allows us to format some text into visually distinct rows.
But sometimes the logical structure of the text may require these rows themselves to be
divided into vertically aligned columns. For example, consider the material below typeset
using the \description environment (doesn™t it look familiar?)

Let™s take stock of what we™ve learnt
Abiword A word processor
Emacs A text editor
TEX A typesetting program

A nicer way to typeset this is

Let™s take stock of what we™ve learnt

AbiWord A word processor
A text editor
Emacs
A typesetting program
TEX

Here the three rows of text are visually separated into two columns of left aligned text.
This was produced by the tabbing environment in LTEX.
A

KEEPING
VII.1. TABS

Basics
VII.1.1.

Let™s take stock of what we™ve learnt
\begin{tabbing}

Superscripts and subscripts
VIII.1.1.

Look at the text below

In the seventeenth century, Fermat conjectured that if n > 2, then there are no integers x, y, z
for which
xn + yn = zn .
This was proved in 1994 by Andrew Wiles.

This is produced by the input
In the seventeenth century, Fermat conjectured that if $n>2$, then
there are no integers $x$, $y$, $z$ for which
$$xˆn+yˆn=zˆn.$$
This was proved in 1994 by Andrew Wiles.

This shows that superscripts (mathematicians call them exponents) are produced by the
ˆ symbol. If the superscript is more than one character long, we must be careful to group
these characters properly. Thus to produce

It is easily seen that (xm )n = xmn .

we must type
It is easily seen that $(xˆm)ˆn=xˆ{mn}$.

Instead of $xˆ{mn}$, if we type $xˆmn$ we end up with xm n instead of the intended xmn
in the output.
We can have superscripts of superscripts (and mathematicians do need them). For
example,
n
Numbers of the form 22 + 1, where n is a natural number, are called Fermat numbers.

is produced by
79
THE
VIII.1. BASICS

Numbers of the form $2ˆ{2ˆn}+1$, where $n$ is a natural number, are
called Fermat numbers.

Note the grouping of superscripts. (What happens if you type $2ˆ2ˆn+1$ or ${2ˆ2}ˆn$?)
Now let us see how subscripts (mathematicians call them subscripts) are produced.
To get

The sequence (xn ) de¬ned by

x1 = 1, x2 = 1, xn = xn’1 + xn’2 (n > 2)

is called the Fibonacci sequence.

we must type
The sequence $(x_n)$ defined by
$$x_1=1,\quad x_2=1,\quad x_n=x_{n-1}+x_{n-2}\;\;(n>2)$$
is called the Fibonacci sequence.

Thus subscripts are produced by the _ character. Note how we insert spaces by the \quad
command. (The command \; in math mode produces what is known as a “thickspace”.)
Subscripts of subscripts can be produced as in the case of superscripts (with appropriate
grouping).
We can also have superscripts and subscripts together. Thus

If the sequence (xn ) converges to a, then the sequence (x2 ) converges to a2
n

is produced by
If the sequence $(x_n)$ converges to $a$, then the sequence
$(x_nˆ2)$ converges to $aˆ2$

Again, we must be careful about the grouping (or the lack of it) when typesetting
superscripts and subscripts together. The following inputs and the corresponding outputs
make the point.
$$x_mˆn\qquad xˆn_m\qquad {x_m}ˆn\qquad {xˆn}_m$$

xn xn xm n xn m
m m

(This has to do with the way TEX works, producing “boxes” to ¬t the output characters.
The box for xn is like xn while the box for xm n is xm n .
m m

Roots
VIII.1.2.

Square roots are produced by the \sqrt argument. Thus $\sqrt{2}$ produces 2. This
command has an optional argument to produce other roots. Thus

√ 5
4
Which is greater 5 or 4?

is produced by
80 TYPESETTING MATHEMATICS
VIII.

Which is greater $\sqrt[4]{5}$ or $\sqrt[5]{4}$?

The horizontal line above the root (called vinculum by mathematicians of yore) elon-

gates to accommodate the enclosed text. For example, $\sqrt{x+y}$ produces x + y.
Also, you can produce nested roots as in

The sequence

√ √ √ √
2 2, 2, 2+ 2, 2+ 2+ 2+ 2, ...
22 23 24
2’ 2’ 2’

converge to π.

by typing
The sequence
$$2\sqrt{2}\,,\quad 2ˆ2\sqrt{2-\sqrt{2}}\,,\quad 2ˆ3 \sqrt{2-\sqrt{2+\sqrt{2}}}\,,\quad 2ˆ4\sqrt{2- \sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2}}}}}\,,\;\ldots$$
converge to $\pi$.

The \ldots command above produces . . ., the three dots indicating inde¬nite contin-
uation, called ellipsis (more about them later). The command \, produces a “thinspace”
(as opposed to a thickspace produced by \; , seen earlier). Why all this thin and thick
spaces in the above input? Remove them and see the difference. (A tastefully applied
thinspace is what makes a mathematical expression typeset in TEX really beautiful.)
The symbol π in the output produced by $\pi$ maybe familiar from high school
mathematics. It is a Greek letter named “pi”. Mathematicians often use letters of the
Greek alphabet ((which even otherwise is Greek to many) and a multitude of other sym-
bols in their work. A list of available symbols in LTEX is given at the end of this chapter.
A

Mathematical symbols
VIII.1.3.

In the list at the end of this chapter, note that certain symbols are marked to be not avail-
able in native LTEX, but only in certain packages. We will discuss some such packages
A

later. Another thing about the list is that they are categorized into classes such as “Bi-
nary Relations”, “Operators”, “Functions” and so on. This is not merely a matter of
convenience.
We have noted that TEX leaves some additional spaces around “binary operators”
such as + and ’. The same is true for any symbol classi¬ed as a binary operator. For
example, consider the following

For real numbers x and y, de¬ne an operation —¦ by

x —¦ y = x + y ’ xy

This operation is associative.

From the list of symbols, we see that —¦ is produced by \circ and this is classi¬ed as a
binary operator, so that we can produce this by
For real numbers $x$ and $y$, define an operation $\circ$ by
$$81 CUSTOM VIII.2. COMMANDS x\circ y = x+y-xy$$
This operation is associative.

Note the spaces surrounding the —¦ symbol in the output. On the other hand suppose you
want

For real numbers x and y, de¬ne an operation by

y = x2 + y2
x

The list of symbols show that the symbol is produced by \Box but that it is avail-
able only in the package latexsym or amssymb. So if we load one of these using the
\usepackage command and then type
For real numbers $x$ and $y$, define an operation $\Box$ by
$$x\Box y = xˆ2+yˆ2$$

you will only get

For real numbers x and y, de¬ne an operation by

x y = x2 + y2

Notice the difference? There are no spaces around ; this is because, this symbol is
not by default de¬ned as a binary operator. (Note that it is classi¬ed under “Miscel-
laneous”.) But we can ask TEX to consider this symbol as a binary operator by the
command \mathbin before \Box as in
For real numbers $x$ and $y$, define an operation $\Box$ by
$$x\mathbin\Box y=xˆ2+yˆ2$$

and this will produce the output shown ¬rst.
This holds for “Relations” also. TEX leaves some space around “Relation” symbols
and we can instruct TEX to consider any symbol as a relation by the command \mathrel.
Thus we can produce

De¬ne the relation ρ on the set of real numbers by x ρ y iff x ’ y is a rational number.

by typing
Define the relation $\rho$ on the set of real numbers by
$x\mathrel\rho y$ iff $x-y$ is a rational number.

(See what happens if you remove the \mathrel command.)

CUSTOM
VIII.2. COMMANDS

We have seen that LTEX produces mathematics (and many other things as well) by means
A

of “commands”. The interesting thing is that we can build our own commands using
the ones available. For example, suppose that t the expression (x1 , x2 , . . . , xn ) occurs
frequently in a document. If we now write
82 TYPESETTING MATHEMATICS
VIII.

\newcommand{\vect}{(x_1,x_2,\dots,x_n)}

Then we can type $\vect$ anywhere after wards to produce (x1 , x2 , . . . , xn ) as in
We often write $x$ to denote the vector $\vect$.

to get

We often write x to denote the vector (x1 , x2 , . . . , xn ).

(By the way, the best place to keep such “newcommands” is the preamble, so that you
can use them anywhere in the document. Also, it will be easier to change the commands,
if the need arises).
OK, we can now produce (x1 , x2 , . . . , xn ) with $\vect$, but how about (y1 , y2 , . . . , yn )
or (z1 , z2 , . . . , zn )? Do we have to de¬ne newcommands for each of these? Not at all. We
can also de¬ne commands with variable arguments also. Thus if we change our de¬nition
of \vect to
\newcommand{\vect}[1]{(#1_1,#1_2,\dots,#1_n)}

Then we can use $\vect{x}$ to produce (x1 , x2 , . . . , xn ) and $\vect{a}$ to produce
(a1 , a2 , . . . , an ) and so on.
The form of this de¬nition calls for some comments. The [1] in the \newcommand
above indicates that the command is to have one (variable) argument. What about the
#1? Before producing the output, each occurrence of #1 will be replaced by the (single)
argument we supply to \vect in the input. For example, the input $\vect{a}$ will be
changed to $(a_1,a_2,\dots,a_n)$ at some stage of the compilation.
We can also de¬ne commands with more than one argument (the maximum number
is 9). Thus for example, if the document contains not only (x1 , x2 , . . . , xn ), (y1 , y2 , . . . , yn )
and so on, but (x1 , x2 , . . . , xm ), (y1 , y2 , . . . , yp ) also, then we can change our de¬nition of
\vect to
\newcommand{\vect}[2]{(#1_1,#1_2,\dotsc,#1_#2)}

 << . 3( 7) >>