Natbib citation styles
Natbib uses the citation style associated with the corresponding bibliography style if no specific citation commands are declared. There are some additional commands to control some punctuation parameters. See the example below:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%Import the natbib package and sets a bibliography and citation styles
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={((},close={))}} %Citation-related commands
\title{Natbib Example}
\author{Overleaf team}
\begin{document}
\maketitle
\section{First Section}
This document is an example with two cited items: \textit{The \LaTeX\ Companion} book \cite[see][chap 2]{latexcompanion} and Einstein's journal paper \citep{einstein}.
%Imports the bibliography file "sample.bib"
\bibliography{sample}
\end{document}
The specific command to format the citation style is:
\setcitestyle{authoryear, open={((},close={))}
The parameters, comma-separated, tell LaTeX to use the authoryear citation mode and use double parentheses as opening and closing marks. The various parameters that can be passed to this command are the following:
- Citation mode:
authoryear
,numbers
orsuper
. - Brackets:
round
orsquare
. You can manually set any other opening and closing characters withopen={char}
adnclose={char}
. - Citation separator:
semicolon
,comma
. - Separator between author and year:
aysep{char}
. - Separator between years with common author:
yysep={char}
. - Text before post-note:
notesep={text}
.
The are other additional citation commands depending on the citation mode. For instance, in the example above the command \cite[see][chap 2]{latexcompanion}
takes two extra parameters; the first optional parameter see is printed before the citation mark and the second optional parameter chap 2 is printed after the citation mark. Below a table describing some additional citation commands:
command | description |
---|---|
\citet{} |
Textual citation |
\citep{} |
Parenthetical citation |
\citet*{} |
Same as \citet but if there are several authors, all names are printed
|
\citep*{} |
The same as \citep but if there are several authors, all names are printed
|
\citeauthor{} |
Prints only the name of the authors(s) |
\citeyear{} |
Prints only the year of the publication. |
For more information about the rest of the commands in this example see Bibliography management with natbib
Open an example of the natbib
package in Overleaf
Further reading
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class