<< . .

. 4
( : 23)



. . >>

II.7. NEXT?

The task of learning to create a document in LTEX is far from over. There are other
A

things to do such as producing a bibliography and a method to refer to it and also at the
end of it all to produce a table of contents and perhaps an index. All these can be done
ef¬ciently (and painlessly) in LTEX, but they are matters for other chapters.
A
6
i
i 2
4
i
5
? ?
?
? Header
6
6
i
6 6
6




i
Margin
Body 7
Notes



i
9-
i-
 10

i
3- 




i
 -
8
i
11

? ?
Footer
6
 1i-


1 one inch + \hoffset 2 one inch + \voffset
3 \evensidemargin = 54pt 4 \topmargin = 18pt
5 \headheight = 12pt 6 \headsep = 18pt
7 \textheight = 609pt 8 \textwidth = 380pt
9 \marginparsep = 7pt 10 \marginparwidth = 115pt
11 \footskip = 25pt \marginparpush = 5pt (not shown)
\hoffset = 0pt \voffset = 0pt
\paperwidth = 597pt \paperheight = 845pt
6
i
i 2
4
i
5
? ?
?
? Header
6
6
i
6 6
6




i Margin
Body 7
Notes



i
9
-
i-
 10

i
3
-




i
 -
8
i
11

? ?
Footer
6
 1i-


1 one inch + \hoffset 2 one inch + \voffset
3 \oddsidemargin = 18pt 4 \topmargin = 18pt
5 \headheight = 12pt 6 \headsep = 18pt
7 \textheight = 609pt 8 \textwidth = 380pt
9 \marginparsep = 7pt 10 \marginparwidth = 115pt
11 \footskip = 25pt \marginparpush = 5pt (not shown)
\hoffset = 0pt \voffset = 0pt
\paperwidth = 597pt \paperheight = 845pt
26
TUTORIAL III


BIBLIOGRAPHY


INTRODUCTION
III.1.

Bibliography is the environment which helps the author to cross-reference one publica-
tion from the list of sources at the end of the document. LTEX helps authors to write a
A

well structured bibliography, because this is how LTEX works”by specifying structure.
A

It is easy to convert the style of bibliography to that of a publisher™s requirement,
without touching the code inside the bibliography. We can maintain a bibliographic data
base using the program BIBTEX. While preparing the articles, we can extract the needed
references in the required style from this data base. harvard and natbib are widely used
packages for generating bibliography.
To produce bibliography, we have the environment thebibliography1 , which is sim-
ilar to the enumerate environment. Here we use the command \bibitem to separate the
entries in the bibliography and use \cite to refer to a speci¬c entry from this list in the
document. This means that at the place of citation, it will produce number or author-year
code connected with the list of references at the end.
\begin{thebibliography}{widest-label}
\bibitem{key1}
\bibitem{key2}
\end{thebibliography}

The \begin{thebibliography} command requires an argument that indicates the
width of the widest label in the bibliography. If you know you would have between
10 and 99 citations, you should start with
\begin{thebibliography}{99}

You can use any two digit number in the argument, since all numerals are of the same
width. If you are using customized labels, put the longest label in argument, for example
\begin{thebibliography}{Long-name}. Each entry in the environment should start with

\bibitem{key1}

If the author name is Alex and year 1991, the key can be coded as ale91 or some
such mnemonic string2 . This key is used to cite the publication within the document text.
To cite a publication from the bibliography in the text, use the \cite command, which
takes with the corresponding key as the argument. However, the argument to \cite can
also be two or more keys, separated by commas.
environment need two compilations. In the ¬rst compilation it will generate ¬le with aux
1 Bibiliography

extension, where citation and bibcite will be marked and in the second compilation \cite will be replaced
by numeral or author-year code.
2 Key can be any sequence of letters, digits and punctuation characters, except that it may not contain a

comma (maximum 256 characters).


27
28 BIBLIOGRAPHY
III.


\cite{key1} \cite{key1,key2}

In bibliography, numbering of the entries is generated automatically. You may also add
a note to your citation, such as page number, chapter number etc. by using an optional
argument to the \cite command. Whatever text appears in this argument will be placed
within square brackets, after the label.
\cite[page˜25]{key1}

See below an example of bibliography and citation. The following code
It is hard to write unstructured and disorganised documents using
\LaTeX˜\cite{les85}.It is interesting to typeset one
equation˜\cite[Sec 3.3]{les85} rather than setting ten pages of
running matter˜\cite{don89,rondon89}.

\begin{thebibliography}{9}
\bibitem{les85}Leslie Lamport, 1985. \emph{\LaTeX---A Document
Preparation System---User™s Guide and Reference Manual},
Addision-Wesley, Reading.


\bibitem{don89}Donald E. Knuth, 1989. \emph{Typesetting Concrete
Mathematics}, TUGBoat, 10(1):31-36.


\bibitem{rondon89}Ronald L. Graham, Donald E. Knuth, and Ore
Patashnik, 1989. \emph{Concrete Mathematics: A Foundation for
Computer Science}, Addison-Wesley, Reading.
\end{thebibliography}


produces the following output:

It is hard to write unstructured and disorganised documents using LTEX [1]. It is interesting to
A

typeset one equation [1, Sec 3.3] rather than setting ten pages of running matter [2,3].

Bibliography
[1] Leslie Lamport, 1985. LTEX”A Document Preparation System”User™s Guide and Refer-
A

ence Manual, Addision-Wesley, Reading.
[2] Donald E. Knuth, 1989. Typesetting Concrete Mathematics, TUGBoat, 10(1):31-36.
[3] Ronald L. Graham, Donald E. Knuth, and Ore Patashnik, 1989. Concrete Mathematics:
A Foundation for Computer Science, Addison-Wesley, Reading.



III.2. NATBIB

The natbib package is widely used for generating bibliography, because of its ¬‚exible
interface for most of the available bibliographic styles. The natbib package is a re-
implementation of the LTEX \cite command, to work with both author“year and nu-
A

merical citations. It is compatible with the standard bibliographic style ¬les, such as
plain.bst, as well as with those for harvard, apalike, chicago, astron, authordate, and
of course natbib. To load the package; use the command.
\usepackage[options]{natbib}
29
III.2. NATBIB


Options for natbib
III.2.1.

(default) for round parentheses
round
for square brackets
square
for curly braces
curly
for angle brackets
angle
(default) to separate multiple citations with colons
colon
to use commas as separators
comma
(default) for author“year citations
authoryear
for numerical citations
numbers
for superscripted numerical citations, as in Nature
super
orders multiple citations into the sequence in which they
sort
appear in the list of references
as sort but in addition multiple numerical citations are
sort&compress
compressed if possible (as 3“6, 15)
makes the ¬rst citation of any reference the equivalent
longnamesfirst
of the starred variant (full author list) and subsequent
citations normal (abbreviated list)
rede¬nes \thebibliography to issue \section* instead of
sectionbib
\chapter*; valid only for classes with a \chapter com-
mand; to be used with the chapterbib package
keeps all the authors™ names in a citation on one line;
nonamebreak
causes overfull hboxes but helps with some hyperref
problems.
You can set references in the Nature style of citations (superscripts) as follows
\documentclass{article}
\usepackage{natbib}
\citestyle{nature}
\begin{document}
.......
.......
\end{document}


Basic commands
III.2.2.

The natbib package has two basic citation commands, \citet and \citep for textual
and parenthetical citations, respectively. There also exist the starred versions \citet*
and \citep* that print the full author list, and not just the abbreviated one. All of these
may take one or two optional arguments to add some text before and after the citation.
Normally we use author name and year for labeling the bibliography.
\begin{thebibliography}{widest-label}
\bibitem{Leslie(1985)}{les85}Leslie Lamport, 1985.
\emph{\LaTeX---A Document Preparation}...
\bibitem{Donale(00)}{don89}Donald E. Knuth, 1989.
\emph{Typesetting Concrete Mathematics},...
\bibitem{Ronald, Donald and Ore(1989)}{rondon89}Ronald L. Graham, ...
\end{thebibliography}

Year in parentheses is mandatory in optional argument for bibitem. If year is missing
in any of the bibitem, the whole author“year citation will be changed to numerical cita-
tion. To avoid this, give ˜(0000)™ for year in optional argument and use partial citations
(\citeauthor) in text.
30 BIBLIOGRAPHY
III.


Don™t put ˜space character™ before opening bracket of year in optional argument.

Alex et al. (1991)

\citet{ale91}
Alex et al. (1991, chap. 4)

\citet[chap.˜4]{ale91}
(Alex et al., 1991)

\citep{ale91}
(Alex et al., 1991, chap. 4)

\citep[chap.˜4]{ale91}
(see Alex et al., 1991)

\citep[see][]{ale91}
(see Alex et al., 1991, chap. 4)
\citep[see][chap.˜4]{jon91} ’
Alex, Mathew, and Ravi (1991)

\citet*{ale91}
(Alex, Mathew, and Ravi, 1991)

\citep*{ale91}


Multiple citations
III.2.3.

Multiple citations may be made as usual, by including more than one citation key in the
\cite command argument.


Alex et al. (1991); Ravi et al. (1992)

\citet{ale91,rav92}
(Alex et al., 1991; Ravi et al. 1992)

\citep{ale91,rav92}
(Alex et al., 1991, 1992)

\citep{ale91,ale92}
(Alex et al., 1991a,b)

\citep{ale91a,ale91b}


Numerical mode
III.2.4.

These examples are for author“year citation mode. In numerical mode, the results are
different.

Alex et al. [5]

\citet{ale91}
Alex et al. [5, chap. 4]

\citet[chap.˜4]{ale91}
[5]

\citep{ale91}
[5, chap. 4]

\citep[chap.˜4]{ale91}
[see 5]

\citep[see][]{ale91}
[see 5, chap. 4]
\citep[see][chap.˜4]{ale91} ’
[5, 12]

\citep{ale91a,ale91b}




Suppressed parentheses
III.2.5.

As an alternative form of citation, \citealt is the same as \citet but without any paren-
theses. Similarly, \citealp is \citep with the parentheses turned off. Multiple references,
notes, and the starred variants also exist.

Alex et al. 1991

\citealt{ale91}
Alex, Mathew, and Ravi 1991

<< . .

. 4
( : 23)



. . >>