# Kile Latex Bibliography Environment

By:
 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

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

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

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

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

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

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

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

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

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:

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

### Authors

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:

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

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

### Non-standard templates

@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

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.

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

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?

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

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

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

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

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

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.

• 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.

## LaTeX Reference

 Alphabetical Index #   A   B   C   D   E   F   H   I   K   L   M   N   O   P   Q   R   S   T   U   V   W

Everything LaTeX numbers for you has a counter associated with it. The name of the counter is the same as the name of the environment or command that produces the number, except with no . (enumi - enumiv are used for the nested enumerate environment.) Below is a list of the counters used in LaTeX's standard document classes to control numbering.

part paragraph figure enumi chapter subparagraph table enumii section page footnote enumiii subsection equation mpfootnote enumiv subsubsection
• \alph: Print value of a counter using letters.
• \arabic: Print value of a counter using numerals.
• \fnsymbol: Print value of a counter using symbols.
• \newcounter: Define a new counter.
• \refstepcounter: Add to counter, resetting subsidiary counters.
• \roman: Print value of a counter using roman numerals.
• \setcounter: Set the value of a counter.
• \stepcounter: Add to counter, resetting subsidiary counters.
• \usecounter: Use a specified counter in a list environment.
• \value: Use the value of a counter in an expression.

The command increments the by the amount specified by the argument. The argument can be negative.

### \alph

This command causes the value of the to be printed in alphabetic characters. The command uses lower case alphabetic alphabetic characters, i.e., while the command uses upper case alphabetic characters, i.e., .

### \arabic

The command causes the value of the to be printed in Arabic numbers, i.e., .

### \fnsymbol

The command causes the value of the to be printed in a specific sequence of nine symbols that can be used for numbering footnotes.

eg. From 1-9:

NB. must have a value between 1 and 9 inclusive.

### \newcounter

The command defines a new counter named . The counter is initialized to zero.

The optional argument causes the counter to be reset whenever the counter named in the optional argument is incremented.

### \refstepcounter

The command works like See section \stepcounter, except it also defines the current value to be the result of .

### \roman

This command causes the value of the to be printed in Roman numerals. The command uses lower case Roman numerals, i.e., , while the command uses upper case Roman numerals, i.e., .

### \stepcounter

The command adds one to the and resets all subsidiary counters.

### \setcounter

The command sets the value of the to that specified by the argument.

### \usecounter

The command is used in the second argument of the environment to allow the counter specified to be used to number the list items.

### \value

The command produces the value of the named in the mandatory argument. It can be used where LaTeX expects an integer or number, such as the second argument of a or command, or in:

\hspace{\value{foo}\parindent}

It is useful for doing arithmetic with counters.

One reason for numbering things like figures and equations is to refer the reader to them, as in "See Figure 3 for more details."

• \label: Assign a symbolic name to a piece of text.
• \pageref: Refer to a page number.
• \ref: Refer to a section, figure or similar.

### \label

A command appearing in ordinary text assigns to the the number of the current sectional unit; one appearing inside a numbered environment assigns that number to the .

A can consist of any sequence of letters, digits, or punctuation characters. Upper and lowercase letters are different.

To avoid accidentally creating two labels with the same name, it is common to use labels consisting of a prefix and a suffix separated by a colon. The prefixes conventionally used are

• for chapters
• for lower-level sectioning commands
• for figures
• for tables
• for equations

Thus, a label for a figure would look like .

### \pageref

The command produces the page number of the place in the text where the corresponding command appears. ie. where appears.

### \ref

The command produces the number of the sectional unit, equation number, ... of the corresponding command.

### \newcommand


These commands define (or redefine) a command.

A command name beginning with a . For it must not be already defined and must not begin with ; for it must already be defined.
An integer from 1 to 9 denoting the number of arguments of the command being defined. The default is for the command to have no arguments.
If this optional parameter is present, it means that the command's first argument is optional. The default value of the optional argument is .
The text to be substituted for every occurrence of ; a parameter of the form in is replaced by the text of the nth argument when this substitution takes place.

### \newenvironment

\newenvironment{nam}[args]{begdef}{enddef} \newenvironment{nam}[args][default]{begdef}{enddef} \renewenvironment{nam}[args]{begdef}{enddef}

These commands define or redefine an environment.

The name of the environment. For there must be no currently defined environment by that name, and the command must be undefined. For the environment must already be defined.
An integer from 1 to 9 denoting the number of arguments of the newly-defined environment. The default is no arguments.
If this is specified, the first argument is optional, and gives the default value for that argument.
The text substituted for every occurrence of ; a parameter of the form in is replaced by the text of the nth argument when this substitution takes place.
The text substituted for every occurrence of . It may not contain any argument parameters.

### \newtheorem

\newtheorem{env_name}{caption}[within] \newtheorem{env_name}[numbered_like]{caption}

This command defines a theorem-like environment.

The name of the environment to be defined. A string of letters. It must not be the name of an existing environment or counter.
The text printed at the beginning of the environment, right before the number. This may simply say "Theorem", for example.
The name of an already defined counter, usually of a sectional unit. Provides a means of resetting the new theorem counter within the sectional unit.
The name of an already defined theorem-like environment.

The command may have at most one optional argument.

### \newfont

Defines the command name , which must not be currently defined, to be a declaration that selects the font named to be the current font.

Valid LaTeX document classes include:

• article
• report
• letter
• book
• slides

Other document classes are often available. They are selected with the following command:

All the standard classes (except slides) accept the following options for selecting the typeface size (10 pt is default):

10pt, 11pt, 12pt

All classes accept these options for selecting the paper size (default is letter):

a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper

Miscellaneous options:

• landscape -- selects landscape format. Default is portrait.
• titlepage, notitlepage -- selects if there should be a separate title page.
• leqno -- equation number on left side of equations. Default is right side.
• fleqn -- displayed formulas flush left. Default is centred.
• openbib -- use "open" bibliography format.
• draft, final -- mark/do not mark overfull boxes with a rule. Default is final.

These options are not available with the slides class:

• oneside, twoside -- selects one- or twosided layout. Default is oneside, except for the book class.
• openright, openany -- determines if a chapter should start on a right-hand page. Default is openright for book.
• onecolumn, twocolumn -- one or two columns. Defaults to one column.

The slides class offers the option for printing the time at the bottom of each note.

If you specify more than one option, they must be separated by a comma.

command. If you specify more than one package, they must be separated by a comma.

Any options given in the command that are unknown by the selected document class are passed on to the packages loaded with .

Miscellaneous commands for controlling the general layout of the page.

### \flushbottom

The declaration makes all text pages the same height, adding extra vertical space when necessary to fill out the page.

This is the standard if twocolumn mode is selected.

### \onecolumn

The declaration starts a new page and produces single-column output.

### \raggedbottom

The declaration makes all pages the height of the text on that page. No extra vertical space is added.

### \twocolumn

The declaration starts a new page and produces two-column output. If the optional argument is present, it is typeset in one-column mode.

LaTeX provides a number of different paragraph-making environments. Each environment begins and ends in the same manner.

\begin{environment-name} . . . \end{environment-name}

### array

\begin{array}{col1col2...coln} column 1 entry & column 2 entry ... & column n entry \\ . . . \end{array}

Math arrays are produced with the array environment. It has a single mandatory argument describing the number of columns and the alignment within them. Each column, , is specified by a single letter that tells how items in that row should be formatted.

• -- for centred
• -- for flush left
• -- for flush right

Column entries must be separated by an . Column entries may include other LaTeX commands. Each row of the array must be terminated with the string .

Note that the environment can only be used in math mode, so normally it is used inside an environment.

### center

\begin{center} Text on line 1 \\ Text on line 2 \\ . . . \end{center}

The environment allows you to create a paragraph consisting of lines that are centred within the left and right margins on the current page. Each line must be terminated with the string .

• \centering: The declaration form of the environment.

#### \centering

This declaration corresponds to the environment. This declaration can be used inside an environment such as or in a . The text of a figure or table can be centred on the page by putting a command at the beginning of the figure or table environment.

Unlike the environment, the command does not start a new paragraph; it simply changes how LaTeX formats paragraph units. To affect a paragraph unit's format, the scope of the declaration must contain the blank line or command (of an environment like quote) that ends the paragraph unit.

### description

\begin{description} \item [label] First item \item [label] Second item . . . \end{description}

The environment is used to make labelled lists. The is bold face and flushed right.

### enumerate

\begin{enumerate} \item First item \item Second item . . . \end{enumerate}

The environment produces a numbered list. Enumerations can be nested within one another, up to four levels deep. They can also be nested within other paragraph-making environments.

Each item of an enumerated list begins with an command. There must be at least one command within the environment.

The environment uses the through counters (see section Counters). The type of numbering can be changed by redefining etc.

### eqnarray

\begin{eqnarray} math formula 1 \\ math formula 2 \\ . . . \end{eqnarray}

The environment is used to display a sequence of equations or inequalities. It is very much like a three-column environment, with consecutive rows separated by and consecutive items within a row separated by an .

An equation number is placed on every line unless that line has a command.

The command is used for splitting long formulas across lines. It typesets its argument in display style flush left in a box of zero width.

### equation

$$math formula$$

The environment centres your equation on the page and places the equation number in the right margin.

### figure

\begin{figure}[placement] body of the figure \caption{figure title} \end{figure}

Figures are objects that are not part of the normal text, and are usually "floated" to a convenient place, like the top of a page. Figures will not be split between two pages.

The optional argument determines where LaTeX will try to place your figure. There are four places where LaTeX can possibly put a float:

1. (Here) - at the position in the text where the figure environment appears.
2. (Top) - at the top of a text page.
3. (Bottom) - at the bottom of a text page.
4. (Page of floats) - on a separate float page, which is a page containing no text, only floats.

The standard report and article classes use the default placement .

The body of the figure is made up of whatever text, LaTeX commands, etc. you wish. The command allows you to title your figure.

### flushleft

\begin{flushleft} Text on line 1 \\ Text on line 2 \\ . . . \end{flushleft}

The environment allows you to create a paragraph consisting of lines that are flushed left, to the left-hand margin. Each line must be terminated with the string .

• \raggedright: The declaration form of the environment.

#### \raggedright

This declaration corresponds to the environment. This declaration can be used inside an environment such as or in a .

Unlike the environment, the command does not start a new paragraph; it simply changes how LaTeX formats paragraph units. To affect a paragraph unit's format, the scope of the declaration must contain the blank line or command (of an environment like quote) that ends the paragraph unit.

### flushright

\begin{flushright} Text on line 1 \\ Text on line 2 \\ . . . \end{flushright}

The environment allows you to create a paragraph consisting of lines that are flushed right, to the right-hand margin. Each line must be terminated with the string .

• \raggedleft: The declaration form of the environment.

#### \raggedleft

This declaration corresponds to the environment. This declaration can be used inside an environment such as or in a .

Unlike the environment, the command does not start a new paragraph; it simply changes how LaTeX formats paragraph units. To affect a paragraph unit's format, the scope of the declaration must contain the blank line or command (of an environment like quote) that ends the paragraph unit.

### itemize

\begin{itemize} \item First item \item Second item . . . \end{itemize}

The environment produces a "bulleted" list. Itemizations can be nested within one another, up to four levels deep. They can also be nested within other paragraph-making environments.

Each item of an list begins with an command. There must be at least one command within the environment.

The environment uses the through counters (see section Counters). The type of numbering can be changed by redefining etc.

### letter

This environment is used for creating letters. See section Letters.

### list

The environment is a generic environment which is used for defining many of the more specific environments. It is seldom used in documents, but often in macros.

\begin{list}{label}{spacing} \item First item \item Second item . . . \end{list}

The argument specifies how items should be labelled. This argument is a piece of text that is inserted in a box to form the label. This argument can and usually does contain other LaTeX commands.

The argument contains commands to change the spacing parameters for the list. This argument will most often be null, i.e., . This will select all default spacing which should suffice for most cases.

### minipage

\begin{minipage}[position]{width} text \end{minipage}

The environment is similar to a command. It takes the same optional argument and mandatory argument. You may use other paragraph-making environments inside a minipage.

Footnotes in a environment are handled in a way that is particularly useful for putting footnotes in figures or tables. A or command puts the footnote at the bottom of the minipage instead of at the bottom of the page, and it uses the counter instead of the ordinary counter See section Counters.

NOTE: Don't put one minipage inside another if you are using footnotes; they may wind up at the bottom of the wrong minipage.

### picture

\begin{picture}(width,height)(x offset,y offset) . . picture commands . . \end{picture}

The environment allows you to create just about any kind of picture you want containing text, lines, arrows and circles. You tell LaTeX where to put things in the picture by specifying their coordinates. A coordinate is a number that may have a decimal point and a minus sign -- a number like , or . A coordinate specifies a length in multiples of the unit length , so if has been set to , then the coordinate 2.54 specifies a length of 2.54 centimetres. You can change the value of anywhere you want, using the command, but strange things will happen if you try changing it inside the picture environment.

A position is a pair of coordinates, such as , specifying the point with x-coordinate and y-coordinate . Coordinates are specified in the usual way with respect to an origin, which is normally at the lower-left corner of the picture. Note that when a position appears as an argument, it is not enclosed in braces; the parentheses serve to delimit the argument.

The environment has one mandatory argument, which is a . It specifies the size of the picture. The environment produces a rectangular box with width and height determined by this argument's x- and y-coordinates.

The environment also has an optional argument, following the argument, that can change the origin. (Unlike ordinary optional arguments, this argument is not contained in square brackets.) The optional argument gives the coordinates of the point at the lower-left corner of the picture (thereby determining the origin). For example, if has been set to , the command

\begin{picture}(100,200)(10,20)

produces a picture of width 100 millimeters and height 200 millimeters, whose lower-left corner is the point (10,20) and whose upper-right corner is therefore the point (110,220). When you first draw a picture, you will omit the optional argument, leaving the origin at the lower-left corner. If you then want to modify your picture by shifting everything, you just add the appropriate optional argument.

The environment's mandatory argument determines the nominal size of the picture. This need bear no relation to how large the picture really is; LaTeX will happily allow you to put things outside the picture, or even off the page. The picture's nominal size is used by LaTeX in determining how much room to leave for it.

Everything that appears in a picture is drawn by the command. The command

\put (11.3,-.3){...}

puts the object specified by in the picture, with its reference point at coordinates (11.3,-.3). The reference points for various objects will be described below.

The command creates an LR box. You can put anything in the text argument of the command that you'd put into the argument of an and related commands. When you do this, the reference point will be the lower left corner of the box.

Picture commands:

#### \circle

The command produces a circle with a diameter as close to the specified one as possible. If the -form of the command is used, LaTeX draws a solid circle.

Note that only circles up to 40 pt can be drawn.

#### \dashbox

Draws a box with a dashed line.

The has an extra argument which specifies the width of each dash. A dashed box looks best when the and are multiples of the .

#### \frame

The command puts a rectangular frame around the object specified in the argument. The reference point is the bottom left corner of the frame. No extra space is put between the frame and the object.

#### \framebox

The command is exactly the same as the command, except that it puts a frame around the outside of the box that it creates.

The command produces a rule of thickness , and leaves a space between the rule and the contents of the box.

#### \line

The command draws a line of the specified and .

Note that LaTeX can only draw lines with slope = x/y, where x and y have integer values from -6 through 6.

#### \linethickness

Declares the thickness of horizontal and vertical lines in a picture environment to be , which must be a positive length. It does not affect the thickness of slanted lines and circles, or the quarter circles drawn by to form the corners of an oval.

#### \makebox

The command for the picture environment is similar to the normal command except that you must specify a and in multiples of .

The optional argument, , specifies the quadrant that your text appears in. You may select up to two of the following:

• - Moves the item to the top of the rectangle
• - Moves the item to the bottom
• - Moves the item to the left
• - Moves the item to the right

See section \makebox.

#### \multiput

The command can be used when you are putting the same object in a regular pattern across a picture.

#### \oval

The command produces a rectangle with rounded corners. The optional argument, , allows you to select part of the oval.

• - Selects the top portion
• - Selects the bottom portion
• - Selects the right portion
• - Selects the left portion

Note that the "corners" of the oval are made with quarter circles with a maximum radius of 20 pt, so large "ovals" will look more like boxes with rounded corners.

#### \put

The command places the item specified by the mandatory argument at the given coordinates.

#### \shortstack

The command produces a stack of objects. The valid positions are:

• - Moves the objects to the right of the stack
• - Moves the objects to the left of the stack
• - Moves the objects to the center of the stack (default)

#### \vector

The command draws a line with an arrow of the specified length and slope. The and values must lie between -4 and +4, inclusive.

### quotation

\begin{quotation} text \end{quotation}

The margins of the environment are indented on the left and the right. The text is justified at both margins and there is paragraph indentation. Leaving a blank line between text produces a new paragraph.

### quote

\begin{quote} text \end{quote}

The margins of the environment are indented on the left and the right. The text is justified at both margins. Leaving a blank line between text produces a new paragraph.

### tabbing

\begin{tabbing} text \= more text \= still more text \= last text \\ second row \> \> more \\ . . . \end{tabbing}

The environment provides a way to align text in columns. It works by setting tab stops and tabbing to them much the way you do with an ordinary typewriter.

It is best suited for cases where the width of each column is constant and known in advance.

This environment can be broken across pages, unlike the environment.

The following commands can be used inside a environment:

Sets a tab stop at the current position.
Advances to the next tab stop.
This command allows you to put something to the left of the local margin without changing the margin. Can only be used at the start of the line.
Moves the left margin of the next and all the following commands one tab stop to the right.
Moves the left margin of the next and all the following commands one tab stop to the left.
Moves everything that you have typed so far in the current column, i.e. everything from the most recent , , , , or command, to the right of the previous column, flush against the current column's tab stop.
Allows you to put text flush right against any tab stop, including tab stop 0. However, it can't move text to the right of the last column because there's no tab stop there. The command moves all the text that follows it, up to the or command that ends the line, to the right margin of the tabbing environment. There must be no or command between the and the command that ends the line.
Sets tab stops without producing text. Works just like except that it throws away the current line instead of producing output for it. The effect of any , or commands in that line remain in effect.
Saves all current tab stop positions. Useful for temporarily changing tab stop positions in the middle of a environment.
Restores the tab stop positions saved by the last .
In a environment, the commands , and do not produce accents as normal. Instead, the commands , and are used.

This example typesets a Pascal function in a traditional format:

\begin{tabbing} function \= fact(n : integer) : integer;\\ \> begin \= \+ \\ \> if \= n $>$ 1 then \+ \\ fact := n * fact(n-1) \- \\ else \+ \\ fact := 1; \-\- \\ end;\\ \end{tabbing}

### table

\begin{table}[placement] body of the table \caption{table title} \end{table}

Tables are objects that are not part of the normal text, and are usually "floated" to a convenient place, like the top of a page. Tables will not be split between two pages.

The optional argument determines where LaTeX will try to place your table. There are four places where LaTeX can possibly put a float:

• : Here - at the position in the text where the table environment appears.
• : Top - at the top of a text page.
• : Bottom - at the bottom of a text page.
• : Page of floats - on a separate float page, which is a page containing no text, only floats.

The standard and classes use the default placement .

The body of the table is made up of whatever text, LaTeX commands, etc., you wish. The command allows you to title your table.

### tabular

\begin{tabular}[pos]{cols} column 1 entry & column 2 entry ... & column n entry \\ . . . \end{tabular}

or

\begin{tabular*}{width}[pos]{cols} column 1 entry & column 2 entry ... & column n entry \\ . . . \end{tabular*}

These environments produce a box consisting of a sequence of rows of items, aligned vertically in columns. The mandatory and optional arguments consist of:

Specifies the width of the environment. There must be rubber space between columns that can stretch to fill out the specified width.
Specifies the vertical position; default is alignment on the center of the environment.
• - align on top row
• - align on bottom row
Specifies the column formatting. It consists of a sequence of the following specifiers, corresponding to the sequence of columns and intercolumn material.
• - A column of left-aligned items.
• - A column of right-aligned items.
• - A column of centred items.
• - A vertical line the full height and depth of the environment.
• - This inserts in every row. An @-expression suppresses the intercolumn space normally inserted between columns; any desired space between the inserted text and the adjacent items must be included in text. An command in an @-expression causes an extra space of width to appear to the left of all subsequent columns, until countermanded by another command. Unlike ordinary intercolumn space, this extra space is not suppressed by an @-expression. An command can be used only in an @-expression in the argument.
• - Produces a column with each item typeset in a parbox of width , as if it were the argument of a command. However, a may not appear in the item, except in the following situations:
1. inside an environment like , , or .
2. inside an explicit .
3. in the scope of a , , or declaration. The latter declarations must appear inside braces or an environment when used in a -column element.
• - Equivalent to copies of , where is any positive integer and is any list of column-specifiers, which may contain another .

These commands can be used inside a environment:

• \cline: Draw a horizontal line spanning some columns.
• \hline: Draw a horizontal line spanning all columns.
• \multicolumn: Make an item spanning several columns.
• \vline: Draw a vertical line.

#### \cline

The command draws horizontal lines across the columns specified, beginning in column and ending in column , which are identified in the mandatory argument.

#### \hline

The command will draw a horizontal line the width of the table. It's most commonly used to draw a line at the top, bottom, and between the rows of the table.

#### \multicolumn

The is used to make an entry that spans several columns. The first mandatory argument, , specifies the number of columns to span. The second mandatory argument, , specifies the formatting of the entry; for centred, for flushleft, for flushright. The third mandatory argument, , specifies what text is to make up the entry.

#### \vline

The command will draw a vertical line extending the full height and depth of its row. An command can be used to move the line to the edge of the column. It can also be used in an @-expression.

### thebibliography

\begin{thebibliography}{widest-label} \bibitem[label]{cite_key} . . . \end{thebibliography}

The environment produces a bibliography or reference list. In the class, this reference list is labelled "References"; in the class, it is labelled "Bibliography".

• : Text that, when printed, is approximately as wide as the widest item label produces by the commands.
• \bibitem: Specify a bibliography item.
• \cite: Refer to a bibliography item.
• \nocite: Include an item in the bibliography.
• Using BibTeX: Automatic generation of bibliographies.

#### \bibitem

The command generates an entry labelled by . If the argument is missing, a number is generated as the , using the counter. The is any sequence of letters, numbers, and punctuation symbols not containing a comma. This command writes an entry on the file containing and the item's . When this file is read by the command, the item's is associated with , causing the reference to by a command to produce the associated .

#### \cite

The argument is a list of citation keys. This command generates an in-text citation to the references associated with the keys in by entries on the file read by the command.

The optional argument will appear after the citation, i.e. might produce [Knuth, p. 2]'.

#### \nocite

The command produces no text, but writes , which is a list of one or more citation keys, on the file.

#### Using BibTeX

If you use the BibTeX program by Oren Patashnik (highly recommended if you need a bibliography of more than a couple of titles) to maintain your bibliography, you don't use the environment. Instead, you include the lines

\bibliographystyle{style} \bibliography{bibfile}

where refers to a file , which defines how your citations will look. The standard styles distributed with BibTeX are:

Sorted alphabetically. Labels are formed from name of author and year of publication.
Sorted alphabetically. Labels are numeric.
Like , but entries are in order of citation.
Like , but more compact labels.

In addition, numerous other BibTeX style files exist tailored to the demands of various publications.

The argument to refers to the file , which should contain your database in BibTeX format. Only the entries referred to via and will be listed in the bibliography.

### theorem

\begin{theorem} theorem text \end{theorem}

The environment produces "Theorem x" in boldface followed by your theorem text.

### titlepage

\begin{titlepage} text \end{titlepage}

The environment creates a title page, i.e. a page with no printed page number or heading. It also causes the following page to be numbered page one. Formatting the title page is left to you. The command comes in handy for title pages.

Note that you can use the (see section \maketitle) command to produce a standard title page.

### verbatim

\begin{verbatim} text \end{verbatim}

The environment is a paragraph-making environment that gets LaTeX to print exactly what you type in. It turns LaTeX into a typewriter with carriage returns and blanks having the same effect that they would on a typewriter.

• \verb: The macro form of the environment.

#### \verb

Typesets exactly as typed, including special characters and spaces, using a typewriter () type style. There may be no space between or and (space is shown here only for clarity). The differs only in that spaces are printed as `\verb*| |'.

### verse

\begin{verse} text \end{verse}

The environment is designed for poetry, though you may find other uses for it.

The margins are indented on the left and the right. Separate the lines of each stanza with , and use one or more blank lines to separate the stanzas.

Footnotes can be produced in one of two ways. They can be produced with one command, the command. They can also be produced with two commands, the and the commands. See the specific command for information on why you would use one over the other.

### \footnote

The command places the numbered footnote at the bottom of the current page. The optional argument, , is used to change the default footnote number. This command can only be used in outer paragraph mode; i.e., you cannot use it in sectioning commands like , in figures, tables or in a environment.

### \footnotemark

The command puts the footnote in the text. This command can be used in inner paragraph mode. The text of the footnote is supplied by the command.

This command can be used to produce several consecutive footnote markers referring to the same footnote by using

after the first command.

### \footnotetext

The command produces the to be placed at the bottom of the page. This command can come anywhere after the command. The command must appear in outer paragraph mode.

The optional argument, , is used to change the default footnote number.

A is a measure of distance. Many LaTeX commands take a length as an argument.

### \newlength

The command defines the mandatory argument, , as a command with a value of . An error occurs if a command already exists.

### \setlength

The command is used to set the value of a command. The argument can be expressed in any terms of length LaTeX understands, i.e., inches (), millimeters (), points (), etc.

The command increments a "length command" by the amount specified in the argument. It can be a negative amount.

### \settodepth

The command sets the value of a command equal to the depth of the argument.

### \settoheight

The command sets the value of a command equal to the height of the argument.

### \settowidth

The command sets the value of a command equal to the width of the argument.

### Predefined lengths

These length parameters can be used in the arguments of the box-making commands See section Spaces & Boxes. They specify the natural width etc. of the text in the box. equals + . To make a box with the text stretched to double the natural size, e.g., say

You can use LaTeX to typeset letters, both personal and business. The document class is designed to make a number of letters at once, although you can make just one if you so desire.

Your source file has the same minimum commands as the other document classes, i.e., you must have the following commands as a minimum:

\documentclass{letter} \begin{document} ... letters ... \end{document}

Each letter is a environment, whose argument is the name and address of the recipient. For example, you might have:

\begin{letter}{Mr. Joe Smith\\ 2345 Princess St. \\ Edinburgh, EH1 1AA} ... \end{letter}

The letter itself begins with the command. The text of the letter follows. It is typed as ordinary LaTeX input. Commands that make no sense in a letter, like , do not work. The letter closes with a command.

After the , you can have additional material. The command produces the usual "cc: ...". There's also a similar command for a list of enclosures. With both these commands, use to separate the items.

These commands are used with the class:

The return address, as it should appear on the letter and the envelope. Separate lines of the address should be separated by commands. If you do not make an declaration, then the letter will be formatted for copying onto your organization's standard letterhead. If you give an declaration, then the letter will be formatted as a personal letter.

### \cc

Generate a list of other persons the letter was sent to. Each name is printed on a separate line.

### \closing

The letter closes with a command, i.e.,

\closing{Best Regards,}

### \encl

Generate a list of enclosed material.

### \location

This modifies your organization's standard address. This only appears if the pagestyle is selected.

### \makelabels

If you issue this command in the preamble, LaTeX will create a sheet of address labels. This sheet will be output before the letters.

### \name

Your name, used for printing on the envelope together with the return address.

### \opening

The letter begins with the command. The mandatory argument, , is whatever text you wish to start your letter, i.e.,

\opening{Dear Joe,}

### \ps

Use this command before a postscript.

### \signature

Your name, as it should appear at the end of the letter underneath the space for your signature. Items that should go on separate lines should be separated by commands.

### \startbreaks

Used after a command to allow page breaks again.

### \stopbreaks

Inhibit page breaks until a command occurs.

### \telephone

This is your telephone number. This only appears if the pagestyle is selected.

The first thing LaTeX does when processing ordinary text is to translate your input file into a string of glyphs and spaces. To produce a printed document, this string must be broken into lines, and these lines must be broken into pages. In some environments, you do the line breaking yourself with the command, but LaTeX usually does it for you.

### \\

The command tells LaTeX to start a new line. It has an optional argument, , that specifies how much extra vertical space is to be inserted before the next line. This can be a negative amount.

The command is the same as the ordinary command except that it tells LaTeX not to start a new page after the line.

### \-

The command tells LaTeX that it may hyphenate the word at that point. LaTeX is very good at hyphenating, and it will usually find all correct hyphenation points. The command is used for the exceptional cases.

Note that when you insert commands in a word, the word will only be hyphenated at those points and not at any of the hyphenation points that LaTeX might otherwise have chosen.

### \cleardoublepage

The command ends the current page and causes all figures and tables that have so far appeared in the input to be printed. In a two-sided printing style, it also makes the next page a right-hand (odd-numbered) page, producing a blank page if necessary.

### \clearpage

The command ends the current page and causes all figures and tables that have so far appeared in the input to be printed.

### \enlargethispage

Enlarge the for the current page by the specified amount; e.g. will allow one additional line.

The starred form tries to squeeze the material together on the page as much as possible. This is normally used together with an explicit .

### \fussy

This declaration (which is the default) makes TeX more fussy about line breaking. This can avoids too much space between words, but may produce overfull boxes.

This command cancels the effect of a previous command. section \sloppy

### \hyphenation

The command declares allowed hyphenation points, where is a list of words, separated by spaces, in which each hyphenation point is indicated by a character.

### \linebreak

The command tells LaTeX to break the current line at the point of the command. With the optional argument, , you can convert the command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.

The command causes LaTeX to stretch the line so it extends to the right margin.

### \newline

The command breaks the line right where it is. It can only be used in paragraph mode.

### \newpage

The command ends the current page.