BibTex

From Liki

Jump to: navigation, search

BibTeX is a good way to keep track of the paper's you've read for easy citing in LaTeX documents[1].

There is a cookbook-style explaination here.

The advantage to BibTeX is having a centralized citation database that can be used with all your documents. When citing references in a specific work, only those references cited will put into the bibliography. You can still specify the bibliography style individually in each article to conform the the standards of wherever you are submitting the article.

Contents

[edit] BibTeX Citation Examples

The basic layout of a .bib entry is

@Type{citation_name,
field={value},
field={value},
...
field={value}
}

We begin with the '@' symbol followed by the type of reference, such as Book or Article. Then a curly brace and 'citation_name' is what will identify this citation reference in your article (\cite{citation_name}). Then we have a list of field and values as indicated. A comma separates each item in the list. The final field value pair has no trailing comma. We then end with a curly brace.

Here we list two self-explanatory examples for making reference in your .bib file:

@Book{Gil02,
author={R. Gilmore and M. Lefranc},
title={The Topology of Chaos},
year={2002},
publisher = {Wiley}
}

@Article{Sol88,
author={H. G. Solari and R. Gilmore},
title={Relative rotation rates for driven dynamical systems},
journal={Phys. Rev. A},
volume={37},
pages={3096-3109},
year={1988}
}

Other fields are possible as specified in the resources at the top of the page. Note that multiple authors should be separated by 'and' and a comma cannot be so used. "R. Gilmore" and "Gilmore, R." are interpreted the same in BibTeX. The bibliography style chosen decides which fields to use and how when making the bibliography. Extraneous fields will simply be ignored (and you will be warned by BibTeX if you have insufficient fields).

[edit] Using BibTeX in your Document

Suppose you have a BibTeX file named 'references.bib' (Note, the name of the .bib file can be completely different from the name of your latex document). Then, to make a bibliography in your article you will have

\bibliographystyle{style}
\bibliography{references}

at the place in your article where you want the bibliography to appear. The word 'style' should be substituted with whatever bibliography style you are using, such as 'unsrt' for unsorted or 'prsty' for Physical Review style. The word 'references' is to match the name of the .bib file you are using.

In order to correctly compile your LaTeX document (here, paper.tex) after any change of citations in the docuemnt you need to follow the following 4 step procedure:

1. latex paper   - generate paper.aux with needed citation info
2. bibtex paper  - extracts from .bib based on .aux to create .bbl
3. latex paper   - inserts citations from .bbl into document
4. latex paper   - makes sure all citations are correct and consistent

Latexing the paper multiple times is really only necessary when there are changes to the citations in a paper. If you add a reference you will always need this 4 step procedure. If you simply move a citation around, or add another citation to paper already cited in the paper, you can skip 1 and 2 and just latex the paper twice. If no changes are made to citations, a single latex should be sufficient. Note that if you change internal references in the paper such as figures or tables you will still have to latex twice for cross-referencing issues.

[edit] Tips and Tricks

[edit] Many Authors and et. al.

Bibliography styles have a pre-determined cut off when they start turning multiple authors into an et. al., which is usually 8. If you have an article with many, many authors and wish to make the et. al. yourself, the appropriate way to do this is

author={Joe Schmoe and others},

using the 'others' keyword.

[edit] Bibliography Entry without Citation

Sometimes you want something in your bibliography that is not explicitly cited in your work (a consulted rather than cited reference). Since BibTeX only adds cited entries to the bibliography, what to do? This is what \nocite is for:

\nocite{ref}

This will add 'ref' to the aux file and subsequent bbl file so that the entry will appear in the bibliography, but no actual citation will appear in the article.

[edit] Additional control

For more elaborate citation control than the standard \cite{} allows, have a look at the natbib package. The main idea is to have different commands for in-text and parenthetical citations ('Einstein (1905)' vs '(Einstein 1905)'), but there are lots of other goodies. The most important feature for me was the inclusion of URL and DOI fields from the bibtex entry in the basic citation styles (plainnat, etc.).

[edit] BibTeX internals

If you want to get a better feeling for what's going on inside BibTeX, checkout Nicolas Markey's excellent Tame the BeaST tutorial. This is useful if the bst file provided by your journal is broken and you want to fix it...

[edit] See Also