Beruflich Dokumente
Kultur Dokumente
LaTeX/Bibliography Management
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 builtin support for citing references. However, a much more powerful and flexible solution is achieved thanks to an auxiliary tool called BibTeX (http://www.bibtex.org) (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 (a . b i b ) and another concerning topic B (b . b i b ). When writing about topic AB, both of these files can be linked into the document (perhaps in addition to sources a b . b i bspecific to topic AB).
LaTeX Getting Started 1. 2. 3. 4. Introduction Installation Installing Extra Packages Basics
Common Elements 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. Document Structure Text Formatting Paragraph Formatting Colors Fonts List Structures Special Characters Internationalization Rotations Tables Title creation Page Layout Importing Graphics Floats, Figures and Captions Footnotes and Margin Notes Hyperlinks Labels and Cross-referencing
Contents
1 Embedded system 2 Citations 2.1 Referring more specific 2.2 Multiple citations 2.3 No cite 2.4 Natbib 3 BibTeX 3.1 Authors 3.2 Standard templates 3.3 Not standard templates 3.4 Preserving case of letters 3.5 A few additional examples 3.6 Getting current LaTeX document to use your .bib file 3.7 Why won't LaTeX generate any output? 3.8 Bibliography styles 3.9 Including URLs in bibliography 3.10 Customizing bibliography appearance 3.11 Localizing bibliography appearance 3.12 Showing unused items 3.13 Getting bibliographic data 3.14 Helpful tools
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
Mechanics 1. 2. 3. 4. 5. Errors and Warnings Lengths Counters Boxes Rules and Struts
Technical Texts 1. 2. 3. 4. 5. 6. 7. Mathematics Advanced Mathematics Theorems Chemical Graphics Algorithms Source Code Listings Linguistics
13/2/2014
3.15 Summary 4 Bibliography in the table of contents 4.1 Using tocbibind 4.2 Other methods 4.2.1 As unnumbered item 4.2.2 As numbered item 5 BibLaTeX 6 Multiple bibliographies 6.1 Using multibib 6.2 Using bibtopic 7 Notes and references
2. Presentations 3. Teacher's Corner 4. Curriculum Vitae Creating Graphics 1. 2. 3. 4. 5. 6. 7. Introducing Procedural Graphics MetaPost Picture PGF/TikZ PSTricks Xy-pic Creating 3D graphics
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, maybe you don't 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 t h e b i b l i o g r a p h ythat you have to use where you want the bibliography; that usually means at the very end of your document, just before the \ e n d { d o c u m e n t } command. Here is a practical example: \ b e g i n { t h e b i b l i o g r a p h y } { 9 } \ b i b i t e m { l a m p o r t 9 4 } L e s l i eL a m p o r t , \ e m p h { \ L a T e X :AD o c u m e n tP r e p a r a t i o n S y s t e m } . A d d i s o nW e s l e y ,M a s s a c h u s e t t s , 2 n dE d i t i o n , 1 9 9 4 . \ e n d { t h e b i b l i o g r a p h y }
Miscellaneous 1. Modular Documents 2. Collaborative Writing of LaTeX Documents 3. Export To Other Formats Help and Recommendations 1. FAQ 2. Tips and Tricks Appendices 1. 2. 3. 4. 5. 6. Authors Links Package Reference Sample LaTeX documents Index Command Glossary
OK, so what is going on here? The first thing to notice is the establishment of the environment. t h e b i b l i o g r a p h yis a keyword that LaTeX recognizes as everything between the begin and end tags as being 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 \ b i b i t e m { c i t e _ k e y }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
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 2/22
edit this box (http://en.wikibooks.org/w/index.php? title=T emplate:LaT eX/T op&action=edit) edit the T OC (http://en.wikibooks.org/w/index.php? title=T emplate:LaT eX/Contents&action=edit)
13/2/2014
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. I wanted the title to be in italics, so I used the \ e m p h { } command to achieve this.
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: \ c i t e { c i t e _ k e y } , 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 renumber all the citations by hand. I n s t e a do fW Y S I W Y Ge d i t o r s ,t y p e s e t t i n gs y s t e m sl i k e\ T e X { }o r \ L a T e X { }\ c i t e { l a m p o r t 9 4 }c a nb eu s e d .
Multiple citations
When a sequence of multiple citations are needed, you should use a single \ c i t e { }command. The citations are then separated by commas. Note that you must not use spaces between the citations. Here's an example: \ c i t e { c i t a t i o n 0 1 , c i t a t i o n 0 2 , c i t a t i o n 0 3 } The result will then be shown as citations inside the same brackets.
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 \ n o c i t e { }command can be used, for example: L a m p o r ts h o w e di n1 9 9 5s o m e t h i n g . . . \ n o c i t e { l a m p o r t 9 5 } . A special version of the command, \ n o c i t e { * } , includes all entries from the database, whether they are referenced in the document or not.
Natbib
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 3/22
13/2/2014
Using the standard LaTeX bibliography support, you will Natbib commands see that each reference is Citation command Output numbered and each citation c i t e t { g o o s s e n s 9 3 } Goossens et al. (1993) corresponds to the numbers. \ The numeric style of citation is \ c i t e p { g o o s s e n s 9 3 } (Goossens et al., 1993) quite common in scientific c i t e t * { g o o s s e n s 9 3 } Goossens, Mittlebach, and Samarin (1993) writing. In other disciplines, the \ author-year style, e.g., \ c i t e p * { g o o s s e n s 9 3 } (Goossens, Mittlebach, and Samarin, 1993) (Roberts, 2003), such as \ c i t e a u t h o r { g o o s s e n s 9 3 } Goossens et al. Harvard is preferred. A c i t e a u t h o r * { g o o s s e n s 9 3 } Goossens, Mittlebach, and Samarin discussion about which is best \ will not occur here, but a \ c i t e y e a r { g o o s s e n s 9 3 } 1993 possible way to get such an \ c i t e y e a r p a r { g o o s s e n s 9 3 } (1993) output is by the n a t b i b package. In fact, it can \ c i t e a l t { g o o s s e n s 9 3 } Goossens et al. 1993 supersede LaTeX's own \ c i t e a l p { g o o s s e n s 9 3 } Goossens et al., 1993 citation commands, as Natbib c i t e t e x t { p r i v . \c o m m . } (priv. comm.) 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: \ u s e p a c k a g e [ o p t i o n s ] { n a t b i b } 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: \ b i b l i o g r a p h y s t y l e { p l a i n n a t } . Once done, it is basically a matter of altering the existing \ c i t ecommands to display the type of citation you want. Natbib-compatible styles Source Provided Provided Provided REVTeX 4 home page (http://authors.aps.org/revtex4/) REVTeX 4 home page (http://authors.aps.org/revtex4/) TeX Catalogue entry (http://www.ctan.org/texarchive/help/Catalogue/entries/ieeetran.html) TeX Catalogue entry (http://www.ctan.org/texarchive/help/Catalogue/entries/achemso.html) TeX Catalogue entry (http://www.ctan.org/texarchive/help/Catalogue/entries/rsc.html)
Description natbib-compatible version of plain natbib-compatible version of abbrv natbib-compatible version of unsrt natbib-compatible style for Physical Review journals natbib-compatible style for Review of Modern Physics journals natbib-compatible style for IEEE publications natbib-compatible style for American Chemical Society journals natbib-compatible style for Royal Society of Chemistry journals
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
4/22
13/2/2014
Natbib options Option round square curly angle colon comma authoryear numbers super sort sort&compress longnamesfirst sectionbib nonamebreak Parentheses () (default) Square brackets [] Curly braces {} Angle brackets <> multiple citations are separated by semi-colons (default) multiple citations are separated by commas author year style citations (default) numeric citations superscripted numeric citations multiple citations are sorted into the order in which they appear in the references section as sort, 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 Meaning
The main commands simply add a t for 'textual' or p for 'parenthesized', to the basic \ c i t ecommand. 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 a b b r v n a tdoes not support \ c i t e t *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 \ b i b p u n c tthat can be used to override the defaults and change certain settings. For example, I have put the following in the preamble: \ b i b p u n c t { ( } { ) } { ; } { a } { , } { , } The command requires six mandatory parameters. 1. 2. 3. 4. The symbol for the opening bracket. The symbol for the closing bracket. The symbol that appears between multiple citations. This argument takes a letter: n - numerical style. s - numerical superscript style.
5/22
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
13/2/2014
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 \ b i b p u n c tare 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 (http://www.ctex.org/documents/packages/bibref/natbib.pdf), 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 \ c i t ecommand 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:
@ a r t i c l e { g r e e n w a d e 9 3 , a u t h o r =" G e o r g eD .G r e e n w a d e " , t i t l e =" T h e{ C } o m p r e h e n s i v e{ T } e x{ A } r c h i v e{ N } e t w o r k( { C T A N } ) " , y e a r =" 1 9 9 3 " , j o u r n a l=" T U G B o a t " , v o l u m e =" 1 4 " , n u m b e r =" 3 " , p a g e s =" 3 4 2 3 5 1 " }
Each entry begins with the declaration of the reference type, in the form of @ t y p e . 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 \ " { o } , and the quotation mark will close the one opening the field, causing an error in the parsing of the reference. Using \ u s e p a c k a g e [ u t f 8 ] { i n p u t e n c }in the preamble to the . t e xsource file can get
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 6/22
13/2/2014
round this, as the accented characters can just be stored in the . b i bfile without any need for special markup. This allows a consistent format to be kept throughout the . b i bfile, 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 (http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node6.html) and also this field reference (http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node7.html) 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.
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:
@ b o o k { g o o s s e n s 9 3 , a u t h o r =" M i c h e lG o o s s e n sa n dF r a n kM i t t e l b a c ha n dA l e x a n d e rS a m a r i n " , t i t l e =" T h eL a T e XC o m p a n i o n " , y e a r =" 1 9 9 3 " , p u b l i s h e r=" A d d i s o n W e s l e y " , a d d r e s s =" R e a d i n g ,M a s s a c h u s e t t s " }
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. Required fields: author, title, journal, year. Optional fields: volume, number, pages, month, note.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 7/22
13/2/2014
@ a r t i c l e { X a r t i c l e , a u t h o r =" " , t i t l e =" " , j o u r n a l =" " , % v o l u m e =" " , % n u m b e r =" " , % p a g e s =" " , y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " , }
@book A published book Required fields: author/editor, title, publisher, year. Optional fields: volume/number, series, address, edition, month, note.
@ b o o k { X b o o k , a u t h o r =" " , t i t l e =" " , p u b l i s h e r=" " , % v o l u m e =" " , % n u m b e r =" " , % s e r i e s =" " , % a d d r e s s =" " , % e d i t i o n =" " , y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " , }
@booklet A bound work without a named publisher or sponsor. Required fields: title. Optional fields: author, howpublished, address, month, year, note.
@ b o o k l e t { X b o o k l e t , % a u t h o r =" " , t i t l e =" " , % h o w p u b l i s h e d =" " , % a d d r e s s =" " , y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " , }
@conference Equal to inproceedings Required fields: author, title, booktitle, year. Optional fields: editor, volume/number, series, pages, address, month, organization, publisher, note.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 8/22
13/2/2014
@ c o n f e r e n c e { X c o n f e r e n c e , a u t h o r =" " , t i t l e =" " , b o o k t i t l e=" " , % e d i t o r =" " , % v o l u m e =" " , % n u m b e r =" " , % s e r i e s =" " , % p a g e s =" " , % a d d r e s s =" " , y e a r =" X X X X " , % m o n t h =" " , % p u b l i s h e r =" " , % n o t e =" " , }
@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. @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. @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. @manual Technical manual Required fields: title. Optional fields: author, organization, address, edition, month, year, note. @mastersthesis Master's thesis Required fields: author, title, school, year. Optional fields: type (eg. "diploma thesis"), address, month, note.
@ m a s t e r s t h e s i s { X t h e s i s , a u t h o r =" " , t i t l e =" " , s c h o o l =" " , % t y p e =" d i p l o m at h e s i s " , % a d d r e s s =" " , y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " ,
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 9/22
13/2/2014
@misc Template useful for other kinds of publication Required fields: none Optional fields: author, title, howpublished, month, year, note.
@ m i s c { X m i s c , % a u t h o r =" " , % t i t l e =" " , % h o w p u b l i s h e d=" " , % y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " , }
@phdthesis Ph.D. thesis Required fields: author, title, year, school. Optional fields: address, month, keywords, note. @proceedings The proceedings of a conference. Required fields: title, year. Optional fields: editor, volume/number, series, address, month, organization, publisher, note. @techreport Technical report from educational, commercial or standardization institution. Required fields: author, title, institution, year. Optional fields: type, number, address, month, note.
@ t e c h r e p o r t { X t r e p o r t , a u t h o r =" " , t i t l e =" " , i n s t i t u t i o n=" " , % t y p e =" " , % n u m b e r =" " , % a d d r e s s =" " , y e a r =" X X X X " , % m o n t h =" " , % n o t e =" " , }
@unpublished An unpublished article, book, thesis, etc. Required fields: author, title, note. Optional fields: month, year.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 10/22
13/2/2014
13/2/2014
i n f e c t e dc e l l s " , p a g e s=" 3 9 7 4 0 5 " , b o o k t i t l e=" M o l e c u l a rb i o l o g yo fb a c t e r i o p h a g eT 4 " , e d i t o r=" K a r a m ,J i mD .K a r a ma n dD r a k e ,J o h nW .a n dK r e u z e r , K e n n e t hN .a n dM o s i g ,G i s e l a a n dH a l l ,D w i g h ta n dE i s e r l i n g ,F r e d e r i c kA .a n dB l a c k , L i n d s a yW .a n dK u t t e r ,E l i z a b e t h a n dC a r l s o n ,K a r i na n dM i l l e r ,E r i cS .a n dS p i c e r , E l e a n o r " , p u b l i s h e r=" A S MP r e s s ,W a s h i n g t o nD C " , y e a r=" 1 9 9 4 " } If you have to cite a website you can use @misc, for example: @ m i s c { w e b s i t e : f e r m e n t a s l a m b d a , a u t h o r=" F e r m e n t a sI n c . " , t i t l e=" P h a g eL a m b d a :d e s c r i p t i o n\ &r e s t r i c t i o nm a p " , m o n t h=" N o v e m b e r " , y e a r=" 2 0 0 8 " , u r l= " h t t p : / / w w w . f e r m e n t a s . c o m / t e c h i n f o / n u c l e i c a c i d s / m a p l a m b d a . h t m " } 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: @ a r t i c l e { b l a c k h o l e s , a u t h o r = " R a b b e r tK l e i n " , t i t l e = " B l a c kH o l e sa n dT h e i rR e l a t i o nt oH i d i n gE g g s " , j o u r n a l = " T h e o r e t i c a lE a s t e rP h y s i c s " , p u b l i s h e r = " E g g sL t d . " , y e a r = " 2 0 1 0 " , n o t e = " ( t oa p p e a r ) " }
13/2/2014
The second command is the one that actually specifies the . b i bfile you wish to use. The ones I created for this tutorial were called s a m p l e 1 . b i b ,s a m p l e 2 . b i b , . . ., s a m p l e n . b i b , but once again, you don't include the file extension. At the moment, the . b i bfile 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 \ b i b l i o g r a p h y { / s o m e / w h e r e / s a m p l e }or \ b i b l i o g r a p h y { . . / s a m p l e 1 }(if the . b i bfile is in the parent directory of the . t e xdocument that calls it). Now that LaTeX and BibTeX know where to look for the appropriate files, actually citing the references is fairly trivial. The \ c i t e { r e f _ k e y }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: \ c i t e { r e f _ k e y 1 ,r e f _ k e y 2 ,. . . ,r e f _ k e y N } .
(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:
L a T e XW a r n i n g :C i t a t i o n` l a m p o r t 9 4 'o np a g e1u n d e f i n e do ni n p u tl i n e2 1 . . . . L a T e XW a r n i n g :T h e r ew e r eu n d e f i n e dr e f e r e n c e s .
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:
T h i si sB i b T e X ,V e r s i o n0 . 9 9 c( W e b 2 C7 . 3 . 1 ) T h et o p l e v e la u x i l i a r yf i l e :l a t e x _ s o u r c e _ c o d e . a u x T h es t y l ef i l e :p l a i n . b s t D a t a b a s ef i l e# 1 :s a m p l e . b i b
The third step, which is invoking LaTeX for the second time will see more errors like "L a T e XW a r n i n g : L a b e l ( s )m a yh a v ec h a n g e d .R e r u nt og e tc r o s s r e f e r e n c e sr i g h t . ". 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 p d f l a t e xinstead of l a t e xas follows: 1. p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 13/22
13/2/2014
2. b i b t e xl a t e x _ s o u r c e _ c o d e . a u x 3. p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x 4. p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x (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: 1. : !p d f l a t e x% 2. : !b i b t e x% You will get an error similar to this: 1. I c o u l d n ' to p e nf i l en a m e' c u r r e n t _ f i l e . t e x . a u x ' 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. 2. 3. 4.
: !p d f l a t e x% : !b i b t e x% : r(without file extension, : !p d f l a t e x% : !p d f l a t e x%
However, it is much easier to install the Vim-LaTeX plugin from here (http://vim-latex.sourceforge.net/). 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 (http://vim-latex.sourceforge.net/documentation/latex-suite-quickstart/) 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 (http://en.wikipedia.org/wiki/Make_%28software%29). 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:
l a t e x _ s o u r c e _ c o d e . p d f :l a t e x _ s o u r c e _ c o d e . t e xl a t e x _ s o u r c e _ c o d e . b i b p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x b i b t e xl a t e x _ s o u r c e _ c o d e . a u x p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x p d f l a t e xl a t e x _ s o u r c e _ c o d e . t e x
Bibliography styles
Below you can see three of the styles available with LaTeX:
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
14/22
13/2/2014
plain
abbrv
alpha
Here are some more often used styles: Style Name plain unsrt abbrv alpha abstract acm authordate1 apa named Author Name Format Homer Jay Simpson Homer Jay Simpson H. J. Simpson Homer Jay Simpson Homer Jay Simpson Simpson, H. J. Simpson, Homer Jay Simpson, H. J. (1995) Homer Jay Simpson Reference Format #ID# #ID# #ID# Sim95 Simpson-1995a #ID# Simpson, 1995 Simpson1995 Simpson 1995 Sorting by author as referenced by author by author
However, keep in mind that you will need to use the natbib package to use most of these.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 15/22
13/2/2014
More examples can be found here: Overview of Bibtex-Styles (http://nodonn.tipido.net/bibstyle.php): Filterable list of styles with preview. Preview of several often used styles (http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html) LaTeX Bibliography Style Database (http://bst.maururu.net/) provides more than 2000 styles which can be searched by the journal title.
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 (http://www.mps.mpg.de/software/latex/localtex/localltx.html#makebst)) and it's very simple to initiate. At the command line, type:
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 16/22
13/2/2014
l a t e xm a k e b s t
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 (http://www.mps.mpg.de/software/latex/localtex/doc/merlin.pdf) 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 . b s tfile you want to use is reflected in the \ b i b l i o g r a p h y s t y l e { s t y l e }command (but don't include the . b s textension!).
@ a r t i c l e { m u e l l e r 0 8 , %. . . l a n g u a g e={ g e r m a n } }
For b a b e l b i bto take effect, a bibliography style supported by it - one of b a b p l a i n ,b a b p l a i 3 ,b a b a l p h a , b a b u n s r t ,b a b a b b r v , and b a b a b b r 3- must be used: \ b i b l i o g r a p h y s t y l e { b a b p l a i n } \ b i b l i o g r a p h y { s a m p l e }
13/2/2014
Helpful tools
Mendeley (http://mendeley.com) Mendeley is cost-free academic software for managing PDFs which can manage a bibliography in Open Office and read BibTeX. Zotero (http://www.zotero.org/) Zotero is a free and open reference manager working as a Firefox plugin or standalone application, capable of importing and exporting bib files. JabRef (http://jabref.sourceforge.net/) is a Java program (under Literatur-Generator the GPL license) which lets you search many bibliographic databases such as Medline, Citeseer, IEEEXplore and arXiv and feed and manage your BibTeX local databases with your selected articles. Based on BiBTeX, JabRef can export in many other output formats such as html, MS Word or EndNote. It can be used online without being installed (http://jabref.sourceforge.net/jws/jabref.jnlp) Referencer (http://icculus.org/referencer/index.html) Referencer is a Gnome application to organise documents or references, and ultimately generate a BibTeX bibliography file. Citavi (http://www.citavi.ch) Commercial software (with sizeJabRef 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. cb2Bib (http://www.molspaces.com/cb2bib/) The cb2Bib is a tool for rapidly extracting unformatted, or unstandardized bibliographic references from email alerts, journal Web pages, and PDF files. BibDesk KBibTeX (http://www.unix-ag.uni-kl.de/~fischer/kbibtex/) KBibTeX is a BibTeX editor for KDE to edit bibliographies used with LaTeX. Features include comfortable input masks, starting web queries (e. g. Google or PubMed) and exporting to PDF, PostScript, RTF and XML/HTML. As KBibTeX is using KDE's KParts technology, KBibTeX can be embedded into Kile or Konqueror. KBib (http://users.tpg.com.au/thachly/kbib/) Another BibTeX editor for KDE. It has similar capabilities, and slightly different UI. Features include BibTeX reference generation from PDF files, plain text, DOI, arXiv & PubMed IDs. Web queries to Google Scholar, PubMer, arXiv and a number of other services are also supported.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 18/22
13/2/2014
Bibwiki (http://www.mediawiki.org/wiki/Extension:Bibwiki) Bibwiki is a Specialpage for MediaWiki to manage BibTeX bibliographies. It offers a straightforward way to import and export bibliographic records. BibDesk (http://bibdesk.sourceforge.net/) 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. CiteULike (http://www.citeulike.org/) 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. Bibtex (http://stat.genopole.cnrs.fr/~cambroise/doku.php?id=softwares:dokuwikibibtexplugin) Bibtex is a DokuWiki plugin that allows for the inclusion of bibtex formatted citations in DokuWiki pages and displays them in APA format. Note: This Plugins is vulnerable to an XSS attack -> http://www.dokuwiki.org/plugin:bibtex BibSonomy (http://www.bibsonomy.org/) A free social bookmark and publication management system based on BibTeX. Synapsen (http://www.verzetteln.de/synapsen/) Hypertextual Card Index / Reference Manager with special support for BiBTeX / biblatex, written in Java. Ebib (http://ebib.sourceforge.net/) a BibTeX database manager for Emacs, well resolved and never more than a few keystrokes away. Literatur-Generator (http://literatur-generator.de/) is a German-language online tool for creating a bibliography (Bibtex, Endnote, Din 1505, ...).
Summary
Although it can take a little time to get to grips with BibTeX, in the long term, it's an efficient way to handle your references. It's not uncommon to find .bib files on websites that people compile as a list of their own publications, or a survey of relevant works within a given topic, etc. Or in those huge, online bibliography databases, you often find BibTeX versions of publications, so it's a quick cut-and-paste into your own .bib file, and then no more hassle! Having all your references in one place can be a big advantage. And having them in a structured form, that allows customizable output is another one. There are a variety of free utilities that can load your .bib files, and allow you to view them in a more efficient manner, as well as sort them and check for errors.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
19/22
13/2/2014
Both of these examples will create a chapter-like (or section-like) output showing all your references. But even though the resulting References looks like a chapter or section, it will not be handled quite the same: it will not appear in the Table of Contents.
Using tocbibind
The most comfortable way of adding your bibliography to the table of contents is to use the dedicated package tocbibind that works with many standard document classes. Simply include this code in the preamble of your document: \ u s e p a c k a g e [ n o t t o c ] { t o c b i b i n d } This will include the Bibliography in the Table of Contents without numbering. If you want to have proper numbering, include the following code in the preamble: \ u s e p a c k a g e [ n o t t o c , n u m b i b ] { t o c b i b i n d } The tocbibind package can also handle including the List of Figures, List of Tables and the Table of Contents itself in the Table of Contents. It has many options for numbering, document structure etc. to fit almost any scenario. See the tocbibind CTAN page (http://www.ctan.org/tex-archive/macros/latex/contrib/tocbibind) for detailed documentation.
Other methods
As unnumbered item If you want your bibliography to be in the table of contents, just add the following two lines just before the thebibliography environment: \ c l e a r p a g e \ a d d c o n t e n t s l i n e { t o c } { c h a p t e r } { B i b l i o g r a p h y } (OR \ a d d c o n t e n t s l i n e { t o c } { s e c t i o n } { B i b l i o g r a p h y }if you're writing an article) The first line just terminates the current paragraph and page. If you are writing a book , use \ c l e a r d o u b l e p a g e to match the style used. The second line will add a line in the Table of Contents (first option, toc), it will be like the ones created by chapters (second option, chapter), and the third argument will be printed on the corresponding line in the Table of Contents; here Bibliography was chosen because it's the same text the thebibliography environment will automatically write when you use it, but you are free to write whatever you like. If you are using separate bib file, add these lines between \ b i b l i o g r a p h y s t y l eand \ b i b l i o g r a p h y . If you use hyperref package, you should also use \ p h a n t o m s e c t i o ncommand to enable hyperlinking from the table of contents to bibliography. \ c l e a r d o u b l e p a g e \ p h a n t o m s e c t i o n \ a d d c o n t e n t s l i n e { t o c } { c h a p t e r } { B i b l i o g r a p h y } This trick is particularly useful when you have to insert the bibliography in the Table of Contents, but it can work for anything. When LaTeX finds the code above, it will record the info as described and the current page number, inserting a new line in the Contents page.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 20/22
13/2/2014
As numbered item If you instead want bibliography to be numbered section or chapter, you'll likely use this way:
You may wish to use \ r e n e w c o m m a n d * { \ r e f n a m e } { \ v s p a c e * { 1 e m } }followed by \ v s p a c e * { 1 e m }to counteract the extra space the blank \ r e f n a m einserts. Note: Use \ b i b n a m einstead of \ r e f n a m eif you use the book or report class.
BibLaTeX
As we said before, BibLaTeX is widely considered the `successor' of BibTeX. Intended as a full replacement for BibTeX, it is more configurable in its output and provides a multitude of new styles (for output) and fields (for the database) that can be used in a document. For now, refer to its comprehensive documentation on CTAN (http://www.ctan.org/pkg/biblatex).
Multiple bibliographies
Using m u l t i b i b
This package is for multiple Bibliographies for different sections in your work. For example, you can generate a bibliography for each chapter. You can find information about the package on CTAN[1]
Using b i b t o p i c
The bibtopic-Package[2] is created to differ the citations on more files, so that you can divide the bibliography into more parts.
\ d o c u m e n t c l a s s [ 1 1 p t ] { a r t i c l e }
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management 21/22
13/2/2014
\ u s e p a c k a g e { b i b t o p i c } \ b e g i n { d o c u m e n t } \ b i b l i o g r a p h y s t y l e { a l p h a } \ s e c t i o n { T e s t i n g } L e t sc i t ea l lt h eb o o k s :\ c i t e { C o l B e n h : 9 3 }a n d \ c i t e { M u n t : 9 3 } ;a n da na r t i c l e :\ c i t e { R o u x S m a r t : 9 5 } . F i l eb o o k s . b i bi su s ef o rt h i sl i s t i n g : \ b e g i n { b t S e c t } { b o o k s } \ s e c t i o n { R e f e r e n c e sf r o mb o o k s } \ b t P r i n t C i t e d \ e n d { b t S e c t } H e r e ,t h ea r t i c l e s . b i bi su s e d ,a n dt h el i s t i n gi si np l a i n f o r m a ti n s t e a do ft h es t a n d a r da l p h a . \ b e g i n { b t S e c t } [ p l a i n ] { a r t i c l e s } \ s e c t i o n { R e f e r e n c e sf r o ma r t i c l e s } \ b t P r i n t C i t e d \ s e c t i o n { A r t i c l e sn o tc i t e d } \ b t P r i n t N o t C i t e d \ e n d { b t S e c t } J u s tp r i n ta l le n t r i e sh e r ew i t h\ b t P r i n t A l l \ b e g i n { b t S e c t } [ p l a i n ] { i n t e r n e t } \ s e c t i o n { R e f e r e n c e sf r o mt h ei n t e r n e t } \ b t P r i n t A l l \ e n d { b t S e c t } \ e n d { d o c u m e n t }
Retrieved from "http://en.wikibooks.org/w/index.php? title=LaTeX/Bibliography_Management&oldid=2600748" This page was last modified on 15 January 2014, at 10:38. Text is available under the Creative Commons Attribution/Share-Alike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
22/22