LaTeX/Bibliography Management

De LaTeX
Aller à : navigation, rechercher

Embedded system

If you are writing only one or two documents and aren't planning on writing more on the same subject for a long time, maybe you don't want to waste time creating a database of references you are never going to use. In this case you should consider using the basic and simple bibliography support that is embedded within LaTeX.

LaTeX provides an environment called thebibliography that you have to use where you want the bibliography; that usually means at the very end of your document, just before the \end{document} command. Here is a practical example:

The \LaTeX system~\cite{lamport94} is set of macros for the \TeX engine.

\begin{thebibliography}{9}
 \bibitem{lamport94}
  Leslie Lamport,
  \emph{\LaTeX: A Document Preparation System}.
  Addison Wesley, Massachusetts,
  2nd Edition,
  1994.
\end{thebibliography
}
will be displayed with numbered references:

The LaTeX system [1] is set of macros for the TeX engine.

Now if you add an optional argument to bibitem (\bibitem[(Lamport 1994)]{lamport94}, it will be used both in the text as well as in the bibliography.

The LaTeX system (Lamport 1994) is a set of macros for the TeX engine.

OK, so what is going on here? The first thing to notice is the establishment of the environment. thebibliography is a keyword that LaTeX recognizes as everything between the begin and end tags as being data for the bibliography. The optional argument, which I supplied after the begin statement, is telling LaTeX how wide the item label will be when printed. Note however, that it is not a literal parameter, i.e the number 9 in this case, but a text width. Therefore, I am effectively telling LaTeX that I will only need reference labels of one character in width, which means no more than nine references in total. If you want more than ten, then input a two-digit number, such as '99' which permits fewer than 100 references.

Next is the actual reference entry itself. This is prefixed with the \bibitem{cite_key} command. The cite_key should be a unique identifier for that particular reference, and is often some sort of mnemonic consisting of any sequence of letters, numbers and punctuation symbols (although not a comma). I often use the surname of the first author, followed by the last two digits of the year (hence lamport94). If that author has produced more than one reference for a given year, then I add letters after, 'a', 'b', etc. But, you should do whatever works for you. Everything after the key is the reference itself. You need to type it as you want it to be presented. I have put the different parts of the reference, such as author, title, etc., on different lines for readability. These linebreaks are ignored by LaTeX. I wanted the title to be in italics, so I used the \emph{} command to achieve this.

Citations

To actually cite a given document is very easy. Go to the point where you want the citation to appear, and use the following: \cite{cite_key}, where the cite_key is that of the bibitem you wish to cite. When LaTeX processes the document, the citation will be cross-referenced with the bibitems and replaced with the appropriate number citation. The advantage here, once again, is that LaTeX looks after the numbering for you. If it were totally manual, then adding or removing a reference would be a real chore, as you would have to re-number all the citations by hand.

Instead of WYSIWYG editors, typesetting systems like \TeX{} or \LaTeX{} \cite{lamport94} can be used.

Referring More Specific

Sometimes you want to refer to a certain page, figure or theorem in a text book. For that you can use the arguments to the \cite command:

\cite[p.~215]{citation01}

The argument, "p. 215", will show up inside the same brackets. Note the tilde in [p.~215], which replaces the end-of-sentence spacing with a non-breakable inter-word space. There are two reasons: end-of-sentence spacing is too wide, and "p." should not be separated from the page number.

Multiple Citations

When a sequence of multiple citations are needed, you should use a single \cite{} command. The citations are then separated by commas. Note that you must not use spaces between the citations. Here's an example:

\cite{citation01,citation02,citation03}

The result will then be shown as citations inside the same brackets.

No Cite

If you only want a reference to appear in the bibliography, but not where it is referenced in the main text, then the \nocite{} command can be used, for example:

Lamport showed in 1995 something...  \nocite{lamport95}.

A special version of the command, \nocite{*}, includes all entries from the database, whether they are referenced in the document or not.


Using BibTeX

The bibliography which is contained within the \begin{thebibliography} and \end{thebibliography} can be generated automatically by a second engine, the so-called BibTeX engine.

In fact, bibtex is able to read the cite keys which have been referenced in the text by \cite{cite_key}, and to generate the formatted bibliography by accessing to the complete reference (title, authors, year, journal etc.) which is stored with other references in a .bib bibliography file. The name of the bibliography file(s) are given as arguments of the command \bibliography{aids,disability} which also stipulates where the bibliography section must start.

A specific bibliography style (.bst files) can be specified by the order \bibliographystyle{apalike} if you like the apa style.

Once the LaTeX command is run on the latex file, say latex foo.tex (or latex foo), references as well as styles and bibliography files names, are stored in an auxiliary file named foo.aux .

The action of the bibtex foo.aux or bibtex foo command is to read the .aux file, and scan for any citation while fetching the complete reference in the bibliography databases. The output is a file named foo.bbl which corresponds to the thebibliography environment.

If latex is run a second time, the .bbl file is incorporated into the PDF output file.


Using a specific BibTeX file to create a bibliography

Create a BibTeX file

You can put all your references into a separate file. Save them in a .bib (as "mybiblio.bib" ) in the same folder than your main LaTeX file. A BibTeX file contains references to text of various kinds. In the following example, the description of the Vikat2007 article starts with the @article{Vikat2007, and ends with right bracket. A second article is then described.

@article{Vikat2007,
        Author = {Solaz, A.},
        Doi = {10.4054/DemRes.2007.17.14},
        Journal = {Demographic Research},
        Number = {14},
        Pages = {389-440},
        Title = {Generation and Gender Survey (GGS): Towards a better understanding of relationships and processes in the life course},
        Volume = {17},
        Year = {2007},
        Bdsk-Url-1 = {http://dx.doi.org/10.4054/DemRes.2007.17.14}}


@article{Régnier-Loilier2006,
author = {Régnier-Loilier, A.},
title= {How often do adult children see their parents?},
year = {2006},
URL = {http://www.ined.fr/fichier/t_publication/1211/publi_pdf2_pop.and.soc.english.427.pdf},
journal = {Population & Societies},
volume = {427},
}

The BibTeX format has evolved since the mid 80's and is currently used by many softwares, databases and servers. In the mid 80's URL as well as doi did not exist and are now very common; that's the reason for the inclusion in most modern BiBTeX files. But many fields are proprietary fields added by database specific to scientific reviews as well as scientific databases like JStor. The are treated as comments by BibTeX.

You can also add your own field.

It is very rare to enter manually the various fields required to specify an article and you will use a software which will help you fill the mandatory fields (author, title, year) as well as the optional fields.

It can be a software like jabref which will be discussed later as well as Web services like Zotero or Mendeley or Bibsonomy.

Standard templates

@article 
An article from a magazine or a journal.
  • Required fields: author, title, journal, year.
  • Optional fields: volume, number, pages, month, note.
@article{Xarticle,
    author    = "",
    title     = "",
    journal   = "",
    %volume   = "",
    %number   = "",
    %pages    = "",
    year      = "XXXX",
    %month    = "",
    %note     = "",
}
@book 
A published book
  • Required fields: author/editor, title, publisher, year.
  • Optional fields: volume/number, series, address, edition, month, note.
@book{Xbook,
    author    = "",
    title     = "",
    publisher = "",
    %volume   = "",
    %number   = "",
    %series   = "",
    %address  = "",
    %edition  = "",
    year      = "XXXX",
    %month    = "",
    %note     = "",
}
@booklet 
A bound work without a named publisher or sponsor.
  • Required fields: title.
  • Optional fields: author, howpublished, address, month, year, note.
@booklet{Xbooklet,
    %author   = "",
    title     = "",
    %howpublished   = "",
    %address  = "",
    year      = "XXXX",
    %month    = "",
    %note     = "",
}
@conference 
Equal to inproceedings
  • Required fields: author, title, booktitle, year.
  • Optional fields: editor, volume/number, series, pages, address, month, organization, publisher, note.
@conference{Xconference,
    author    = "",
    title     = "",
    booktitle = "",
    %editor   = "",
    %volume   = "",
    %number   = "",
    %series   = "",
    %pages    = "",
    %address  = "",
    year      = "XXXX",
    %month    = "",
    %publisher= "",
    %note     = "",
}
@inbook 
A section of a book without its own title.
  • Required fields: author/editor, booktitle, chapter and/or pages, publisher, year.
  • Optional fields: volume/number, series, type, address, edition, month, note.
@incollection 
A section of a book having its own title.
  • Required fields: author, title, booktitle, publisher, year.
  • Optional fields: editor, volume/number, series, type, chapter, pages, address, edition, month, note.
@inproceedings 
An article in a conference proceedings.
  • Required fields: author, title, booktitle, year.
  • Optional fields: editor, volume/number, series, pages, address, month, organization, publisher, note.
@manual 
Technical manual
  • Required fields: title.
  • Optional fields: author, organization, address, edition, month, year, note.
@mastersthesis 
Master's thesis
  • Required fields: author, title, school, year.
  • Optional fields: type (eg. "diploma thesis"), address, month, note.
@mastersthesis{Xthesis,
    author    = "",
    title     = "",
    school    = "",
    %type     = "diploma thesis",
    %address  = "",
    year      = "XXXX",
    %month    = "",
    %note     = "",
}
@misc 
Template useful for other kinds of publication
  • Required fields: none
  • Optional fields: author, title, howpublished, month, year, note.
@misc{Xmisc,
    %author    = "",
    %title     = "",
    %howpublished = "",
    %year     = "XXXX",
    %month    = "",
    %note     = "",
}
@phdthesis 
Ph.D. thesis
  • Required fields: author, title, year, school.
  • Optional fields: address, month, keywords, note.
@proceedings 
The proceedings of a conference.
  • Required fields: title, year.
  • Optional fields: editor, volume/number, series, address, month, organization, publisher, note.
@techreport 
Technical report from educational, commercial or standardization institution.
  • Required fields: author, title, institution, year.
  • Optional fields: type, number, address, month, note.
@techreport{Xtreport,
    author    = "",
    title     = "",
    institution = "",
    %type     = "", 
    %number   = "",
    %address  = "",
    year      = "XXXX",
    %month    = "",
    %note     = "",
}
@unpublished 
An unpublished article, book, thesis, etc.
  • Required fields: author, title, note.
  • Optional fields: month, year.

BiBTeX styles for reviews

Economic reviews

You can access to some bibliographic styles specific to economic reviews at the URL http://www.ctan.org/tex-archive/biblio/bibtex/contrib/economic

The README file should be read first.

For the springer journals, you can access to the Instruction for authors at the following URL: http://www.springer.com/cda/content/document/cda_downloaddocument/LaTeX.zip?SGWID=0-0-45-468198-0

Using JabRef to manage your bibliography

JabRef is an open source bibliography reference manager written in Java. It lets you manage your .bib bibliography files as well as fetch references on many public like Medline or private like Jstor or Science direct databases on the Internet.

Once you clicked on Jabref, you need to open a new .bib file in order to start fetching.

Fetching Medline

MEDLINE is the U.S. National Library of Medicine's premier bibliographic database. It contains references to journal articles in life sciences with a concentration on biomedicine.

JabRef can download citations from the Medline database. To use this feature, choose Web search -> Fetch Medline, and the Medline interface will appear in the side pane.

There are two ways of specifying which entries to download:

Enter one or more Medline IDs (separated by comma/semicolon) in the text field.
Enter a set of names and/or words to search for. You can use the operators and and or and parentheses to refine your search expression.
Examples:
Brouard [au] AND Pontone [au]
Anderson RM [au] HIV [ti]
Valleron [au] 1988:2000[dp] HIV [ti]
Valleron [au] AND 1987:2000[dp] AND (AIDS [ti] OR HIV[ti])
Anderson [au] AND Nature [ta]
Population [ta]

In both cases, press Enter or the Fetch button.

If you use a text search, you will be prompted with the number of entries found, and given a choice of how many to download. They are usually numerous and you can limit your selection by specifying an author [au] a title ti, a date of publication dp or a journal ta as well as any other descriptor of Medline.

Within your new window including the result of your selection, you can refine by examining each entry and selecting/unselecting them.

The entries fetched and selected will be added to your currently active database.

Examining the BibTeX field of a reference

An important feature of Jabref is to verify the source code of a reference, by clicking on BibTeX -> Edit entry (or CTRL_e on Windows and cmd_e on OS/X). A BibTeX key, just after @article{, must not be empty. Please fill it: @article{Anderson-May-Nature, or ask jabref to generate once (you can speficify to jabref how to create bibtex keys in your preferences. You can also verify by clicking on the Required fields that they are all filled otherwise the bibtex program will complain.

In the General tab you can look at the File row and click on the + in order to let you access the pdf file (stored on your hard disk) corresponding to the article.

Erreur lors de la création de la miniature : Impossible d'enregistrer la vignette sur la destination



Insert your BiBTeX file into your main file

You just need to insert into your main LaTeX:

\bibliography{mybiblio}


You can choose a specific style:

\bibliographystyle{econometrica-fr}
\bibliography{mybiblio
}


Previous: Presentations Index Next: Tables