Skip to content

New Block Latex Bibliography And References

This module may require a complete rewrite in order to suit its intended audience.
You can help rewrite it. Please see the relevant discussion.

For any academic/research writing, incorporating references into a document is an important task. Fortunately, LaTeX has a variety of features that make dealing with references much simpler, including built-in support for citing references. However, a much more powerful and flexible solution is achieved thanks to an auxiliary tool called BibTeX (which comes bundled as standard with LaTeX). Recently, BibTeX has been succeeded by BibLaTeX, a tool configurable within LaTeX syntax.

BibTeX provides for the storage of all references in an external, flat-file database. (BibLaTeX uses this same syntax.) This database can be referenced in any LaTeX document, and citations made to any record that is contained within the file. This is often more convenient than embedding them at the end of every document written; a centralized bibliography source can be linked to as many documents as desired (write once, read many!). Of course, bibliographies can be split over as many files as one wishes, so there can be a file containing sources concerning topic A () and another concerning topic B (). When writing about topic AB, both of these files can be linked into the document (perhaps in addition to sources specific to topic AB).

Embedded system[edit]

If you are writing only one or two documents and aren't planning on writing more on the same subject for a long time, you might not 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 that you have to use where you want the bibliography; that usually means at the very end of your document, just before the command. Here is a practical example:

\begin{thebibliography}{9}\bibitem{lamport94} Leslie Lamport, \textit{\LaTeX: a document preparation system}, Addison Wesley, Massachusetts, 2nd edition, 1994. \end{thebibliography}

OK, so what is going on here? The first thing to notice is the establishment of the environment. is a keyword that tells LaTeX to recognize everything between the begin and end tags as data for the bibliography. The mandatory argument, which I supplied after the begin statement, is telling LaTeX how wide the item label will be when printed. Note however, that the number itself is not the parameter, but the number of digits is. Therefore, I am effectively telling LaTeX that I will only need reference labels of one character in length, which ultimately means no more than nine references in total. If you want more than nine, then input any two-digit number, such as '56' which allows up to 99 references.

Next is the actual reference entry itself. This is prefixed with the 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. The command formats the title properly in italics.

Citations[edit]

To actually cite a given document is very easy. Go to the point where you want the citation to appear, and use the following: , 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 specifically[edit]

If you want to refer to a certain page, figure or theorem in a text book, you can use the arguments to the command:

\cite[chapter, 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. This non-breakable inter-word space is inserted because the end-of-sentence spacing would be too wide, and "p." should not be separated from the page number.

Multiple citations[edit]

When a sequence of multiple citations is needed, you should use a single command. The citations are then separated by commas. Here's an example:

\cite{citation01,citation02,citation03}

The result will then be shown as citations inside the same brackets, depending on the citation style.

Bibliography styles[edit]

There are several different ways to format lists of bibliographic references and the citations to them in the text. These are called citation styles, and consist of two parts: the format of the abbreviated citation (i.e. the marker that is inserted into the text to identify the entry in the list of references) and the format of the corresponding entry in the list of references, which includes full bibliographic details.

Abbreviated citations can be of two main types: numbered or textual. Numbered citations (also known as the Vancouver referencing system) are numbered consecutively in order of appearance in the text, and consist in Arabic numerals in parentheses (1), square brackets [1], superscript1, or a combination thereof[1]. Textual citations (also known as the Harvard referencing system) use the author surname and (usually) the year as the abbreviated form of the citation, which is normally fully (Smith 2008) or partially enclosed in parenthesis, as in Smith (2008). The latter form allows the citation to be integrated in the sentence it supports.


Below you can see three of the styles available with LaTeX:

Here are some more often used styles:

Style NameAuthor Name FormatReference FormatSorting
plainHomer Jay Simpson#ID#by author
unsrtHomer Jay Simpson#ID#as referenced
abbrvH. J. Simpson#ID#by author
alphaHomer Jay SimpsonSim95by author
abstractHomer Jay SimpsonSimpson-1995a
acmSimpson, H. J.#ID#
authordate1Simpson, Homer JaySimpson, 1995
apaciteSimpson, H. J. (1995)Simpson1995
namedHomer Jay SimpsonSimpson 1995

However, keep in mind that you will need to use the natbib package to use most of these.

No cite[edit]

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

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

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

Natbib[edit]

Citation commandOutput

Goossens et al. (1993)
(Goossens et al., 1993)

Goossens, Mittlebach, and Samarin (1993)
(Goossens, Mittlebach, and Samarin, 1993)

Goossens et al.
Goossens, Mittlebach, and Samarin

1993
(1993)

Goossens et al. 1993
Goossens et al., 1993
(priv. comm.)

Using the standard LaTeX bibliography support, you will see that each reference is numbered and each citation corresponds to the numbers. The numeric style of citation is quite common in scientific writing. In other disciplines, the author-year style, e.g., (Roberts, 2003), such as Harvard is preferred. A discussion about which is best will not occur here, but a possible way to get such an output is by the package. In fact, it can supersede LaTeX's own citation commands, as Natbib allows the user to easily switch between Harvard or numeric.

The first job is to add the following to your preamble in order to get LaTeX to use the Natbib package:

\usepackage[options]{natbib}

Also, you need to change the bibliography style file to be used, so edit the appropriate line at the bottom of the file so that it reads: . Once done, it is basically a matter of altering the existing commands to display the type of citation you want.

StyleSourceDescription
plainnatProvidednatbib-compatible version of plain
abbrvnatProvidednatbib-compatible version of abbrv
unsrtnatProvidednatbib-compatible version of unsrt
apsrevREVTeX 4 home pagenatbib-compatible style for Physical Review journals
rmpapsREVTeX 4 home pagenatbib-compatible style for Review of Modern Physics journals
IEEEtranNTeX Catalogue entrynatbib-compatible style for IEEE publications
achemsoTeX Catalogue entrynatbib-compatible style for American Chemical Society journals
rscTeX Catalogue entrynatbib-compatible style for Royal Society of Chemistry journals

Customization[edit]

OptionMeaning
 :  :  : Parentheses () (default), square brackets [], curly braces {} or angle brackets <>
 : multiple citations are separated by semi-colons (default) or commas
 :  : author year style citations (default), numeric citations or superscripted numeric citations
 : multiple citations are sorted into the order in which they appear in the references section or also compressing multiple numeric citations where possible
the first citation of any reference will use the starred variant (full author list), subsequent citations will use the abbreviated et al. style
for use with the chapterbib package. redefines \thebibliography to issue \section* instead of \chapter*
keeps all the authors’ names in a citation on one line to fix some hyperref problems - causes overfull hboxes

The main commands simply add a t for 'textual' or p for 'parenthesized', to the basic command. You will also notice how Natbib by default will compress references with three or more authors to the more concise 1st surname et al version. By adding an asterisk (*), you can override this default and list all authors associated with that citation. There are some other specialized commands that Natbib supports, listed in the table here. Keep in mind that for instance does not support and will automatically choose between all authors and et al..

The final area that I wish to cover about Natbib is customizing its citation style. There is a command called that can be used to override the defaults and change certain settings. For example, I have put the following in the preamble:

\bibpunct{(}{)}{;}{a}{,}{,}

The command requires six mandatory parameters.

  1. The symbol for the opening bracket.
  2. The symbol for the closing bracket.
  3. The symbol that appears between multiple citations.
  4. This argument takes a letter:
    • n - numerical style.
    • s - numerical superscript style.
    • any other letter - author-year style.
  5. The punctuation to appear between the author and the year (in parenthetical case only).
  6. The punctuation used between years, in multiple citations when there is a common author. e.g., (Chomsky 1956, 1957). If you want an extra space, then you need .

Some of the options controlled by are also accessible by passing options to the natbib package when it is loaded. These options also allow some other aspect of the bibliography to be controlled, and can be seen in the table (right).

So as you can see, this package is quite flexible, especially as you can easily switch between different citation styles by changing a single parameter. Do have a look at the Natbib manual, it's a short document and you can learn even more about how to use it.

BibTeX[edit]

I have previously introduced the idea of embedding references at the end of the document, and then using the command to cite them within the text. In this tutorial, I want to do a little better than this method, as it's not as flexible as it could be. I will concentrate on using BibTeX.

A BibTeX database is stored as a .bib file. It is a plain text file, and so can be viewed and edited easily. The structure of the file is also quite simple. An example of a BibTeX entry:

@article{greenwade93,author="George D. Greenwade",title="The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",year="1993",journal="TUGBoat",volume="14",number="3",pages="342--351"}

Each entry begins with the declaration of the reference type, in the form of . BibTeX knows of practically all types you can think of, common ones are: book, article, and for papers presented at conferences, there is inproceedings. In this example, I have referred to an article within a journal.

After the type, you must have a left curly brace '' to signify the beginning of the reference attributes. The first one follows immediately after the brace, which is the citation key, or the BibTeX key. This key must be unique for all entries in your bibliography. It is this identifier that you will use within your document to cross-reference it to this entry. It is up to you as to how you wish to label each reference, but there is a loose standard in which you use the author's surname, followed by the year of publication. This is the scheme that I use in this tutorial.

Next, it should be clear that what follows are the relevant fields and data for that particular reference. The field names on the left are BibTeX keywords. They are followed by an equals sign (=) where the value for that field is then placed. BibTeX expects you to explicitly label the beginning and end of each value. I personally use quotation marks ("), however, you also have the option of using curly braces ('{', '}'). But as you will soon see, curly braces have other roles, within attributes, so I prefer not to use them for this job as they can get more confusing. A notable exception is when you want to use characters with umlauts (ü, ö, etc), since their notation is in the format , and the quotation mark will close the one opening the field, causing an error in the parsing of the reference. Using in the preamble to the source file can get round this, as the accented characters can just be stored in the file without any need for special markup. This allows a consistent format to be kept throughout the file, avoiding the need to use braces when there are umlauts to consider.

Remember that each attribute must be followed by a comma to delimit one from another. You do not need to add a comma to the last attribute, since the closing brace will tell BibTeX that there are no more attributes for this entry, although you won't get an error if you do.

It can take a while to learn what the reference types are, and what fields each type has available (and which ones are required or optional, etc). So, look at this entry type reference and also this field reference for descriptions of all the fields. It may be worth bookmarking or printing these pages so that they are easily at hand when you need them. Much of the information contained therein is repeated in the following table for your convenience.

articlebookbookletinbookincollectioninproceedings ≈ conferencemanualmastersthesis, phdthesismiscproceedingstech reportunpublished
addressooooooooo
annote
author+*o++o+o++
booktitle++
chaptero
crossref
editionoooo
editor*ooo
howpublishedoo
institution+
journal+
key
monthoooooooooooo
noteooooooooooo+
numberooooooo
organizationooo
pagesooo
publisher+++oo
school+
seriesooooo
title++++++++o+++
typeoooo
volumeoooooo
year++o+++o+o++o

+ Required fields, o Optional fields

Authors[edit]

BibTeX can be quite clever with names of authors. It can accept names in forename surname or surname, forename. I personally use the former, but remember that the order you input them (or any data within an entry for that matter) is customizable and so you can get BibTeX to manipulate the input and then output it however you like. If you use the forename surname method, then you must be careful with a few special names, where there are compound surnames, for example "John von Neumann". In this form, BibTeX assumes that the last word is the surname, and everything before is the forename, plus any middle names. You must therefore manually tell BibTeX to keep the 'von' and 'Neumann' together. This is achieved easily using curly braces. So the final result would be "John {von Neumann}". This is easily avoided with the surname, forename, since you have a comma to separate the surname from the forename.

Secondly, there is the issue of how to tell BibTeX when a reference has more than one author. This is very simply done by putting the keyword and in between every author. As we can see from another example:

@book{goossens93,author="Michel Goossens and Frank Mittelbach and Alexander Samarin",title="The LaTeX Companion",year="1993",publisher="Addison-Wesley",address="Reading, Massachusetts"}

This book has three authors, and each is separated as described. Of course, when BibTeX processes and outputs this, there will only be an 'and' between the penultimate and last authors, but within the .bib file, it needs the ands so that it can keep track of the individual authors.

Standard templates[edit]

Be careful if you copy the following templates, the % sign is not valid to comment out lines in bibtex files. If you want to comment out a line, you have to put it outside the entry.

@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, title, chapter and/or pages, publisher, year.
  • Optional fields: volume/number, series, type, address, edition, month, note.
@inbook{Xinbook,author="",editor="",title="",chapter="",pages="",publisher="",%volume="",%number="",%series="",%type="",%address="",%edition="",year="",%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.
@incollection{Xincollection,author="",title="",booktitle="",publisher="",%editor="",%volume="",%number="",%series="",%type="",%chapter="",%pages="",%address="",%edition="",year="",%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.
@inproceedings{Xinproceedings,author="",title="",booktitle="",%editor="",%volume="",%number="",%series="",%pages="",%address="",%organization="",%publisher="",year="",%month="",%note="",}
@manual 
Technical manual
  • Required fields: title.
  • Optional fields: author, organization, address, edition, month, year, note.
@manual{Xmanual,title="",%author="",%organization="",%address="",%edition="",year="",%month="",%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="diplomathesis",%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.
@phdthesis{Xphdthesis,author="",title="",school="",%address="",year="",%month="",%keywords="",%note="",}
@proceedings 
The proceedings of a conference.
  • Required fields: title, year.
  • Optional fields: editor, volume/number, series, address, month, organization, publisher, note.
@proceedings{Xproceedings,title="",%editor="",%volume="",%number="",%series="",%address="",%organization="",%publisher="",year="",%month="",%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.
@unpublished{Xunpublished,author="",title="",%year="",%month="",note="",}

Non-standard templates[edit]

@patent
BibTeX entries can be exported from Google Patents.
(see Cite Patents with Bibtex for an alternative)
@collection
@electronic
@Unpublished
For citing arXiv.org papers in a REVTEX-style article
(see REVTEX Author's guide)

Preserving case of letters[edit]

In the event that BibTeX has been set by the chosen style not to preserve all capitalization within titles, problems can occur, especially if you are referring to proper nouns, or acronyms. To tell BibTeX to keep them, use the good old curly braces around the letter in question, (or letters, if it's an acronym) and all will be well! It is even possible that lower-case letters may need to be preserved - for example if a chemical formula is used in a style that sets a title in all caps or small caps, or if "pH" is to be used in a style that capitalises all first letters.

However, avoid putting the whole title in curly braces, as it will look odd if a different capitalization format is used:

For convenience though, many people simply put double curly braces, which may help when writing scientific articles for different magazines, conferences with different BibTex styles that do sometimes keep and sometimes not keep the capital letters:

As an alternative, try other BibTex styles or modify the existing. The approach of putting only relevant text in curly brackets is the most feasible if using a template under the control of a publisher, such as for journal submissions. Using curly braces around single letters is also to be avoided if possible, as it may mess up the kerning, especially with biblatex,[1] so the first step should generally be to enclose single words in braces.

A few additional examples[edit]

Below you will find a few additional examples of bibliography entries. The first one covers the case of multiple authors in the Surname, Firstname format, and the second one deals with the incollection case.

@article{AbedonHymanThomas2003,author="Abedon, S. T. and Hyman, P. and Thomas, C.",year="2003",title="Experimental examination of bacteriophage latent-period evolution as a response to bacterial availability",journal="Applied and Environmental Microbiology",volume="69",pages="7499--7506"}@incollection{Abedon1994,author="Abedon, S. T.",title="Lysis and the interaction between free phages and infected cells",pages="397--405",booktitle="Molecular biology of bacteriophage T4",editor="Karam, Jim D. Karam and Drake, John W. and Kreuzer, Kenneth N. and Mosig, Gisela and Hall, Dwight and Eiserling, Frederick A. and Black, Lindsay W. and Kutter, Elizabeth and Carlson, Karin and Miller, Eric S. and Spicer, Eleanor",publisher="ASM Press, Washington DC",year="1994"}

If you have to cite a website you can use @misc, for example:

@misc{website:fermentas-lambda,author="Fermentas Inc.",title="Phage Lambda: description \& restriction map",month="November",year="2008",url="http://www.fermentas.com/techinfo/nucleicacids/maplambda.htm"}

The note field comes in handy if you need to add unstructured information, for example that the corresponding issue of the journal has yet to appear:

@article{blackholes,author="Rabbert Klein",title="Black Holes and Their Relation to Hiding Eggs",journal="Theoretical Easter Physics",publisher="Eggs Ltd.",year="2010",note="(to appear)"}

Getting current LaTeX document to use your .bib file[edit]

At the end of your LaTeX file (that is, after the content, but before ), you need to place the following commands:

\bibliographystyle{plain}\bibliography{sample1,sample2,...,samplen}% Note the lack of whitespace between the commas and the next bib file.

Bibliography styles are files recognized by BibTeX that tell it how to format the information stored in the file when processed for output. And so the first command listed above is declaring which style file to use. The style file in this instance is (which comes as standard with BibTeX). You do not need to add the .bst extension when using this command, as it is assumed. Despite its name, the plain style does a pretty good job (look at the output of this tutorial to see what I mean).

The second command is the one that actually specifies the file you wish to use. The ones I created for this tutorial were called , , . . ., , but once again, you don't include the file extension. At the moment, the file is in the same directory as the LaTeX document too. However, if your .bib file was elsewhere (which makes sense if you intend to maintain a centralized database of references for all your research), you need to specify the path as well, e.g or (if the file is in the parent directory of the document that calls it).

Now that LaTeX and BibTeX know where to look for the appropriate files, actually citing the references is fairly trivial. The is the command you need, making sure that the ref_key corresponds exactly to one of the entries in the .bib file. If you wish to cite more than one reference at the same time, do the following: .

Why won't LaTeX generate any output?[edit]

The addition of BibTeX adds extra complexity for the processing of the source to the desired output. This is largely hidden from the user, but because of all the complexity of the referencing of citations from your source LaTeX file to the database entries in another file, you actually need multiple passes to accomplish the task. This means you have to run LaTeX a number of times. Each pass will perform a particular task until it has managed to resolve all the citation references. Here's what you need to type (into command line):

    (Extensions are optional, if you put them note that the bibtex command takes the AUX file as input.)

    After the first LaTeX run, you will see errors such as:

    LaTeX Warning: Citation `lamport94' on page 1 undefined on input line 21. ... LaTeX Warning: There were undefined references.

    The next step is to run bibtex on that same LaTeX source (or more precisely the corresponding AUX file, however not on the actual .bib file) to then define all the references within that document. You should see output like the following:

    This is BibTeX, Version 0.99c (Web2C 7.3.1) The top-level auxiliary file: latex_source_code.aux The style file: plain.bst Database file #1: sample.bib

    The third step, which is invoking LaTeX for the second time will see more errors like "". Don't be alarmed, it's almost complete. As you can guess, all you have to do is follow its instructions, and run LaTeX for the third time, and the document will be output as expected, without further problems.

    If you want a pdf output instead of a dvi output you can use instead of as follows:

      (Extensions are optional, if you put them note that the bibtex command takes the AUX file as input.)

      Note that if you are editing your source in vim and attempt to use command mode and the current file shortcut (%) to process the document like this:

        You will get an error similar to this:

          It appears that the file extension is included by default when the current file command (%) is executed. To process your document from within vim, you must explicitly name the file without the file extension for bibtex to work, as is shown below:

          1. (without file extension, it looks for the AUX file as mentioned above)

          However, it is much easier to install the Vim-LaTeX plugin from here. This allows you to simply type \ll when not in insert mode, and all the appropriate commands are automatically executed to compile the document. Vim-LaTeX even detects how many times it has to run pdflatex, and whether or not it has to run bibtex. This is just one of the many nice features of Vim-LaTeX, you can read the excellent Beginner's Tutorial for more about the many clever shortcuts Vim-LaTeX provides.

          Another option exists if you are running Unix/Linux or any other platform where you have make. Then you can simply create a Makefile and use vim's make command or use make in shell. The Makefile would then look like this:

          latex_source_code.pdf: latex_source_code.tex latex_source_code.bib pdflatex latex_source_code.tex bibtex latex_source_code.aux pdflatex latex_source_code.tex pdflatex latex_source_code.tex

          Including URLs in bibliography[edit]

          As you can see, there is no field for URLs. One possibility is to include Internet addresses in field of or field of , , :

          Note the usage of command to ensure proper appearance of URLs.

          Another way is to use special field and make bibliography style recognise it.

          You need to use in the first case or in the second case.

          Styles provided by Natbib (see below) handle this field, other styles can be modified using urlbst program. Modifications of three standard styles (plain, abbrv and alpha) are provided with urlbst.

          If you need more help about URLs in bibliography, visit FAQ of UK List of TeX.

          Customizing bibliography appearance[edit]

          One of the main advantages of BibTeX, especially for people who write many research papers, is the ability to customize your bibliography to suit the requirements of a given publication. You will notice how different publications tend to have their own style of formatting references, to which authors must adhere if they want their manuscripts published. In fact, established journals and conference organizers often will have created their own bibliography style (.bst file) for those users of BibTeX, to do all the hard work for you.

          It can achieve this because of the nature of the .bib database, where all the information about your references is stored in a structured format, but nothing about style. This is a common theme in LaTeX in general, where it tries as much as possible to keep content and presentation separate.

          A bibliography style file () will tell LaTeX how to format each attribute, what order to put them in, what punctuation to use in between particular attributes etc. Unfortunately, creating such a style by hand is not a trivial task. Which is why (also known as custom-bib) is the tool we need.

          can be used to automatically generate a .bst file based on your needs. It is very simple, and actually asks you a series of questions about your preferences. Once complete, it will then output the appropriate style file for you to use.

          It should be installed with the LaTeX distribution (otherwise, you can download it) and it's very simple to initiate. At the command line, type:

          latex makebst

          LaTeX will find the relevant file and the questioning process will begin. You will have to answer quite a few (although, note that the default answers are pretty sensible), which means it would be impractical to go through an example in this tutorial. However, it is fairly straight-forward. And if you require further guidance, then there is a comprehensive manual available. I'd recommend experimenting with it and seeing what the results are when applied to a LaTeX document.

          If you are using a custom built .bst file, it is important that LaTeX can find it! So, make sure it's in the same directory as the LaTeX source file, unless you are using one of the standard style files (such as plain or plainnat, that come bundled with LaTeX - these will be automatically found in the directories that they are installed. Also, make sure the name of the file you want to use is reflected in the command (but don't include the extension!).

          Localizing bibliography appearance[edit]

          When writing documents in languages other than English, you may find it desirable to adapt the appearance of your bibliography to the document language. This concerns words such as editors, and, or in as well as a proper typographic layout. The package can be used here. For example, to layout the bibliography in German, add the following to the header:

          \usepackage[fixlanguage]{babelbib}\selectbiblanguage{german}

          Alternatively, you can layout each bibliography entry according to the language of the cited document:

          The language of an entry is specified as an additional field in the BibTeX entry:

          @article{mueller08,%...language={german}}

          For to take effect, a bibliography style supported by it - one of , , , , , and - must be used:

          \bibliographystyle{babplain}\bibliography{sample}

          Showing unused items[edit]

          Usually LaTeX only displays the entries which are referred to with . It's possible to make uncited entries visible:

          \nocite{Name89}% Show Bibliography entry of Name89\nocite{*}% Show all Bib-entries

          Getting bibliographic data[edit]

          Many online databases provide bibliographic data in BibTeX-Format, making it easy to build your own database. For example, Google Scholar offers the option to return properly formatted output, which can also be turned on in the settings page.

          One should be alert to the fact that bibliographic databases are frequently the product of several generations of automatic processing, and so the resulting BibTex code is prone to a variety of minor errors, especially in older entries.

          Helpful tools[edit]

          See also: w:en:Comparison of reference management software
          • BibDesk BibDesk is a bibliographic reference manager for Mac OS X. It features a very usable user interface and provides a number of features like smart folders based on keywords and live tex display.
          • BibSonomy — A free social bookmark and publication management system based on BibTeX.
          • BibTeXSearch BibTeXSearch is a free searchable BibTeX database spanning millions of academic records.
          • Bibtex Editor - An online BibTeX entry generator and bibliography management system. Possible to import and export Bibtex files.
          • Bibwiki Bibwiki is a Specialpage for MediaWiki to manage BibTeX bibliographies. It offers a straightforward way to import and export bibliographic records.
          • cb2Bib The cb2Bib is a tool for rapidly extracting unformatted, or unstandardized bibliographic references from email alerts, journal Web pages, and PDF files.
          • Citavi Commercial software (with size-limited free demo version) which even searches libraries for citations and keeps all your knowledge in a database. Export of the database to all kinds of formats is possible. Works together with MS Word and Open Office Writer. Moreover plug ins for browsers and Acrobat Reader exist to automatically include references to your project.
          • CiteULike CiteULike is a free online service to organise academic papers. It can export citations in BibTeX format, and can "scrape" BibTeX data from many popular websites.

          To do:

          • Add other packages for creating presentations.
          • Bonus: Add screenshots of the results.
          • Working with columns
          • Navigation — see here
          • Using sections & subsections

          LaTeX can be used for creating presentations. There are several packages for the task, including the package.

          The Beamer package[edit]

          The beamer package is provided with most LaTeX distributions, but is also available from CTAN. If you use MikTeX, all you have to do is to include the beamer package and let LaTeX download all wanted packages automatically. The documentation explains the features in great detail. You can also have a look at the PracTex article Beamer by Example.[1]

          The package also loads many useful packages including .

          Introductory example[edit]

          The beamer package is loaded by calling the class:

          The usual header information may then be specified. Note that if you are compiling with XeTeX then you should use

          \documentclass[xetex,mathserif,serif]{beamer}

          Inside the environment, multiple environments specify the content to be put on each slide. The command specifies the title for each slide (see image):

          \begin{document}\begin{frame}\frametitle{This is the first slide}%Content goes here\end{frame}\begin{frame}\frametitle{This is the second slide}\framesubtitle{A bit more information about this}%More content goes here\end{frame}% etc\end{document}

          The usual environments (, , , etc.) may be used.

          Inside frames, you can use environments like , , , ... Also, is possible to create the frontpage, if and are set.

          Trick: Instead of using , you can also use .

          For the actual talk, if you can compile it with then you could use a pdf reader with a fullscreen mode, such as Okular, Evince or Adobe Reader. If you want to navigate in your presentation, you can use the almost invisible links in the bottom right corner without leaving the fullscreen mode.

          Document Structure[edit]

          Title page and information[edit]

          First, you give information about authors, titles and dates in the preamble.

          \title[Crisis]% (optional, only for long titles){The Economics of Financial Crisis}\subtitle{Evidence from India}\author[Author, Anders]% (optional, for multiple authors){F.~Author\inst{1}\and S.~Anders\inst{2}}\institute[Universities Here and There]% (optional){\inst{1}% Institute of Computer Science\\ University Here \and\inst{2}% Institute of Theoretical Philosophy\\ University There }\date[KPT 2004]% (optional){Conference on Presentation Techniques, 2004}\subject{Computer Science}

          Then, in the document, you add the title page :

          Table of Contents[edit]

          The table of contents, with the current section highlighted, is displayed by:

          \begin{frame}\frametitle{Table of Contents}\tableofcontents[currentsection]\end{frame}

          This can be done automatically at the beginning of each section using the following code in the preamble:

          \AtBeginSection[]{\begin{frame}\frametitle{Table of Contents}\tableofcontents[currentsection]\end{frame}}

          Or for subsections:

          \AtBeginSubsection[]{\begin{frame}\frametitle{Table of Contents}\tableofcontents[currentsection,currentsubsection]\end{frame}}

          Sections and subsections[edit]

          As in all other LaTeX files, it is possible to structure the document using

          \section[Section]{My section}

          ,

          \subsection[Subsection]{My subsection}

          and

          \subsubsection[Subsubsection]{My subsubsection}

          Those commands have to be put before and between frames. They will modify the Table of contents with the optional argument. The argument in brackets will be written on the slide, depending on the theme used.

          References (Beamer)[edit]

          Beamer does not officially support BibTeX. Instead bibliography items will need to be partly set "by hand" (see beameruserguide.pdf 3.12). The following example shows a references slide containing two entries:

          \begin{frame}[allowframebreaks] \frametitle<presentation>{Further Reading}\begin{thebibliography}{10}\beamertemplatebookbibitems\bibitem{Autor1990} A.~Autor. \newblock{\em Introduction to Giving Presentations}. \newblock Klein-Verlag, 1990. \beamertemplatearticlebibitems\bibitem{Jemand2000} S.~Jemand. \newblock On this and that. \newblock{\em Journal of This and That}, 2(1):50--100, 2000. \end{thebibliography}\end{frame}

          As the reference list grows, the reference slide will divide into two slides and so on, through use of the option. Individual items can be cited after adding an 'optional' label to the relevant stanza. The citation call is simply . Beamer also supports limited customization of the way references are presented (see the manual). Those who wish to use natbib, for example, with Beamer may need to troubleshoot both their document setup and the relevant BibTeX style file.

          The different types of referenced work are indicated with a little symbol (e.g. a book, an article, etc.). The Symbol is set with the commands and . It is also possible to use directly, like so

          \begin{frame}[allowframebreaks] \frametitle<presentation>{Further Reading}\begin{thebibliography}{10}\setbeamertemplate{bibliography item}[book] \bibitem{Autor1990} A.~Autor. \newblock{\em Introduction to Giving Presentations}. \newblock Klein-Verlag, 1990. \setbeamertemplate{bibliography item}[article] \bibitem{Jemand2000} S.~Jemand. \newblock On this and that. \newblock{\em Journal of This and That}, 2(1):50--100, 2000. \end{thebibliography}\end{frame}

          Other possible types of bibliography items, besides and , include e.g. , and . It is also possible to have user defined bibliography items by including a graphic.

          If one wants to have full references appear as foot notes, use the . For example, it is possible to use

          \documentclass[10pt,handout,english]{beamer}\usepackage[english]{babel}\usepackage[backend=biber,style=numeric-comp,sorting=none]{biblatex}\addbibresource{biblio.bib}\begin{frame}\frametitle{Title} A reference~\footfullcite{ref_bib}, with ref_bib an item of the .bib file. \end{frame}

          Style[edit]

          Themes[edit]

          The first solution is to use a built-in theme such as Warsaw, Berlin, etc. The second solution is to specify colors, inner themes and outer themes.

          The Built-in solution[edit]

          To the preamble you can add the following line:

          to use the "Warsaw" theme. has several themes, many of which are named after cities (e.g. Frankfurt, Madrid, Berlin, etc.).

          This Theme Matrix contains the various theme and color combinations included with . For more customizing options, have a look to the official documentation included in your distribution of , particularly the part Change the way it looks.

          The full list of themes is:

          • AnnArbor
          • Antibes
          • Bergen
          • Berkeley
          • Berlin
          • Copenhagen
          • Darmstadt
          • Dresden
          • Frankfurt
          • Goettingen
          • Hannover
          • Ilmenau
          • JuanLesPins
          • Luebeck
          • Madrid
          • Malmoe
          • Marburg
          • Montpellier
          • PaloAlto
          • Pittsburgh
          • Rochester
          • Singapore
          • Szeged
          • Warsaw
          • boxes
          • default

          Color themes, typically with animal names, can be specified with

          The full list of color themes is:

          • default
          • albatross
          • beaver
          • beetle
          • crane
          • dolphin
          • dove
          • fly
          • lily
          • orchid
          • rose
          • seagull
          • seahorse
          • whale
          • wolverine
          The do it yourself solution[edit]

          First you can specify the outertheme. The outertheme defines the head and the footline of each slide.

          \useoutertheme{infolines}

          Here is a list of all available outer themes:

          • infolines
          • miniframes
          • shadow
          • sidebar
          • smoothbars
          • smoothtree
          • split
          • tree

          Then you can add the innertheme:

          \useinnertheme{rectangles}

          Here is a list of all available inner themes:

          • rectangles
          • circles
          • inmargin
          • rounded

          You can define the color of every element:

          \setbeamercolor{alerted text}{fg=orange}\setbeamercolor{background canvas}{bg=white}\setbeamercolor{block body alerted}{bg=normal text.bg!90!black}\setbeamercolor{block body}{bg=normal text.bg!90!black}\setbeamercolor{block body example}{bg=normal text.bg!90!black}\setbeamercolor{block title alerted}{use={normal text,alerted text},fg=alerted text.fg!75!normal text.fg,bg=normal text.bg!75!black}\setbeamercolor{block title}{bg=blue}\setbeamercolor{block title example}{use={normal text,example text},fg=example text.fg!75!normal text.fg,bg=normal text.bg!75!black}\setbeamercolor{fine separation line}{}\setbeamercolor{frametitle}{fg=brown}\setbeamercolor{item projected}{fg=black}\setbeamercolor{normal text}{bg=black,fg=yellow}\setbeamercolor{palette sidebar primary}{use=normal text,fg=normal text.fg}\setbeamercolor{palette sidebar quaternary}{use=structure,fg=structure.fg}\setbeamercolor{palette sidebar secondary}{use=structure,fg=structure.fg}\setbeamercolor{palette sidebar tertiary}{use=normal text,fg=normal text.fg}\setbeamercolor{section in sidebar}{fg=brown}\setbeamercolor{section in sidebar shaded}{fg=grey}\setbeamercolor{separation line}{}\setbeamercolor{sidebar}{bg=red}\setbeamercolor{sidebar}{parent=palette primary}\setbeamercolor{structure}{bg=black, fg=green}\setbeamercolor{subsection in sidebar}{fg=brown}\setbeamercolor{subsection in sidebar shaded}{fg=grey}\setbeamercolor{title}{fg=brown}\setbeamercolor{titlelike}{fg=brown}

          Colors can be defined as usual:

          \definecolor{chocolate}{RGB}{33,33,33}

          Block styles can also be defined:

          \setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{background canvas}[vertical shading][bottom=white,top=structure.fg!25] \setbeamertemplate{sidebar canvas left}[horizontal shading][left=white!40!black,right=black]

          You can also suppress the navigation bar:

          \beamertemplatenavigationsymbolsempty

          Fonts[edit]

          You may also change the fonts for particular elements. If you wanted the title of the presentation as rendered by to occur in a serif font instead of the default sanserif, you would use:

          \setbeamerfont{title}{family=\rm}

          You could take this a step further if you are using OpenType fonts with Xe(La)TeX and specify a serif font with increased size and oldstyle proportional alternate number glyphs:

          \setbeamerfont{title}{family=\rm\addfontfeatures{Scale=1.18, Numbers={Lining, Proportional}}}
          Math Fonts[edit]

          The default settings for use a different set of math fonts than one would expect from creating a simple math article. One quick fix for this is to use at the beginning of the file the option

          \documentclass[mathserif]{beamer}

          Others have proposed to use the command

          \usefonttheme[onlymath]{serif}

          but it is not clear if this works for absolutely every math character.

          Frames Options[edit]

          The plain option. Sometimes you need to include a large figure or a large table and you don't want to have the bottom and the top off the slides. In that case, use the plain option:

          If you want to include lots of text on a slide, use the shrink option.

          The allowframebreaks option will auto-create new frames if there is too much content to be displayed on one.

          \frame[allowframebreaks]{% ...}


          Before using any verbatim environment (like ), you should pass the option to the environment, as verbatim environments need to be typeset differently. Usually, the form is usable (for details see the manual). Note that the option may not be used with commands since it expects to encounter a , which should be alone on a single line.

          \begin{frame}[fragile] \frametitle{Source code}\begin{lstlisting}[caption=First C example] int main() { printf("Hello World!"); return 0; }\end{lstlisting}\end{frame}

          Hyperlink navigation[edit]

          Internal and external hyperlinks can be used in beamer to assist navigation. Clean looking buttons can also be added.

          To do:

          • add information about
          • add information about and friends

          By default the beamer class adds navigation buttons in the bottom right corner. To remove them one can place

          \beamertemplatenavigationsymbolsempty

          in the preamble.

          Animations[edit]

          The following is merely an introduction to the possibilities in beamer. Chapter 8 of the beamer manual provides much more detail, on many more features.

          Making items appear on a slide is possible by simply using the statement:

          \begin{frame}\frametitle{Some background} We start our discussion with some concepts. \pause The first concept we introduce originates with Erd\H os. \end{frame}

          Text or figures after will display after one of the following events (which may vary between PDF viewers): pressing space, return or page down on the keyboard, or using the mouse to scroll down or click the next slide button. Pause can be used within etc.

          Text animations[edit]

          For text animations, for example in the itemize environment, it is possible to specify appearance and disappearance of text by using where a and b are the numbers of the events the item is to be displayed for (inclusive). For example:

          \begin{itemize}\item This one is always shown \item<1-> The first time (i.e. as soon as the slide loads) \item<2-> The second time \item<1-> Also the first time \only<1-1> {This one is shown at the first time, but it will hide soon (on the next event after the slide loads).}\end{itemize}

          A simpler approach for revealing one item per click is to use .

          \begin{frame}\frametitle{`Hidden higher-order concepts?'}\begin{itemize}[<+->] \item The truths of arithmetic which are independent of PA in some sense themselves `{contain} essentially {\color{blue}{hidden higher-order}}, or infinitary, concepts'??? \item `Truths in the language of arithmetic which \ldots\item That suggests stronger version of Isaacson's thesis. \end{itemize}\end{frame}

          In all these cases, pressing page up, scrolling up, or clicking the previous slide button in the navigation bar will backtrack through the sequence.

          Handout mode[edit]

          In beamer class, the default mode is presentation which makes the slides. However, you can work in a different mode that is called handout by setting this option when calling the class:

          \documentclass[12pt,handout]{beamer}

          This mode is useful to see each slide only one time with all its stuff on it, making any environments visible all at once (for instance, printable version). Nevertheless, this makes an issue when working with the command, because its purpose is to have only some text or figures at a time and not all of them together.

          If you want to solve this, you can add a statement to specify precisely the behavior when dealing with commands in handout mode. Suppose you have a code like this

          \only<1>{\includegraphics{pic1.eps}}\only<2>{\includegraphics{pic2.eps}}

          These pictures being completely different, you want them both in the handout, but they cannot be both on the same slide since they are large. The solution is to add the handout statement to have the following:

          \only<1| handout:1>{\includegraphics{pic1.eps}}\only<2| handout:2>{\includegraphics{pic2.eps}}

          This will ensure the handout will make a slide for each picture.

          Now imagine you still have your two pictures with the only statements, but the second one show the first one plus some other graphs and you don't need the first one to appear in the handout. You can thus precise the handout mode not to include some only commands by:

          \only<1| handout:0>{\includegraphics{pic1.eps}}\only<2>{\includegraphics{pic2.eps}}

          The command can also be used to hide frames, e.g.

          \begin{frame}<handout:0>

          or even, if you have written a frame that you don't want anymore but maybe you will need it later, you can write

          \begin{frame}<0| handout:0>

          and this will hide your slide in both modes. (The order matters. Don't put handout:0|beamer:0 or it won't work.)

          A last word about the handout mode is about the notes. Actually, the full syntax for a frame is

          \begin{frame} ... \end{frame}\note{...}\note{...} ...

          and you can write your notes about a frame in the field note (many of them if needed). Using this, you can add an option to the class calling, either

          \documentclass[12pt,handout,notes=only]{beamer}

          or

          \documentclass[12pt,handout,notes=show]{beamer}

          The first one is useful when you make a presentation to have only the notes you need, while the second one could be given to those who have followed your presentation or those who missed it, for them to have both the slides with what you said.

          Note that the 'handout' option in the \documentclass line suppress all the animations.

          Important: the notes=only mode is literally doing only the notes. This means there will be no output file but the DVI. Thus it requires you to have run the compilation in another mode before. If you use separate files for a better distinction between the modes, you may need to copy the .aux file from the handout compilation with the slides (w/o the notes).

          Columns and Blocks[edit]

          There are two handy environments for structuring a slide: "blocks", which divide the slide (horizontally) into headed sections, and "columns" which divides a slide (vertically) into columns. Blocks and columns can be used inside each other.

          Columns[edit]

          Example

          \begin{frame}{Example of columns 1}\begin{columns}[c] % the "c" option specifies center vertical alignment\column{.5\textwidth}% column designated by a command Contents of the first column \column{.5\textwidth} Contents split \\ into two lines \end{columns}\end{frame}\begin{frame}{Example of columns 2}\begin{columns}[T] % contents are top vertically aligned\begin{column}[T]{5cm}% each column can also be its own environment Contents of first column \\ split into two lines \end{column}\begin{column}[T]{5cm}% alternative top-align that's better for graphics\includegraphics[height=3cm]{graphic.png}\end{column}\end{columns}\end{frame}

          Blocks[edit]

          Enclosing text in the block environment creates a distinct, headed block of text (a blank heading can be used). This allows to visually distinguish parts of a slide easily. There are three basic types of block. Their formatting depends on the theme being used.

          Simple

          \begin{frame}\begin{block}{This is a Block} This is important information \end{block}\begin{alertblock}{This is an Alert block} This is an important alert \end{alertblock}\begin{exampleblock}{This is an Example block} This is an example \end{exampleblock}\end{frame}

          PDF options[edit]

          You can specify the default options of your PDF.[2]

          \hypersetup{pdfstartview={Fit}}% fits the presentation to the window when first displayed

          Numbering slides[edit]

          It is possible to number slides using this snippet:

          \insertframenumber/\inserttotalframenumber

          However, this poses two problems for some presentation authors: the title slide is numbered as the first one, and the appendix or so-called "backup" (aka appendix, reserve) slides are included in the total count despite them not being intended to be public until a "hard" question is asked.[3] This is where two features come in:

          • Ability to reset the frames counter at any slide. For instance, this may be inserted at the title slide to avoid counting it:
          \addtocounter{framenumber}{-1}

          Or alternatively this:

          \setcounter{framenumber}{0} or \setcounter{framenumber}{1}
          • The first of the above applies to section slides to avoid counting them.
          • This stuff works around the problem of counting the backup slides:
          % (Thanks, David Gleich!)% All your regular slides% After your last numbered slide\appendix\newcounter{finalframe}\setcounter{finalframe}{\value{framenumber}}% Backup frames\setcounter{framenumber}{\value{finalframe}}\end{document}

          The powerdot package[edit]

          The powerdot package is an alternative to beamer. It is available from CTAN. The documentation explains the features in great detail.

          The powerdot package is loaded by calling the class:

          The usual header information may then be specified.

          Inside the usual environment, multiple environments specify the content to be put on each slide.

          \begin{document}\begin{slide}{This is the first slide}%Content goes here\end{slide}\begin{slide}{This is the second slide}%More content goes here\end{slide}% etc\end{document}

          Simple presentations[edit]

          The class is very powerful and provides lots of features. For a very simple presentation, a class based on can be used.

          \documentclass[paper=160mm:90mm,fontsize=10pt,DIV=16]{scrartcl}\usepackage{lmodern}\pagestyle{empty}\renewcommand{\familydefault}{\sfdefault}\newenvironment{slide}[1]{\clearpage{\LARGE\bfseries#1\par}\vspace{\baselineskip}}{}\usepackage{enumitem}\setlist{noitemsep}\title{XeTaL}\author{Carl Capybara}\begin{document}\maketitle\begin{slide}{slide title} This is just some text \begin{itemize}\item Wombat \item Capybara \item Mara \end{itemize}\end{slide}\begin{slide}{Wombat title} This is just some different text \end{slide}\end{document}

          References[edit]

          Links[edit]