4
Displaying Content

4.1 Borrowing Text

There are many instances in a document when we want to visually separate a portion of text from its surrounding material. One method of doing this is to typeset the distinguished text with added indentation.

It is called displaying.

LaTeX has various constructs for displaying text depending the nature of the displayed text. We will start with quotations.

Quotations are often used in a document, either to add weight to our arguments by referring to a higher authority or because we find that we cannot improve on the way an idea has been expressed by someone else. If the quote is a one-liner, we can simply include it within double-quotes and be done with it. But if the quotation is several lines long, it is better to display it. Look at the following example:

latex
Some mathematicians elevate the spirit of Mathematics to a kind of intellectual aesthetics. It is best voiced by Bertrand Russell in the following lines. \begin{quote} The true spirit of delight, the exaltation, the sense of being more than man, which is the touchstone of the highest excellence, is to be found in Mathematics as surely as in poetry.. . . Real life is, to most men, a long second best, a perpetual compro- mise between the ideal and the possible; but the world of pure reason knows no compromise, no practical limitations, no barriers to the creative activity embody- ing in splendid edifices the passionate aspiration after the perfect, from which all great work springs. \end{quote}

Note that here we give instructions to TeX to typeset some material in a separate paragraph with additional indentation on either side and indicate the start and end of material requiring special treatment, by means of the commands

latex
\begin{quote} ... \end{quote}

This is an example of what is known in LaTeX as an environment . Environments are used to delimit passages requiring special typographic treatments and to give instructions to LaTeX on how to typeset it. The general form of an environment is of the form

latex
\begin{name} ... \end{name}

where name is the name of the environment and signifies to LaTeX the type of typographic treatment required. The quoted part in this example is a single paragraph. If the quotation runs into several paragraphs, we must use the quotation environment, by enclosing the quotation within \begin{quotation} and \end{quotation}.

As usual, paragraphs are separated by blank lines while typing the source file.

4.2 Making Lists

Lists are needed to keep some semblance of order in a chaotic world and LaTeX helps us to typeset them nicely. Also, there are different kinds of lists available by default and if none of them suits your need, there are facilities to tweak these or even design your own. Let us first have a look at the types of lists LaTeX provides.

4.2.1 Using Bullet Lists

The itemize environment gives us a bullet-list. For example it produces something like this:

One should keep the following in mind when using TeX

  • TeX is a typesetting language and not a word processor

  • TeX is a program and and not an application

  • There is no meaning in comparing TeX to a word processor, since the design purposes are different

latex
One should keep the following in mind when using \TeX \begin{itemize} \item \TeX\ is a typesetting language and not a word processor \item \TeX\ is a program and and not an application \item There is no meaning in comparing \TeX\ to a word processor, since the design purposes are different \end{itemize}

The \begin{itemize} ... \end{itemize} pair signifies we want a bullet-list of the enclosed material. Each item of the list is specified by an \item command. We can have lists within lists. For example:

One should keep the following in mind when using TeX

  • TeX is a typesetting language and not a word processor

  • TeX is a program and and not an application

  • Theres is no meaning in comparing TeX to a word processor, since the design purposes are different

  • TeX is the natural choice in one of these situations

    • If we want to typeset a document containing lot of Mathematics

    • If we want our typed document to look beautiful

Being a program, TeX offers a high degree of flexibility.

latex
One should keep the following in mind when using \TeX \begin{itemize} \item \TeX\ is a typesetting language and not a word processor \item \TeX\ is a program and and not an application \item Theres is no meaning in comparing \TeX\ to a word processor, since the design purposes are different \item \TeX\ is the natural choice in one of these situations \begin{itemize} \item If we want to typeset a document containing lot of Mathematics \item If we want our typed document to look beautiful \end{itemize} \end{itemize} Being a program, \TeX\ offers a high degree of flexibility.

The itemize environment supports four (4) levels of nesting. The full list of labels for the items 1 1 ’bullets’ for the first level, ’dashes’ for the second and so on is as shown below

  • The first item in the first level

  • the second item in the first level

    • The first item in the second level

    • the second item in the second level

      • The first item in the third level

      • the second item in the third level

        • The first item in the fourth level

        • the second item in the fourth level

The source of this is as follows:

latex
\begin{itemize} \item The first item in the first level \item the second item in the first level \begin{itemize} \item The first item in the second level \item the second item in the second level \begin{itemize} \item The first item in the third level \item the second item in the third level \begin{itemize} \item The first item in the fourth level \item the second item in the fourth level \end{itemize} \end{itemize} \end{itemize} \end{itemize}

4.2.2 Ordered Lists

When the order of the items in a list is important, we need a list which specifies this order. For example, consider this

1.
prepare a source file with the extension "tex"
2.
Compile it with LaTeXto produce a "dvi" file
3.
Print the document using a "dvi" driver

Such a numbered list is produced by the enumerate environment in LaTeX. The above list was produced by the following source.

latex
\begin{enumerate} \item prepare a source file with the extension "tex" \item Compile it with \LaTeX to produce a "dvi" file \item Print the document using a "dvi" driver \end{enumerate}

As in the case of itemize environment, here also four levels of nesting are supports. The example below shows the labels used for different levels.

1.
The first item in the first level
2.
the second item in the first level
a)
The first item in the second level
b)
the second item in the second level
i.
The first item in the third level
ii.
the second item in the third level
A.
The first item in the fourth level
B.
the second item in the fourth level

How about customizing the labels? Here there is an additional complication in that the labels for items in the same level must follow a sequence (such as 1,2,3, … for the first level, (a), (b), (c), … for the second and so on, by default). There is a method for doing it, but it will take us into somewhat deeper waters. Fortunately, there is a package enumitem which makes it easy. So if we want:

The three basic steps in producing a printed document using LaTeX are as follows:

Step 1.
Prepare a source file with the extension "tex"
Step 2.
Compile it with LaTeXto produce a "dvi" file
i.
Use a previewer (such as "xdvi" on X Window System) to view the output
ii.
Edit the source if needed
iii.
Recompile
Step 3.
Print the document using a "dvi" driver (such as "dvips")

which is typed as

latex
The three basic steps in producing a printed document using \LaTeX\ are as follows: \begin{enumerate}[label=Step \arabic*.] \item Prepare a source file with the extension "tex" \item Compile it with \LaTeX to produce a "dvi" file \begin{enumerate}[label=\roman*.] \item Use a previewer (such as "xdvi" on \textsf{X Window System}) to view the output \item Edit the source if needed \item Recompile \end{enumerate} \item Print the document using a "dvi" driver (such as "dvips") \end{enumerate}

4.2.3 Description Lists

There is a third type of list available off-the-shelf in LaTeX which is used in typesetting 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

which is typed as:

latex
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. Also, there is no indentation for the first level.