Skip to content

Bibliography Latex Package Inputenc

LaTeX requires some additional configuration to typeset documents in languages other than English.


When using any language, LaTeX must handle two fundamental problems:

  1. Mapping the bytes of your input file into the characters of the language(s) you want to use.
  2. Mapping those characters to their glyphs in the fonts your document uses.

When using the or engines, much of these problems is solved for you. Input files are assumed to be UTF-8 (XeLaTeX also accepts UTF-16 and UTF-32), and the engine automatically maps Unicode characters to their glyphs in the TrueType or OpenType fonts you selected for your document. (This is, of course, assuming those fonts contain the glyphs you need, so you must ensure that your fonts support the languages you are using.)

When using the or engines, you must tell LaTeX which encoding to use for your input files, and what "output" encoding it should use to map characters to their glyphs in the fonts. In most cases (especially for multilingual documents), UTF-8 is an optimal input encoding, and can set using:


For most Latin languages, is the desired output encoding, and can be set with:

Other output encodings for specific languages are shown below.

For additional information, see the discussion of encoding in the Fonts chapter, as well as the Special Characters chapter.

International language support[edit]

There are currently two packages providing international language support, namely, Polyglossia and Babel. Polyglossia works mainly with XeTeX (with partial support for LuaTeX), while Babel works mainly with pdfTeX and LuaTeX (with partial support for XeTeX). Both packages handle the following tasks:

  1. Loading the language-specific hyphenation patterns and other typographical conventions.
  2. Setting the script and language tags of the current font, if possible. See the discussion of fontspec in the Fonts chapter.
  3. Switching between fonts for each language, as specified by the user (mainly XeTeX and LuaTeX).
  4. Translating document labels (like “chapter”, “figure”, “bibliography”).
  5. Formatting dates according to language-specific conventions.
  6. Formatting numbers for languages that have their own numbering system (currently only Polyglossia).
  7. Support for documents that contain bidirectional scripts. Polyglossia relies on the bidi package, while Babel uses an alternative approach, based on the Unicode algorithm and currently under development.


When using XeLaTeX or LuaLaTeX, the polyglossia package provides international language support, as described in its manual.

To use polyglossia, load it in your preamble and specify the languages you will be using, along with any language-specific options you wish. For example, in a document that contains American English and French, we might use:



When using the and engines, internationalization is provided by the babel package (which can also be used in LuaLaTeX and XeLaTeX in many languages). Languages are specified as arguments to the package when it is loaded:


You should place it soon after the command, so that all the other packages you load afterwards will know the language you are using. Babel will automatically activate the appropriate hyphenation rules for the language you choose. If your LaTeX format does not support hyphenation in the language of your choice, babel will still work but will disable hyphenation, which has quite a negative effect on the appearance of the typeset document (with LuaLaTeX, however, hyphenation rules can be loaded when the document is being typeset). Babel also specifies new commands for some languages, which simplify the input of special characters. See the sections about languages below for more information.

If you call babel with multiple languages:


then the last language in the option list will be active (i.e. languageB), and you can use the command


to change the active language. You can also add short pieces of text in another language using the command

\foreignlanguage{languageB}{Text in another language}

Babel also offers various environments for entering larger pieces of text in another language:

\begin{otherlanguage}{languageB} Text in language B. This environment switches all language-related definitions, like the language specific names for figures, tables etc. to the other language. \end{otherlanguage}

The starred version of this environment typesets the main text according to the rules of the other language, but keeps the language specific string for ancillary things like figures, in the main language of the document. The environment switches only the hyphenation patterns used; it can also be used to disallow hyphenation by using the language name 'nohyphenation' (but note is preferred).

The babel manual provides much more information on these and many other options.

Multilingual versions[edit]

It is possible in LaTeX to typeset the content of one document in several languages and to choose upon compilation which language to output. This might be convenient to keep a consistent sectioning and formatting across the different languages. It is also useful if you make use of multiple proper nouns and other untranslated content. Using the commands above in multilingual documents can be cumbersome, and therefore babel provides a way to define shorter names. With

You can write:

text \textde{German text} text text \begin{de} German text \end{de} text

Alternative choice using iflang[edit]

The current language can also be tested by using the iflang package by Heiko Oberdiek (the built-in feature from the babel package is not reliable). Here comes a simple example:


This allows to easily distinguish between two languages without the need of defining own commands. The babel language is changed by setting


Specific languages[edit]

Here is a collection of language-specific suggestions. If you have experience in a language not listed below, please add some notes about it. Some of the methods described in this chapter may be useful when dealing with non-English author names in bibliographies.

Arabic script[edit]

For languages which use the Arabic script, including Arabic, Persian, Urdu, Pashto, Kurdish, Uyghur, etc., add the following code to your preamble:

You can input text in either romanized characters or native Arabic script encodings. Use any of the following commands and environments to enter in text:

\< ... > \RL{ ... }\begin{arabtext} ... \end{arabtext}.

See the ArabTeX Wikipedia article for further details.

You may also use the Arabi package within Babel to typeset Arabic and Persian


You may also copy and paste from PDF files produced with Arabi thanks to the support of the cmap package. You may use Arabi with LyX, or with tex4ht to produce HTML.

See Arabi page on CTAN


The Armenian script uses its own characters, which will require you to install a text editor that supports Unicode and will allow you to enter UTF-8 text, such as Texmaker or WinEdt. These text editors should then be configured to compile using XeLaTeX.

Once the text editor is set up to compile with XeLaTeX, the fontspec package can be used to write in Armenian:

\usepackage{fontspec}\setmainfont{DejaVu Serif}



The Sylfaen font lacks italic and bold, but DejaVu Serif supports them.

See Armenian Wikibooks for further details, especially on how to configure the Unicode supporting text editors to compile with XeLaTeX.

Cyrillic script[edit]

Version 3.7h of babel includes support for the encodings and for typesetting Bulgarian, Russian and Ukrainian texts using Cyrillic letters[1]. Support for Cyrillic is based on standard LaTeX mechanisms plus the fontenc and inputenc packages. AMS-LaTeX packages should be loaded before fontenc and babel(Why?). If you are going to use Cyrillics in mathmode, you also need to load mathtext package before fontenc:


Generally, babel will automatically choose the default font encoding, for the above three languages this is However, documents are not restricted to a single font encoding. For multilingual documents using Cyrillic and Latin-based languages it makes sense to include Latin font encoding explicitly. Babel will take care of switching to the appropriate font encoding when a different language is selected within the document.

On modern operating systems it is beneficial to use Unicode (utf8 or utf8x) instead of KOI8-RU (koi8-ru) as an input encoding for Cyrillic text.

In addition to enabling hyphenations, translating automatically generated text strings, and activating some language specific typographic rules (like ), babel provides some commands allowing typesetting according to the standards of Bulgarian, Russian, or Ukrainian languages.

For all three languages, language specific punctuation is provided: the Cyrillic dash for the text (it is little narrower than Latin dash and surrounded by tiny spaces), a dash for direct speech, quotes, and commands to facilitate hyphenation:

Key combinationAction
No ligature at this position.
Explicit hyphen sign, allowing hyphenation in the rest of the word.
Cyrillic emdash in plain text.
Cyrillic emdash in compound names (surnames).
Cyrillic emdash for denoting direct speech.
Similar to , but it produces no hyphen sign (used for compound words with hyphen, e.g. or some other signs as “disable/enable”).
Compound word mark without a breakpoint.
Compound word mark with a breakpoint, allowing hyphenation in the composing words.
Thinspace for initials with a breakpoint in a following surname.
German opening double quote (,,).
German closing double quote (“).
French opening double quote (<<).
French closing double quote (>>).

The Russian and Ukrainian options of babel define the commands

which act like and (commands for turning counters into letters, e.g.), but produce capital and small letters of Russian or Ukrainian alphabets (whichever is the active language of the document).

The Bulgarian option of babel provides the commands


which make and produce letters of either Bulgarian or Latin (English) alphabets. The default behaviour of and for the Bulgarian language option is to produce letters from the Bulgarian alphabet.

See the Bulgarian translation of "The Not So Short Introduction to LaTeX" [2] for a method to type Cyrillic letters directly from the keyboard using a different distribution.


One possible Chinese support is made available thanks to the CJK package collection. If you are using a package manager or a portage tree, the CJK collection is usually in a separate package because of its size (mainly due to fonts).

Make sure your document is saved using the UTF-8 character encoding. See Special Characters for more details. Put the parts where you want to write chinese characters in a CJK environment.

\documentclass{article}\usepackage{CJK}\begin{document}\begin{CJK}{UTF8}{gbsn} 你好 You can mix latin letters and chinese. \end{CJK}\end{document}

The last argument specifies the font. It must fit the desired language, since fonts are different for Chinese, Japanese and Korean. Possible choices for Chinese include:

  • gbsn (简体宋体, simplified Chinese)
  • gkai (简体楷体, simplified Chinese)
  • bsmi (繁體細上海宋體, traditional Chinese)
  • bkai (繁體標楷體, traditional Chinese)


Czech is fine using


UTF-8 allows you to have „czech quotation marks“ directly in your text. Otherwise, there are macros \clqq and \crqq to produce left and right quote. You can place quotated text inside .


Finnish language hyphenation is enabled with:


This will also automatically change document language (section names, etc.) to Finnish.


As of version 3.0 of babel-french, it is advised to choose the language as a global option with the following command[3]:


Formerly, you could load French language support with the following command:


There are multiple options for typesetting French documents, depending on the flavor of French: french, frenchb, and francais for Parisian French, and acadian and canadien for new-world French. If you do not know or do not really care, we would recommend using .

All enable French hyphenation, if you have configured your LaTeX system accordingly. All of these also change all automatic text into French: prints Chapitre, prints the current date in French and so on. A set of new commands also becomes available, which allows you to write French input files more easily. Check out the following table for inspiration:

input coderendered output
« guillemets »
Mme, Dr
1er, 1re, 1res
2e 4es
N° 1, n° 2
20 °C, 45°
M. Durand
1 234,567 89

You may want to typeset guillemets and other French characters directly if your keyboard have them. Running Xorg (*BSD and GNU/Linux), you may want to use the variant which features some nice shortcuts, like

Key combinationCharacter

You will need the T1 font encoding for guillemets to print properly.

For the degree character you will get an error like

! Package inputenc Error: Unicode char \u8:° not set up for use with LaTeX.

The textcomp package will fix it for you.

The great advantage of Babel for French is that it will handle some elements of French typography for you, especially non-breaking spaces before all two-parts punctuation marks. So now you can write:

Il répondit: «Ce pain coûte-t-il 2~€?»

The non-breaking space before the euro symbol is still necessary because currency symbols and other units or not supported in general (that's not specific to French).

You can use the numprint package along Babel. It will let you print numbers the French way.

\usepackage[french]{babel}\usepackage[autolanguage]{numprint}% Must be loaded *after* babel.% ...\nombre{123456.123456 e-17}

You will also notice that the layout of lists changes when switching to the French language. This is customizable using the command. For more information on what the french option of babel does and how you can customize its behavior, run LaTeX on file and read the produced file or . You can get the PDF version on CTAN.


You can load German language support using either one of the two following commands.

For traditional ("old") German orthography use


or for reform ("new") German orthography use


This enables German hyphenation, if you have configured your LaTeX system accordingly. It also changes all automatic text into German, e.g. “Chapter” becomes “Kapitel”. A set of new commands also becomes available, which allows you to write German input files more quickly even when you don't use the inputenc package. Check out the table below for inspiration. With inputenc, all this becomes moot, but your text also is locked in a particular encoding world.

ä ö ü ß
or «
or  »
‹ ›

In German books you sometimes find French quotation marks («guillemets»). German typesetters, however, use them differently. A quote in a German book would look like »this«. In the German speaking part of Switzerland, typesetters use «guillemets» the same way the French do. A major problem arises from the use of commands like : If you use the OT1 font encoding (which is the default) the guillemets will look like the math symbol "", which turns a typesetter's stomach. T1 encoded fonts, on the other hand, do contain the required symbols. So if you are using this type of quote, make sure you use the T1 encoding.

Decimal numbers usually have to be written like (not just 0,5). Packages like enable input like . Alternatively, one can use the command from the babel and (globally) set the decimal marker using

\usepackage[output-decimal-marker={,}]{siunitx}% ...\num{0,5}


This is the preamble you need to write in the Greek language. Note the particular input encoding.


This preamble enables hyphenation and changes all automatic text to Greek. A set of new commands also becomes available, which allows you to write Greek input files more easily. In order to temporarily switch to English and vice versa, one can use the commands and that both take one argument which is then typeset using the requested font encoding. Otherwise you can use the command described in a previous section. Use for the Euro symbol.


Use the following lines:


More information in hungarian.

Icelandic and Faroese[edit]

The following lines can be added to write Icelandic text:


This changes text like Part into Hluti. It makes additional commands available:


To make special characters such as Þ and Æ become available just add:

The default LATEX font encoding is OT1, but it contains only the 128 characters. The T1 encoding contains letters and punctuation characters for most of the European languages using Latin script.


Italian is well supported by LaTeX. Just add


at the beginning of your document and the output of all the commands will be translated properly.


Norwegian is well supported by LaTeX. Just add


at the beginning of your document and the output of all the commands will be translated properly.


There is a variant of TeX intended for Japanese named pTeX, which supports vertical typesetting.

Another possible way to write in japanese is to use Lualatex and the luatex-ja package. Adapted example from the Luatexja documentation :

\documentclass{ltjsarticle}\usepackage{luatexja}% This line is unnecessary when using ltjclasses or ltjsclasses.\begin{document}\section{はじめてのLua\TeX-ja} ちゃんと日本語が出るかな? \subsection{出たかな?} 長い文章を入力するとちゃんと右端のところで折り返されるかな? 大丈夫そうな気がするけど.ちょっと不安だけど何事も挑戦だよね. \end{document}

You can also use capabilities provided by the Fontspec package and those provided by Luatexja-fontspec to declare the font you want to use in your paper. Let us take an example :

% **********************************% Basic setup\documentclass[10pt,a4paper]{article}\usepackage{luatextra}%this package calls fontspec, luatexbase, lualibs, metalogo, luacode and fixltx2e\setmainfont[Ligatures=Rare,Numbers=OldStyle]{Arno Pro}%setup of western font\usepackage{luatexja}\usepackage{luatexja-fontspec}%needed to call \setmainjfont bellow\setmainjfont[BoldFont=KozGoPr6N-Bold]{KozGoPr6N-Regular}%setup of japanese font%***********************************\begin{document} It is a test to show japanese and english mix. テスト中です。どうですか皆さん。 \end{document}

Use UTF-8 as your encoding. In case you don't know how to do this, take a look at Texmaker, a LaTeX editor which use UTF-8 by default.

Another (but old) possible Japanese support is made available thanks to the CJK package collection. If you are using a package manager or a portage tree, the CJK collection is usually in a separate package because of its size (mainly due to fonts).

Make sure your document is saved using the UTF-8 character encoding. See Special Characters for more details. Put the parts where you want to write japanese characters in a CJK environment.

\documentclass{article}\usepackage{CJK}\begin{document}\begin{CJK}{UTF8}{min} こんにちは You can mix latin letters as well as hiragana, katakana and kanji. \end{CJK}\end{document}

The last argument specifies the font. It must fit the desired language, since fonts are different for Chinese, Japanese and Korean. min is an example for Japanese.


The two most widely used encodings for Korean text files are EUC-KR and its upward compatible extension used in Korean MS-Windows, CP949/Windows-949/UHC. In these encodings each US-ASCII character represents its normal ASCII character similar to other ASCII compatible encodings such as ISO-8859-x, EUC-JP, Big5, or Shift_JIS. On the other hand, Hangul syllables, Hanjas (Chinese characters as used in Korea), Hangul Jamos, Hiraganas, Katakanas, Greek and Cyrillic characters and other symbols and letters drawn from KS X 1001 are represented by two consecutive octets. The first has its MSB set. Until the mid-1990's, it took a considerable amount of time and effort to set up a Korean-capable environment under a non-localized (non-Korean) operating system. You can skim through the now much-outdated to get a glimpse of what it was like to use Korean under non-Korean OS in mid-1990's.

TeX and LaTeX were originally written for scripts with no more than 256 characters in their alphabet. To make them work for languages with considerably more characters such as Korean or Chinese, a subfont mechanism was developed. It divides a single CJK font with thousands or tens of thousands of glyphs into a set of subfonts with 256 glyphs each.

For Korean, there are three widely used packages.

  • HLATEX by UN Koaunghi
  • hLATEXp by CHA Jaechoon
  • the CJK package by Werner Lemberg

HLATEX and hLATEXp are specific to Korean and provide Korean localization on top of the font support. They both can process Korean input text files encoded in EUC-KR. HLATEX can even process input files encoded in CP949/Windows-949/UHC and UTF-8 when used along with Λ, Ω.

The CJK package is not specific to Korean. It can process input files in UTF-8 as well as in various CJK encodings including EUC-KR and CP949/Windows-949/UHC, it can be used to typeset documents with multilingual content (especially Chinese, Japanese and Korean). The CJK package has no Korean localization such as the one offered by HLATEX and it does not come with as many special Korean fonts as HLATEX.

The ultimate purpose of using typesetting programs like TeX and LaTeX is to get documents typeset in an aesthetically satisfying way. Arguably the most important element in typesetting is a set of welldesigned fonts. The HLATEX distribution includes UHC PostScript fonts of 10 different families and Munhwabu fonts (TrueType) of 5 different families. The CJK package works with a set of fonts used by earlier versions of HLATEX and it can use Bitstream's cyberbit True-Type font.

To use the HLATEX package for typesetting your Korean text, put the following declaration into the preamble of your document:

This command turns the Korean localization on. The headings of chapters, sections, subsections, table of content and table of figures are all translated into Korean and the formatting of the document is changed to follow Korean conventions. The package also provides automatic particle selection. In Korean, there are pairs of post-fix particles grammatically equivalent but different in form. Which of any given pair is correct depends on whether the preceding syllable ends with a vowel or a consonant. (It is a bit more complex than this, but this should give you a good picture.) Native Korean speakers have no problem picking the right particle, but it cannot be determined which particle to use for references and other automatic text that will change while you edit the document. It takes a painstaking effort to place appropriate particles manually every time you add/remove references or simply shuffle parts of your document around. HLATEX relieves its users from this boring and error-prone process.

In case you don't need Korean localization features but just want to typeset Korean text, you can put the following line in the preamble, instead.

For more details on typesetting Korean with HLATEX, refer to the HLATEX Guide. Check out the web site of the Korean TeX User Group (KTUG).

In the FAQ section of KTUG it is recommended to use the kotex package

Persian script[edit]

For Persian language, there is a dedicated package called XePersian which uses XeLaTeX as the typesetting engine. Just add the following code to your preamble:

See XePersian page on CTAN

Moreover, Arabic script can be used to type Persian as illustrated in the corresponding section.


If you plan to use Polish in your encoded document, use the following code:


The above code merely allows to use Polish letters and translates the automatic text to Polish, so that "chapter" becomes "rozdział". There are a few additional things one must remember about.


Polish has many single letter connectives: "a", "o", "w", "i", "u", "z", etc., grammar and typography rules don't allow for them to end a printed line. To ensure that LaTeX won't set them as last letter in the line, you have to use non breakable space:

Noc była sierpniowa, ciepła i~słodka, Księżyc oświecał srebrnem światłem wgłębienie, tak, że twarze małego rycerza i~Basi były skąpane w blasku. Poniżej, na podwórzu zamkowem, widać było uśpione kupy żołnierzy, a~także i~ciała zabitych podczas dziennej strzelaniny, bo nie znaleziono dotąd czasu na ich pogrzebanie.


According to Polish grammar rules, you have to put dots after numerals in chapter, section, subsection, etc. headers.

This is achieved by redefining few LaTeX macros.

For books:


For articles:


Alternatively you can use dedicated document classes:

  • the mwart class instead of article,
  • mwbk instead of book
  • and mwrep instead of report.

Those classes have much more European typography settings but do not require the use of Polish babel settings or character encoding.

Simple usage:

\documentclass{mwart}\usepackage[polish]{babel}\usepackage{polski}\begin{document} Pójdź kińże tę chmurność w głąb flaszy. \end{document}

Full documentation for those classes is available at (Polish).


It may be customary (depending on publisher) to indent the first paragraph in sections and chapters:

Hyphenation and typography[edit]

It's much more frowned upon to set pages with hyphenation between pages than it is customary in American typesetting.

To adjust penalties for hyphenation spanning pages, use this command:

To adjust penalties for leaving widows and orphans (clubs in TeX nomenclature) use those commands:

\clubpenalty=1000 \widowpenalty=1000

Commas in math[edit]

According to some typography rules, fractional parts of numbers should be delimited by a comma, not a dot. To make LaTeX not insert additional space in math mode after a comma (unless there is a space after the comma), use the icomma package.

Unfortunately, it is partially incompatible with the dcolumn package. One needs to either use dots in columns with numerical data in the source file and make dcolumn switch them to commas for display or define the column as follows:

\begin{tabular}{... D{,}{\mathord\mathcomma}{2} ...}

The alternative is to use the numprint package, but it is much less convenient.

Another alternative is using package siunitx that lets you typeset numbers and their according units consistently. Number alignment in tables and different output modes re supported.

Further information[edit]

Refer the Słownik Ortograficzny (in Polish) for additional information on Polish grammar and typography rules.

Good extract is available at Zasady Typograficzne Składania Tekstu (in Polish).


Add the following code to your preamble:


You can substitute the language for brazilian portuguese by choosing brazilian or brazil.


Basic settings are fine when left the same as Czech, but Slovak needs special signs for 'ď', 'ť', 'ľ'. To be able to type them from keyboard use the following settings:



Include the appropriate Babel option:


The trick is that Spanish has several options and commands to control the layout. The options may be loaded either at the call to Babel, or before, by defining the command . Therefore, the following commands are roughly equivalent:


On average, the former syntax should be preferred, as the latter is not recognized by some programs (LyX, latex2rtf) interacting with LaTeX.

Spanish also defines shorthands for the dot and << >> so that they are used as logical markup: the former is used as decimal marker in math mode, and the output is typically either a comma or a dot; the latter is used for quoted text, and the output is typically either «» or “”. This allows different typographical conventions with the same input, as preferences may be quite different from, say, Spain and Mexico.

Two particularly useful options are es-noquoting,es-nolists: some packages and classes are known to collide with Spanish in the way they handle active characters, and these options disable the internal workings of Spanish to allow you to overcome these common pitfalls. Moreover, these options may simplify the way LyX customizes some features of the Spanish layout from inside the GUI.

The options mexico,mexico-com provide support for local custom in Mexico: the former using decimal dot, as customary, and the latter allowing decimal comma, as formerly required by the Mexican Official Norm (NOM) of the Department of Economy for labels in foods and goods. More localizations are in the making.

The other commands modify the Spanish layout after loading Babel. Two particularly useful commands are and .

The macro contains a list of spanish mathematical operators, and may be redefined at will. For instance, the command


only defines sen, overriding all other definitions; the command disables them all. This command supports accented or spaced operators: the command puts an accent, and the command adds a small space. For instance, the following operators are defined by default.

l\acute{i}m l\acute{i}m\,sup l\acute{i}m\,inf m\acute{a}x \acute{i}nf m\acute{i}n sen tg arc\,sen arc\,cos arc\,tg cotg cosec senh tgh

Finally, the macro disables some active characters, to keep you out of trouble if they are redefined by other packages. The candidates for deactivation are the set {<>."'}. Please, beware that some option preempt the availability of some active characters. In particular, you should not combine the es-noquoting option with , or the es-noshorthands with .

Please check the documentation for Babel or for further details.


One option to use Tibetan script in LaTeX is to add

to your preamble and use a slightly modified Wylie transliteration for input. Refer to the excellent package documentation for details. More information can be found on [1]


The following preamble could be used to directly type Vietnamese.

\documentclass{article}\usepackage{fontspec}%\setmainfont[Ligatures=TeX]{Linux Libertine O}


  1. ↑The Not So Short Introduction to LaTeX, 2.5.6 Support for Cyrillic, Maksym Polyakov
  2. ↑The Not So Short Introduction to LaTeX, Bulgarian translation
  3. ↑babel-french documentation: "the French language should now be loaded as french, not as frenchb or francais and preferably as a global option of . Some tolerance still exists in v3.0, but do not rely on it."

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

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


A minimal working example is presented below:

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

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

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

  Open an example of the natbib package in ShareLaTeX

[edit]Basic usage

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

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

There are a few changes in this example:

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

  Open an example of the natbib package in ShareLaTeX

[edit]The bibliography file

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

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

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

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

  Open an example of the natbib package in ShareLaTeX

[edit]Adding the bibliography in the table of contents

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

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

Adding the line

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

  Open an example of the natbib package in ShareLaTeX

[edit]Reference guide

natbib package options

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

Standard entry types

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

Most common fields used in BibTeX

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

[edit]Further reading

For more information see

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