latex/workbook/bibtex.rst
changeset 107 80a8b46754f8
equal deleted inserted replaced
106:43ca1381dbef 107:80a8b46754f8
       
     1 BibTeX
       
     2 ~~~~~~
       
     3 
       
     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.
       
     5 
       
     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. 
       
     7 
       
     8 The BibTeX database is stored in a ``.bib`` file. The structure of the file is quite simple and an example is shown below. 
       
     9 ::
       
    10 
       
    11   @book{Lamport94,
       
    12   author    = "Leslie Lamport",
       
    13   title     = "A Document Preparation System: User's Guide and Reference",
       
    14   publisher = "Addison-Wesley Professional",
       
    15   year      = "1994",
       
    16   edition    = "second",
       
    17   note      = "illustrations by Duane Bibby"
       
    18   }
       
    19 
       
    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``.
       
    21 
       
    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}``. 
       
    23 
       
    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. 
       
    25 
       
    26 To get your LaTeX document to use the bibliography database, you just add the following lines to your LaTeX document. 
       
    27 ::
       
    28 
       
    29   \bibliographystyle{plain}
       
    30   \bibliography{LaTeX}
       
    31 
       
    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. 
       
    33 
       
    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``
       
    35