latex/workbook/bibtex.rst
author Puneeth Chaganti <punchagan@fossee.in>
Mon, 31 Jan 2011 17:12:36 +0530
changeset 152 ac12270f8fdf
parent 107 80a8b46754f8
permissions -rw-r--r--
vcs: Introduce commit with -u and -m parameters commit is now introduced with -u and -m parameters. This fixes a couple of problems -- 1) hg sometimes doesn't allow commits without username 2) vi(m) is the default editor -- most people can't use it (yet).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
107
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
BibTeX
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
~~~~~~
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
The previous section explained the process of listing references at the end of a document and embedding cross references. In this section let us explore the BibTeX environment for keeping track of references.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
Using BibTeX is a very convenient method to use, when writing multiple documents in a single area or field. BibTeX allows you to create a database of all your references and use them as and when required. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
The BibTeX database is stored in a ``.bib`` file. The structure of the file is quite simple and an example is shown below. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
::
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
  @book{Lamport94,
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
  author    = "Leslie Lamport",
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
  title     = "A Document Preparation System: User's Guide and Reference",
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
  publisher = "Addison-Wesley Professional",
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
  year      = "1994",
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
  edition    = "second",
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
  note      = "illustrations by Duane Bibby"
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
  }
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
Each bibliography entry starts with a declaration of the type of the reference being mentioned. The reference is in the above example is of the book type. BibTeX has a wide range of reference types, for example, ``article, book, conference, manual, proceedings, unpublished``.
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
The type of reference is followed by a left curly brace, and immediately followed by the citation key. The citation key, ``Lamport94`` in the example above is used to cite this reference using the command ``\cite{Lamport94}``. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    24
This is followed by the relevant fields and their values, listed one by one. Each entry must be followed by a comma to delimit one field from the other. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    26
To get your LaTeX document to use the bibliography database, you just add the following lines to your LaTeX document. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    27
::
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
  \bibliographystyle{plain}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    30
  \bibliography{LaTeX}
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
Bibliography styles are files that tell BibTeX how to format the information stored in the ``.bib`` database file. The style file for this example is ``plain.bst``. Note that you do not need to add the ``.bst`` extension to the filename.  If you wish to achieve a particular style of listing the bibliography items and citing them, you should use an appropriate style file. 
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    33
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    34
The ``bibliography`` command specifies the file that should be used as the database for references. The file used in this example is ``LaTeX.bib``
80a8b46754f8 Added lab workbook and related files.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    35