Overleaf Bibliography For Websites

When it comes to bibliography management in LaTeX the program natbib is an alternative used in several journals. The program is not actively developed, but is very stable and widely used. This article explains how to use natbib to format and cite bibliographic sources.

Note: If you are starting from scratch it's recommended to use biblatex since that package provides localization in several languages, it's actively developed and makes bibliography management easier and more flexible.

[edit]Introduction

A minimal working example is presented below:

\documentclass{article}\usepackage[utf8]{inputenc}\usepackage[english]{babel}   \usepackage{natbib}\bibliographystyle{unsrtnat}   \title{Bibliography management: \texttt{natbib} package}\author{Share\LaTeX}\date{}   \begin{document}   \maketitle   This document is an example of \texttt{natbib} package using in bibliography management. Three items are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}.   \medskip   \bibliography{sample}   \end{document}

In this example there are four basic commands to manage the bibliography:

Imports the package natbib.
Sets the bibliography style unsrtnat. See the article about bibliography styles for more information.
Prints a reference to the citation entry, what is printed depends on the citation style. The word inside the braces corresponds to a particular entry in the bibliography file.
Imports the file sample.bib that contains bibliography sources. See the bibliography file section.

  Open an example of the natbib package in ShareLaTeX

[edit]Basic usage

A simple working example was shown at the introduction, there are more bibliography-related commands available.

\documentclass{article}\usepackage[utf8]{inputenc}\usepackage[english]{babel}   \usepackage[square,numbers]{natbib}\bibliographystyle{abbrvnat}   \title{Bibliography management: \texttt{natbib} package}\author{Share\LaTeX}\date{}   \begin{document}   \maketitle   This document is an example of \texttt{natbib} package using in bibliography management. Three items are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Einstein journal paper \citet{einstein}, and the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}.   \medskip   \bibliography{sample}   \end{document}

There are a few changes in this example:

  • The options and in enable squared brackets and numeric citations respectively. See the reference guide for a list of package options
  • The command adds the name of the author to the citation mark, regardless of the citation style.

  Open an example of the natbib package in ShareLaTeX

[edit]The bibliography file

The bibliography files must have the standard bibtex syntax and the extension .bib. They contain a list of bibliography sources and several fields with information about each entry.

This file contains records in a special format, for instance, the first bibliographic reference is defined by:

This is the first line of a record entry, tells BibTeX that the information stored here is about an article. The information about this entry is enclosed within braces. Besides the entry types shown in the example (, and there are a lot more, see the reference guide.
The label is assigned to this entry, is a unique identifier that can be used to refer this article within the document.
This is the first field in the bibliography entry, indicates that the author of this article is Albert Einstein. Several comma-separated fields can be added using the same syntax , for instance: title, pages, year, URL, etc. See the reference guide for a list of possible fields.

The information in this file can later be printed and referenced within a LaTeX document, as shown in the previous sections, with the command . Not all the information in the .bib file will be displayed, it depends on the bibliography style set in the document.

  Open an example of the natbib package in ShareLaTeX

[edit]Adding the bibliography in the table of contents

If you want the bibliography to be included in the table of contents, importing the package tocbibind in the preamble will do the trick:

\documentclass[a4paper,10pt]{article}\usepackage[utf8]{inputenc}\usepackage[english]{babel}   \usepackage[nottoc]{tocbibind}   \begin{document}   \tableofcontents   \section{First Section} This document ...   \bibliographystyle{unsrt}\bibliography{sample}   \end{document}

Adding the line


to the preamble will print the "References" or "Bibliography" in the table of contents, depending on the document type. Be careful, it will also add other elements like the Index, Glossary and list of Listings to the table of contents. For more information see the tocbibind package documentation.

  Open an example of the natbib package in ShareLaTeX

[edit]Reference guide

natbib package options

  • for round parentheses
  • uses square brackets
  • curly braces
  • angle braces or chevrons
  • separates multiple citations with semicolons
  • same as
  • separate multiple citations with commas
  • for author-year citations
  • for numerical citations
  • superscripts for numerical citations, as in Nature
  • orders multiple citations according to the list of references
  • same as but multiple numerical citations are compressed if possible
  • compress without sorting
  • the full name of the author will appear in the first citation of any reference
  • To be used with the package chapterbib to add the bibliography to the table of contents as a unnumbered section instead of an unnumbered chapter
  • prevents hyphenation of author names
  • to omit common elements of merged references

Standard entry types

Article from a magazine or journal
A published book
A work that is printed but have no publisher or sponsoring institution
An article in a conference proceedings
A part of a book (section, chapter and so on)
A part of a book having its own title
An article in a conference proceedings
Technical documentation
A Master's thesis
Something that doesn't fit in any other type
A PhD thesis
The same as
Report published by an institution
Document not formally published, with author and title


Most common fields used in BibTeX

address annote author
booktitle chaper crossref
edition editor institution
journal key month
note number organization
pages publisher school
series title type
volume year URL
ISBN ISSN LCCN
abstract keywords price
copyright language contents

[edit]Further reading

For more information see

@article{einstein, author = "Albert Einstein", title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) [{On} the electrodynamics of moving bodies]", journal = "Annalen der Physik", volume = "322", number = "10", pages = "891--921", year = "1905", DOI = "http://dx.doi.org/10.1002/andp.19053221004" }   @book{latexcompanion, author = "Michel Goossens and Frank Mittelbach and Alexander Samarin", title = "The \LaTeX\ Companion", year = "1993", publisher = "Addison-Wesley", address = "Reading, Massachusetts" }   @misc{knuthwebsite, author = "Donald Knuth", title = "Knuth: Computers and Typesetting", url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html" }
\usepackage[nottoc]{tocbibind}

I wrote this guide because I had many references in EndNote that I wanted to use in my LaTeX documents. I had to figure all this out the hard way — by lots of trial and error, if you follow this guide it should be easy for you. There are a few points to make: I have used every EndNote version since 4, but when I did my thesis I used version 9. This guide should work for other versions, unless Endnote have drastically changed something. I also use MikTeX and WinEdt on Windows. I don't have a clue about other configurations but they should still work with this guide.

In LaTeX use natbib. It is by far the best referencing package. Put '''' in your header. Then in your document where you want the Bibliograpy to appear add:

\bibliographystyle{plainnat} \bibliography{name of your bib file}

I find plainnat pretty ugly so I wrote a better one bevbib4 you can use this, or write your own with custombib. Note that you don't type in the file name extension in the LaTeX document. For all this to work you need a unique ID for every paper you cite, it is best to be consistent and keep it simple, for example my unique ID for one of my papers is Weir04. This will print out as (Weir et al., 2004) [depending on the style used of course]. Your entries in your bib file should look like this:

@article{Weir04, Author = {Weir, B. S. and Turner, S. J. and Silvester, W. B. and Park, D.-C. and Young, J. M.}, Title = {Unexpectedly diverse \emph{Mesorhizobium} strains and \emph{Rhizobium leguminosarum} nodulate native legume genera of New Zealand, while introduced legume weeds are nodulated by \emph{Bradyrhizobium} species}, Journal = {Applied and Environmental Microbiology}, Volume = {70}, Number = {10}, Pages = {5980-5987}, Year = {2004} }

Now the guide begins. I assume you have an EndNote database (*.enl), back this up before continuing.

Preparing EndNote

  • To use my file "BibTeX_Export-custom.ens" you need to make these changes below. Or you can use the default file "BibTeX_Export.ens" (that I have made a couple of changes to) but you will need to use the "Label" field to type your unique ID. This may conflict with some websites that export references.
  • In EndNote go to: Edit -> Preferences -> Reference types.
  • For each type of reference you use click "modify reference types" scroll down and add "BibTeX" under the "custom 1" field. (don't do this bit if you are using the "Label" version).
  • Go to "display fields" and make Column 4 to display "Custom1" give it the title "BibTeX" (if you are using the Label version make the Column show "Label").
  • Go back to view your library. When you edit a reference by double clicking, a new field will appear (near the bottom) called "BibTeX" (or "Label"). In this field you type the unique ID (i.e. Weir04). Alternatively if you have a huge database you could use "Jabref" to automatically add these to your final BibTeX database. This software is also generally useful for managing your data once in BibTeX format.

Export the file as a BibTeX (*.bib) database

  1. Get my export filter style (Label version)or export filter style (Custom1 version) and save in the "Styles" directory of EndNote. Then select that file using the style manager in: Edit -> Output Styles. Make sure this style is selected in the main view window.
  2. Go to: File -> Export. Save the file as a text (*.txt) file. Move this file to your LaTeX directory you are working with and rename to a *.bib file.
  3. Now when you cite a reference use the command or to get a parenthesis or text citation respectively (just try it out to see what happens).
  4. Run LaTeX or pdfTeX on your file twice then run bibtex then LaTeX or pdfTeX again a few times. Repeat if required. Or just use Texify. You should only have to run BibTeX again if you make a new *.bib file.
  5. With some luck the citation should be inserted and referenced at the end.

The fiddly bit is going back to those references and using proper LaTeX commands where necessary i.e. using (type this into the EndNote field) . This will of course look like rubbish if you use the same EndNote database for MS Word documents. I keep two databases.

Notes on using the Style file

  • For electronic references I used the "book" reference type, and in the notes field add the url in this form: "" . Yes this is a hack. The note field in other reference types will not be used (see below).
  • When you add authors make sure they are in this format: "Sandberg, A. M." note the spaces, this is important. You can use full names (see below), but again: spaces.
  • Don't worry about en-dashes in the page ranges, this is taken care of automatically.
@book{Irwin05, Author = {Irwin, Geoff and Walrond, Carl}, Title = {When was New Zealand first settled?}, Publisher = {Ministry for Culture and Heritage}, Address = {Wellington}, Series = {Te Ara -- The Encyclopedia of New Zealand}, Note = {URL: \url{http://www.TeAra.govt.nz/NewZealanders/MaoriNewZealanders/WhenWasNewZealandFirstSettled/en}}, Year = {2005} }

EndNote Export was not listed on your Output Styles menu?

If "EndNote Export" is not listed in the Edit -> Output Styles menu:

  • Select Open Style Manager.
  • Find the "EndNote Export" style and check it ON. Close this window.
  • Make sure that "EndNote Export" is now checked in the Edit -> Output Styles menu.
  • Select the references you want to transfer.
  • Choose File -> Export. Make sure you are exporting the references as Text file Only, then click on OK.

Thanks to Nora Lieske for this tip.

Other Websites

The information on this page may not be exactly what you are looking for, some other websites which might be of help are:

Citation

Weir, B.S. (2012) Step-by-step guide to using EndNote with LaTeX and BibTeX. NZ Rhizobia website. http://www.rhizobia.co.nz/latex/convert
Categories: 1

0 Replies to “Overleaf Bibliography For Websites”

Leave a comment

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *