<< . .

. 3
( : 23)

. . >>


ifying the kind of document to be produced, using the command \documentclass{... }.
We™ve also noted that for a short article (which can actually turn out to be quite long!) we
write \documentclass{article} and for books, we write \documentclass{book}. There
are other document classes available in LTEX such as report and letter. All of them

share some common features and there are features speci¬c to each.
In addition to specifying the type of document (which we must do, since LTEX hasA

no default document class), we can also specify some options which modify the default
format.Thus the actual syntax of the \documentclass command is
Note that options are given in square brackets and not braces. (This is often the
case with LTEX commands”options are speci¬ed within square brackets, after which

mandatory arguments are given within braces.)

Font size

We can select the size of the font for the normal text in the entire document with one of
the options
10pt 11pt 12pt
Thus we can say
to set the normal text in our document in 11 pt size. The default is 10pt and so this is the
size we get, if we do not specify any font-size option.

Paper size

We know that LTEX has its own method of breaking lines to make paragraphs. It also has

methods to make vertical breaks to produce different pages of output. For these breaks
to work properly, it must know the width and height of the paper used. The various
options for selecting the paper size are given below:

11—8.5 in 20.7—21 in
letterpaper a4paper
14—8.5 in 21—14.8 in
legalpaper a5paper
10.5—7.25 in 25—17.6 in
executivepaper b5paper

Normally, the longer dimension is the vertical one”that is, the height of the page. The
default is letterpaper.


Page formats

There are options for setting the contents of each page in a single column (as is usual) or
in two columns (as in most dictionaries). This is set by the options
onecolumn twocolumn

and the default is onecolumn.
There is also an option to specify whether the document will be ¬nally printed on just
one side of each paper or on both sides. The names of the options are
oneside twoside

One of the differences is that with the twoside option, page numbers are printed on
the right on odd-numbered pages and on the left on even numbered pages, so that when
these printed back to back, the numbers are always on the outside, for better visibility.
(Note that LTEX has no control over the actual printing. It only makes the formats for

different types of printing.) The default is oneside for article, report and letter and
twoside for book.
In the report and book class there is a provision to specify the different chapters (we
will soon see how). Chapters always begin on a new page, leaving blank space in the
previous page, if necessary. With the book class there is the additional restriction that
chapters begin only on odd-numbered pages, leaving an entire page blank, if need be.
Such behavior is controlled by the options,
openany openright

The default is openany for reportclass (so that chapters begin on “any” new page)
and openright for the book class (so that chapters begin only on new right, that is, odd
numbered, page).
There is also a provision in LTEX for formatting the “title” (the name of the docu-

ment, author(s) and so on) of a document with special typographic consideration. In the
article class, this part of the document is printed along with the text following on the
¬rst page, while for report and book, a separate title page is printed. These are set by the
notitlepage titlepage

As noted above, the default is notitlepage for article and titlepage for report and
book. As with the other options, the default behavior can be overruled by explicitly
specifying an option with the documentclass command.
There are some other options to the documentclass which we will discuss in the rele-
vant context.


Having decided on the overall appearance of the document through the \documentclass
command with its various options, we next see how we can set the style for the individual
pages. In LTEX parlance, each page has a “head” and “foot” usually containing such

information as the current page number or the current chapter or section. Just what goes
where is set by the command

where the mandatory argument can be any one of the following styles
plain empty headings myheadings

The behavior pertaining to each of these is given below:

plain The page head is empty and the foot contains just the page number, cen-
tered with respect to the width of the text. This is the default for the
article class if no \pagestyle is speci¬ed in the preamble.
empty Both the head and foot are empty. In particular, no page numbers are
headings This is the default for the book class. The foot is empty and the head
contains the page number and names of the chapter section or subsection,
depending on the document class and its options as given below:
one-sided ” chapter
book, report
two-sided chapter section
one-sided ” section
two-sided section subsection
myheadings The same as headings, except that the ˜section™ information in the head
are not predetermined, but to be given explicitly using the commands
\markright or \markboth as described below.

Moreover, we can customize the style for the current page only using the command

where style is the name of one of the styles above. For example, the page number may
be suppressed for the current page alone by the command \thispagestyle{empty}. Note
that only the printing of the page number is suppressed. The next page will be numbered
with the next number and so on.

Heading declarations

As we mentioned above, in the page style myheadings, we have to specify the text to
appear on the head of every page. It is done with one of the commands
\markboth{left head{right head}
\markright{right head}

where left head is the text to appear in the head on left-hand pages and right head is the
text to appear on the right-hand pages.
The \markboth command is used with the twoside option with even numbered pages
considered to be on the left and odd numbered pages on the right. With oneside option,
all pages are considered to be right-handed and so in this case, the command \markright
can be used. These commands can also be used to override the default head set by the
headings style.
Note that these give only a limited control over the head and foot. since the general
format, including the font used and the placement of the page number, is ¬xed by LTEX.

Better customization of the head and foot are offered by the package fancyhdr, which is
included in most LTEX distributions.


The style of page numbers can be speci¬ed by the command

The possible arguments to this command and the resulting style of the numbers are given

Indo-Arabic numerals
lowercase Roman numerals
upper case Roman numerals
lowercase English letters
uppercase English letters

The default value is arabic. This command resets the page counter. Thus for example, to
number all the pages in the ˜Preface™ with lowercase Roman numerals and the rest of the
document with Indo-Arabic numerals, declare \pagenumbering{roman} at the beginning
of the Preface and issue the command \pagestyle{arabic} immediately after the ¬rst
\chapter command. (The \chapter{...} command starts a new chapter. We will come
to it soon.)
We can make the pages start with any number we want by the command
where number is the page number we wish the current page to have.


Each page that LTEX produces consists not only of a head and foot as discussed above

but also a body (surprise!) containing the actual text. In formatting a page, LTEX uses

the width and heights of these parts of the page and various other lengths such as the
left and right margins. The values of these lengths are set by the paper size options and
the page format and style commands. For example, the page layout with values of these
lengths for an odd page and even in this book are separately shown below.
These lengths can all be changed with the command \setlength. For example,
makes the width of text 15 cm. The package geometry gives easier interfaces to customize
page format.


We now turn our attention to the contents of the document itself. Documents (especially
longer ones) are divided into chapters, sections and so on. There may be a title part
(sometimes even a separate title page) and an abstract. All these require special typo-
graphic considerations and LTEX has a number of features which automate this task.


The “title” part of a document usually consists of the name of the document, the name
of author(s) and sometimes a date. To produce a title, we make use of the commands
\title{document name}
\author{author names}
\date{date text}

Note that after specifying the arguments of \title, \author and \date, we must issue the
command \maketitle for this part to be typeset.
By default, all entries produced by these commands are centered on the lines in which
they appear. If a title text is too long to ¬t in one line, it will be broken automatically.
However, we can choose the break points with the \\ command.
If there are several authors and their names are separated by the \and command, then
the names appear side by side. Thus

\author{Author 1\\
Address line 11\\
Address line 12\\
Address line 13
Author 2\\
Address line 21\\
Address line 22\\
Address line 23}
\date{Month Date, Year}

Author 1 Author 2
Address line 11 Address line 21
Address line 12 Address line 22
Address line 13 Address line 23

Month Date, Year

If instead of \and, we use (plain old) \\, the names are printed one below another.
We may leave some of these arguments empty; for example, the command \date{ }
prints no date. Note, however, that if you simply omit the \date command itself, the
current date will be printed. The command
\thanks{footnote text}

can be given at any point within the \title, \author or \date. It puts a marker at this
point and places the footnote text as a footnote. (The general method of producing a
footnote is to type \footnote{footnote text} at the point we want to refer to.)
As mentioned earlier, the “title” is printed in a separate page for the document classes
book and report and in the ¬rst page of the document for the class article. (Also recall
that this behavior can be modi¬ed by the options titlepage or notitlepage.)


In the document classes article and report, an abstract of the document in special for-
mat can be produced by the commands
Abstract Text
Note that we have to type the abstract ourselves. (There is a limit to what even LTEX can

do.) In the report class this appears on the separate title page and in the article class it
appears below the title information on the ¬rst page (unless overridden by the title page
option). This command is not available in the book class.


A book is usually divided into chapters and (if it is technical one), chapters are divided
into sections, sections into subsections and so on. LTEX provides the following hierarchy

of sectioning commands in the book and report class:

Except for \chapter all these are available in article class also. For example, the
heading at the beginning of this chapter was produced by
\chapter{The Document}

and the heading of this section was produced by
\section{Dividing the document}

To see the other commands in action, suppose at this point of text I type
In this example, we show how subsections and subsubsections
are produced (there are no subsubsubsections). Note how the
subsections are numbered.

Did you note that subsubsections are not numbered? This is so in the
\texttt{book} and \texttt{report} classes. In the \texttt{article}
class they too have numbers. (Can you figure out why?)

Paragraphs and subparagraphs do not have numbers. And they have
\textit{run-in} headings.

Though named ˜˜paragraph™™ we can have several paragraphs of text
within this.

Subparagraphs have an additional indentation too.

And they can also contain more than one paragraph of text.

We get


In this example, we show how subsections and subsubsections are produced (there are
no subsubsubsections). Note how the subsections are numbered.

Did you note that subsubsections are not numbered? This is so in the book and report
classes. In the article class they too have numbers. (Can you ¬gure out why?)
Note Paragraphs and subparagraphs do not have numbers. And they have run-in head-
ings. Though named “paragraph” we can have several paragraphs of text within this.
Subnote Subparagraphs have an additional indentation too. And they can also con-
tain more than one paragraph of text.

More on sectioning commands

In the book and the report classes, the \chapter command shifts to the beginning of a
new page and prints the word “Chapter” and a number and beneath it, the name we have
given in the argument of the command. The \section command produces two numbers
(separated by a dot) indicating the chapter number and the section number followed
by the name we have given. It does not produce any text like “Section”. Subsections
have three numbers indicating the chapter, section and subsection. Subsubsections and
commands below it in the hierarchy do not have any numbers.
In the article class, \section is highest in the hierarchy and produces single number
like \chapter in book. (It does not produce any text like “Section”, though.) In this case,
subsubsections also have numbers, but none below have numbers.
Each sectioning command also has a “starred” version which does not produce num-
bers. Thus \section*{name} has the same effect as \section{name}, but produces no
number for this section.
Some books and longish documents are divided into parts also. LTEX also has a \part

command for such documents. In such cases, \part is the highest in the hierarchy, but it
does not affect the numbering of the lesser sectioning commands.
You may have noted that LTEX has a speci¬c format for typesetting the section head-

ings, such as the font used, the positioning, the vertical space before and after the heading
and so on. All these can be customized, but it requires some TEXpertise and cannot be
addressed at this point. However, the package sectsty provided some easy interfaces for
tweaking some of these settings.


<< . .

. 3
( : 23)

. . >>