Wednesday, April 07, 2010

Correct Citation with Latex and BibTex

Starting with LaTeX can be a very annoying and quite time consuming process, but when you finally have your environment up and running (MAC or Windows)you probably notice that there is no need to have a word processor on your machine anymore (except for compliance to others).

As I'm a programmer Eclipse is already on my computer, so the choice of my editorial environment felt to that in combination to TexLipse but the hints below work for every environment.

Let's imagine for a moment that you want to cite in your text the book named "Secure Programming with Static Analysis". So the first step is to create an empty file called "myReferences.bib" (or something else with extension .bib). Now you need to find the correct citation entry for that book, which is usually done using some specialized web sites. In the area of Computer science there are at least the once below offering this service

Google Scholar simplifies this task because it is aware of most of the websites listed above and therefore it lists in first place for the book we are looking for the corresponding website of

From there it is possible to get the correct citation for the book which is:

 Address = {Erewhon},
 Author = {Chess, Band West, J.},
 Edition = {1.ed.},
 Isbn = {0321424778},
 Publisher = {Addison Wesley Professional},
 Title = {Secure Programming with Static Analysis},
 Year = {2007}}

This citation can now be copied into the .bib file created beforehand.
The last steps to make it visible in the LaTeX document are to add the style and bibliography to the document as follows:

\bibliographystyle{plain}    % (uses file "plain.bst")
\bibliography{myReferences}  % expects file "myReferences.bib"

and to cite it somewhere in the text as follows:

[..]from the book \cite{Chess2007spw}.

And that's it basically

No comments: