# Latex Begin The Bibliography Of Barack

0 Comments / 1 / By

## Overview

There are two methods for creating a bibliography. The first can be used for short documents with only a few sources, and is fairly simple. The second method is used for large documents and theses, and involves using a program called "bibtex".

## Simple method

If all of this seems complicated, there is a simpler way to produce a quick bibliography for your document. This can be used for smaller papers, ones that don't need a very extensive bibliography. Something like this will work fine:

You can put this at the end of your LaTeX file. If you want to refer to something from your bibliography you can put something like this in yourfile:

which would produce something like

## bibtex

Pretend that the file that we are using is called 'foo.tex'. To make a bibliography, we should put all our sources into a file called 'foo.bib'. The structure of foo.bib is as follows:

For our sample document, we will use the following:

 Quotation MarksBIBTeX uses REAL quotation marks (") and NOT the opening and closing quotation marks ( and '') that LaTeX normally uses.

Now, everytime you refer to the book Foo Bar Baz in foo.tex, you refer to it in the following manner:

This will match the citation number with the number of the book in the list of references.

If you have a few references that you did not explicitly cite in the text of your document, but you would like to include it in the list of references, you use the following (in foo.tex):

where baz, fuzz, and bong are abbreviations for the other texts.

To actually create the bibliography, you need to use the following commands in foo.tex (these are usually at the end of the document - where you want the References section to appear):

There are several options for \bibliographystyle:

 plain normal style - listed in ABC order and labeled numerically unsrt same as plain except entries appear in order of citation alpha same as plain except entry labels are used abbrv same as plain except uses abbreviations for first names, month names, and journal names

Now that you have the basis for a bibliography, you have to run both latex and bibtex on the document. First, you should run latex (to create a foo.aux file, which bibtex reads). Then run bibtex once to get some of the citations and create a .bbl file. Then run latex again so that the cross references between the text file and the bibliography are correct. You may want to repeat running bibtex and latex on the file to make sure that all cross references are correct. Be warned that adding/deleting citations and sources will require running bibtex again.

For more information on this topic, please refer the following pages in the LaTeX manual by Leslie Lamport:

\begin{thebibliography}{1} \bibitem{notes} John W. Dower {\em Readings compiled for History 21.479.} 1991. \bibitem{impj} The Japan Reader {\em Imperial Japan 1800-1945} 1973: Random House, N.Y. \bibitem{norman} E. H. Norman {\em Japan's emergence as a modern state} 1940: International Secretariat, Institute of Pacific Relations. \bibitem{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western Learning in Early-Modern Japan} 1986: Harvard University Press. \end{thebibliography}
This is obvious \cite{norman}.
@BOOK{<some abbreviation that you make up>, AUTHOR = "author", TITLE = "book title", PUBLISHER = {publishing company}, ADDRESS = {where published}, YEAR = year published}
@BOOK{bar, AUTHOR = "Star, R. M.", TITLE = "Foo Bar Baz", PUBLISHER = {MIT Press}, ADDRESS = {Cambridge, MA}, YEAR = 1989}
\bibliography{foo} \bibliographystyle{plain}
72-74 Bibliography and Citation 74-74 BibTeX 140-147 Format of the .bib File (also gives info on other entry types) 187-188 Bibliography and Citation

LaTeX supports bibliographies out of the box, either embedding the references in your document or storing them in an external file. This article explains how to manage bibliography with the environment and the BibTeX system.

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.

## Introduction

Standard bibliography commands in LaTeX have a similar syntax to that of lists and items.

\begin{thebibliography}{9}\bibitem{latexcompanion} Michel Goossens, Frank Mittelbach, and Alexander Samarin. \textit{The \LaTeX\ Companion}. Addison-Wesley, Reading, Massachusetts, 1993.   \bibitem{einstein} Albert Einstein. \textit{Zur Elektrodynamik bewegter K{\"o}rper}. (German) [\textit{On the electrodynamics of moving bodies}]. Annalen der Physik, 322(10):891–921, 1905.   \bibitem{knuthwebsite} Knuth: Computers and Typesetting, \\\texttt{http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html}\end{thebibliography}

The environment produces a list of references; such list will be titled "References" in a article document class, and "Bibliography" in book and report document classes. A parameter inside braces, in the example, indicates the number of entries to be added; this parameter can not be greater than 99.

To create a bibliography entry the command is used. A parameter inside braces is set to label this entry and can later be used as identifier for this reference. After the closing brace the text with the name of the author, the book title, publisher and so on is entered.

ShareLaTeX provides several templates with pre-defined styles to manage bibliography. See this link

Open an example in ShareLaTeX

## Embedded system

The example presented in the introduction only contains list of references, the next example shows how to cite the entries of that list within the document.

\begin{document}   \section{First section}   This document is an example of \texttt{thebibliography} environment 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   \begin{thebibliography}{9}\bibitem{latexcompanion} Michel Goossens, Frank Mittelbach, and Alexander Samarin. \textit{The \LaTeX\ Companion}. Addison-Wesley, Reading, Massachusetts, 1993.   \bibitem{einstein} Albert Einstein. \textit{Zur Elektrodynamik bewegter K{\"o}rper}. (German) [\textit{On the electrodynamics of moving bodies}]. Annalen der Physik, 322(10):891–921, 1905.   \bibitem{knuthwebsite} Knuth: Computers and Typesetting, \\\texttt{http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html}\end{thebibliography}   \end{document}

The command insert the number corresponding to the bibliography entry whose label is passed inside braces. For example, the output of is [2].

The information printed by the command depends on the bibliography style used. See Bibtex bibliography styles.

Open an example in ShareLaTeX

## Bibliography management with Bibtex

BibTeX is a widely used bibliography management tool in LaTeX, with BibTeX the bibliography entries are kept in a separate file and then imported into the main document.

Once the external bibliography file is imported, the command is used just as in the introductory example.

Ths document is an example of BibTeX 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   \bibliographystyle{unsrt}\bibliography{sample}

This uses the following commands:

Imports the BibTeX file "sample.bib" to display the bibliography. To import several .bib files just write them comma-separated inside the braces, the file extension is not necessary.
Sets the bibliography style to be used in this document. The information displayed depends on the bibliography style used, even if the entry contains information about the date, author, title, publisher, and abstract, the style used might only print the title and the author. See Bibtex bibliography styles which contains examples of the default bibliography styles in LaTeX.
This will print a number of text, depending on the bibliography style, to reference the bibliography entry whose label is passed to the command. In this case, the label produces [2].

When the main document is compiled, a .bbl file is generated from the .bib file. This is simply a .tex file reorganising the information in the .bib file in a environment, as above. On ShareLaTeX the .bbl file is stored in the cache, and you can download it from the list of other logs and files.

Note: Unicode characters are not supported on BibTeX. Also, if there are too many bibliography entries (+100) it may not work properly. See the further reading section for links to other bibliography management tools.

Open an example of the bibtex package in ShareLaTeX

## The bibliography file

Bibliographic references are usually kept in a bibliography file whose extension is .bib, this file consists of a list of records and fields. Each bibliography record holds relevant information for a single 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, denotes the entry type and tells BibTeX that the information stored here is about an article. 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 an 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 used within a LaTeX document to include these references, as shown in the next subsection.

Open an example of the bibtex package in ShareLaTeX

There are two ways of including the bibliography in the table of contents, either manually adding it or using the package tocbibind (recommended).

To add it manually just insert the next line right before the command or

for books and reports or

for articles. If you prefer to use tocbibind see the next example.

\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}

Open an example of the bibtex package in ShareLaTeX

## Reference guide

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
Document not formally published, with author and title

Most common fields used in BibTeX

 address annote author booktitle chapter 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