<< . .

. 8
( : 23)



. . >>

Addition of numbers satisfies the following conditions
\begin{enumerate}[\hspace{1cm}({A}1)]
\item It is commutative
\item It is associative
\item There is an additive identity
54 DISPLAYED TEXT
VI.


\item Each number has an additive inverse
\end{enumerate}

with braces surrounding the A. (The mystery is not over, is it? How come we got 11,
22,. . . in the above example and not A1, B2,. . . ? Work it out yourselves!)

DESCRIPTIONS
VI.5. AND DEFINITIONS

There is a third type of list available off-the-shelf in LTEX which is used in typesetting
A

lists like this

Let us take stock of what we have learnt
TEX A typesetting program
Emacs A text editor and also
a programming environment
a mailer
and a lot else besides
AbiWord A word processor

This is produced by the description environment as shown below:
Let us take stock of what we have learnt
\begin{description}
\item[\TeX] A typesetting program
\item[Emacs] A text editor and also
\begin{description}
\item a programming environment
\item a mailer
\item and a lot else besides
\end{description}
\item[AbiWord] A word processor
\end{description}

Note that this environment does not produce on its own any labels for the various
items, but only produces as labels, whatever we give inside square brackets immediately
after each \item. By default, the labels are typeset in boldface roman. Also, there is no
indentation for the ¬rst level. As with the other list environments, these can be changed
to suit your taste. For example, suppose we want labels to be typeset in sans-serif roman
and also want an indentation even for the ¬rst level. The code below will do the trick
(remember why we include the whole input within braces?):
\renewcommand{\descriptionlabel}[1]{\hspace{1cm}\textsf{#1}}
Let us take stock of what we have learnt
\begin{description}
\item[\TeX] A typesetting program
\item[Emacs] A text editor and also
\begin{description}
\item a programming environment
\item and a lot else besides
\end{description}
\item[AbiWord] A word processor
\end{description}
55
DESCRIPTIONS
VI.5. AND DEFINITIONS



and we get the output

Let us take stock of what we have learnt
TEX A typesetting program
Emacs A text editor and also
a programming environment
and a lot else besides
AbiWord A word processor


Now is perhaps the time to talk about a general feature of all the three list environ-
ments we have seen. In any of these, we can override the default labels (if any) produced
by the environment by something of our own by including it within square brackets
immediately after the \item. Thus the input
The real number $l$ is the least upper bound of the
set $A$ if it satisfies the following conditions
\begin{enumerate}
\item[(1)] $l$ is an upper bound of $A$
\item[(2)] if $u$ is an upper bound of $A$, then $l\le u$
\end{enumerate}
The second condition is equivalent to
\begin{enumerate}
\item[(2)$™$] If $a<l$, then $a$ is not an upper bound of $A$.
\end{enumerate}

produces

The real number l is the least upper bound of the set A if it satis¬es the following conditions
(1) l is an upper bound of A
(2) if u is an upper bound of A, then l ¤ u
The second condition is equivalent to
(2) If a < l, then a is not an upper bound of A.


This feature sometimes produces unexpected results. For example, if you type
Let™s review the notation
\begin{itemize}
\item (0,1) is an \emph{open} interval
\item [0,1] is a \emph{closed} interval
\end{itemize}

you will get

Let™s review the notation
• (0,1) is an open interval
0,1 is a closed interval

What happened? The 0,1 within square brackets in the second item is interpreted by
LTEX as the optional label for this item. The correct way to typeset this is
A
56 DISPLAYED TEXT
VI.


Let™s review the notation
\begin{itemize}
\item $(0,1)$ is an \emph{open} interval
\item $[0,1]$ is a \emph{closed} interval
\end{itemize}

which produces

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}
\hspace{1cm}\= \textbf{AbiWord}\quad\= A word processor\\[5pt]
\> \textbf{Emacs} \> A text editor\\[5pt]
\> \textbf{\TeX} \> A typesetting program
\end{tabbing}

Let™s analyze it line by line. In the ¬rst line the ¬rst tab is put at a distance of 1 cm. from
the left margin so that the text following it (˜AbiWord™ in boldface roman) starts from
this point. The second tab is put at a distance of one \quad (this is an inbuilt length
speci¬cation in TEX roughly equal to one space) after the word ˜Abiword™ in boldface
roman so that the text following it (˜A word processor™ in ordinary roman face) start
from this point. The \\[5pt] command signi¬es the end of the ¬rst line and also asks
for a vertical space of 5 points between the ¬rst and the second lines. In the second line,

57
58 ROWS COLUMNS
VII. AND


the ¬rst \> command makes the text following it (˜Emacs™ in boldface roman) to start
from the ¬rst tab (already set in the ¬rst line), namely, 1 cm. from the left margin. The
second \> line makes the text following it (˜A text editor™ in ordinary roman face) at the
second tab already set, namely at a distance 1 cm plus the length of the word ˜AbiWord™
in boldface roman plus a \quad. The third line follows suit. The picture below will make
this clear.



tab 1 tab 2
“ “
AbiWord A word processor
left margin




A text editor
Emacs
A typesetting program
TEX




One should be careful in setting tabs. For example to typeset

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

if you type
\begin{tabbing}
\textbf{\TeX}\quad\= A typesetting program\\[5pt]
\textbf{Emacs}\quad\> A text editor\\[5pt]
\textbf{AbiWord}\quad\> A word processor
\end{tabbing}

then you end up with the output


TEX A typesetting program
EmacsA text editor
AbiWordword processor
A

Do you see what happened? The ¬rst line set the ¬rst tab (the only tab in this example) at
a distance of the length of the word ˜TEX™ in boldface roman plus a ˜quad™ from the left
margin and the \> command in the second line makes the text following to atart from
this tab, which is right next to the word ˜Emacs™ in this line. the same thing happens
in the third line, which is worse, since the position of the tab is at the ˜o™ of ™AbiWord™
and the next word ˜A word processor™ starts from this point, and overwrites the previous
word. The correct way to obtain the output we want is to use a dummy line to mark the
tabs, without actually typesetting that line. This is achieved by the \kill command in
the tabbing environment, as shown below
\begin{tabbing}
\textbf{AbiWord}\quad\= A word processor\kill
\textbf{\TeX}\quad \> A typesetting program\\[5pt]
59
KEEPING
VII.1. TABS


\textbf{Emacs}\quad \> A text editor\\[5pt]
\textbf{AbiWord}\quad\> A word processor
\end{tabbing}

New tabs, in addition to the ones already set by the ¬rst line (dummy or otherwise),
can be set in any subsequent line. Thus the output


: A typesetting program
TEX
: A text editor
Emacs
a programming environment
a mail reader
and a lot more besides
AbiWord : A word processor

is obtained from the source
\begin{tabbing}
\textbf{AbiWord}\quad\= : \= A word processor\kill\\
\textbf{\TeX}\quad \> : \> A typesetting program\\[5pt]
\textbf{Emacs}\quad \> : \> A text editor\\[5pt]
\> \> \quad\= a programming environment\\[5pt]
\> \> \> a mail reader\\[5pt]
\> \> \> and a lot more besides\\[5pt]
\textbf{AbiWord}\quad\> : \> A word processor
\end{tabbing}


Here the ¬rst line sets two tabs and the fourth line sets a third tab after these two. All the
three tabs can then be used in the subsequent lines. New tab positions which change the
ones set up by the ¬rst line, can also be introduced in any line by the \= command. Thus
we can produce


Program : TEX
Author : Donald Knuth
Manuals :

Title Author Publisher

The TEXBook Donald Knuth Addison-Wesley
The Advanced TEX Book David Salomon Springer-Verlag

by the input
\begin{tabbing}
Program\quad \= : \= \TeX\\[5pt]
Author \> : \> Donald Knuth\\[5pt]
Manuals \> :\\
\quad\= The Advanced \TeX\ Book\quad\= David Salomon\quad
\= Springer-Verlag\kill\\
\>\textsf{Title} \>\textsf{Author} \>\textsf{Publisher}\\[8pt]
60 ROWS COLUMNS
VII. AND


\>The \TeX Book \>Donald Knuth \>Addison-Wesley\\[5pt]
\>The Advanced \TeX\ Book \>David Salomon \>Springer-Verlag
\end{tabbing}


Here the ¬rst line sets teo tabs and the next two lines use these tabs. The third line sets
three new tabs which replace the original tab positions. The next three lines use these
new tab positions.

Pushing and popping
VII.1.2.

What if you change the tab positions and then want the original settings back? Here™s
where the command pair \pushtabs ... \poptabs ia useful. Thus to typeset


Program : TEX
Author : Donald Knuth
Manuals :

Title Author Publisher

The TEXBook Donald Knuth Addison-Wesley
The Advanced TEX Book David Salomon Springer-Verlag

Tutorial : http://tug.org.in/tutorial

we type
\begin{tabbing}
Program\quad \= : \= \TeX\\[5pt]
Author \> : \> Donald Knuth\\[5pt]
Manuals \> :\\
\pushtabs
\quad\= The Advanced \TeX\ Book \quad \= David Salomon \quad
\= Springer-Verlag\kill\\
\>\textsf{Title} \>\textsf{Author} \>\textsf{Publisher}\\[8pt]
\>The \TeX Book \>Donald Knuth \>Addison-Wesley\\[5pt]
\>The Advanced \TeX\ Book \>David Salomon \> Springer-Verlag\\[8pt]
\poptabs
Tutorial \> : \> "http://tug.org.in/tutorial"
\end{tabbing}


Here the ¬rst three lines follow a tabbing scheme, the next three lines follow another
tabbing scheme and the last line reverts back to the original scheme. Here the \pushtabs
command stores the current tabbing scheme and removes it so that a new tabbing scheme
can be set up; and the \poptabs commands reactivates the original scheme. These com-
mands can be nested.

More commands
VII.1.3.

There are some more useful commands available in the tabbing environment. The \+
command given at the end of a line makes every subsequent line start at the ¬rst tab;
with \+\+ at the end of a line, all subsequent lines start at the second tab and so on.
The effect of each \+ can be neutralized by one \- command at the end of a line. The
61
KEEPING
VII.1. TABS


command \< at the beginning of a line neutralizes the effect of one \+ command for that
particular line.
The command \˜ (left quote) puts the text following ¬‚ush right against the right
margin. Naturally we cannot use a \= or \> after this in a line.
Another interesting command is \™ (right quote). Within the tabbing environment
an input of the form left text\™right text puts the right text at the current tab and
the left text just before this tab with a bit of spacing (preassigned by the parameter
\tabbingsep).
The example below illustrates all the tabbing commands we™ve discussed
\begin{tabbing}
Row 1 Column 1\hspace{2cm}
\= Row 1 Column 2\\[5pt]
\> Row 2 Column 2\hspace{1.5cm}\=Row 2 Column 3\+\+\\[5pt]
Row 3 Column 3\-\\[5pt]
Row 4 Column 2 \>Row 4 Column 3\\[5pt]
\< Row 5 Column 1 \> Row 5 Column 2 \>Row 5 Column 3\\[5pt]
Row 6 Column 2 \>Row 6 Column 3\-\\[5pt]
Row 7 Column 1 \> Row 7 Column 2 \>Row 7 Column 3\\[5pt]
Row 8 Column 1 \˜Right\\[5pt]
Row 9 Column 1 \> and\™Row 9 Column 2\\[5pt]
\pushtabs
\quad\= Row 10 New Column 1\hspace{2.5cm}\= Row 10 New Column 2\\[5pt]
\> Row 11 New Column 2 \> Row 11 New Column 2\\[5pt]
\poptabs
Row 12 Old Column 1\> Row 12 Old Column 2\>Row 12 Old Column 3
\end{tabbing}


It produces the following output

<< . .

. 8
( : 23)



. . >>