Quantcast
Channel: texblog » bibliographystyle
Viewing all articles
Browse latest Browse all 2

Natbib: Multiple reference citation

$
0
0

Natbib is a reimplementation of the \cite command, providing both, author-year and numerical citations.You can get the distribution as well as the documentation from CTAN.Apparently, my previous post on this topic was not providing sufficient information in order to automatically create lists for multiple citations, e.g. [1,2,3, 5] -> [1-3, 5].Here is how it definitely works using “natbib”: First you include the package into your document with whatever options you prefer:

\usepackage[square, comma, sort&compress]{natbib}

Here, “sort&compress” provides the effect we are looking for, i.e. comma separation and hyphenation of multiple citations. By default, natbib uses round parentheses and colons, hence I changed them to square brackets and commas.Use

\citet{wikiEn}

for textual and

\citep{wikiEn}

for parenthetical citation, instead of \cite. The following example shows how Natbib replaces more than two consecutive citations by a hypen:

\documentclass{article}
\usepackage[square, comma, sort&compress]{natbib}
\begin{document}
\section{Comma separated citations}
Most popular search engines include Google and Yahoo, \citep{google, yahoo}.
\section{Citation list}
The most popular free online encyclopaedia is available in different languages, \citep{wikiEn, wikiDe, wikiFr}.
\bibliographystyle{plainnat}
\begin{thebibliography}{99}
\bibitem{google}http://www.google.com. Google Inc. search engine, 2008.
\bibitem{yahoo}http://www.yahoo.com. Yahoo! Inc. search engine, 2008.
\bibitem{wikiEn}http://en.wikipedia.org. Wikipedia in English, 2008.
\bibitem{wikiDe}http://de.wikipedia.org. Wikipedia in German, 2008.
\bibitem{wikiFr}http://fr.wikipedia.org. Wikipedia in French, 2008.
\end{thebibliography}
\end{document}

My apologies, I got something wrong here in the first place. Natbib is not a bibliography-style, but a package providing  author-year and numerical citation. Natbib is supported by the following three styles:

plainnat.bst, abbrvnat.bst and unsrtnat.bst

which replace the standard bst-files.

(Source: http://merkel.zoneo.net/Latex/natbib.php)

Update

The code above doesn’t seem to work any longer. Here is the same code where natbib was replaced by cite (package documentation):

\documentclass{article}
\usepackage{cite}
\begin{document}
\section{Comma separated citations}
Most popular search engines include Google and Yahoo, \cite{google, yahoo}.
\section{Citation list}
The most popular free online encyclopaedia is available in different languages, \cite{google, wikiEn, wikiDe, wikiFr}.
\bibliographystyle{plainnat}
\begin{thebibliography}{99}
\bibitem{google}http://www.google.com. Google Inc. search engine, 2008.
\bibitem{yahoo}http://www.yahoo.com. Yahoo! Inc. search engine, 2008.
\bibitem{wikiEn}http://en.wikipedia.org. Wikipedia in English, 2008.
\bibitem{wikiDe}http://de.wikipedia.org. Wikipedia in German, 2008.
\bibitem{wikiFr}http://fr.wikipedia.org. Wikipedia in French, 2008.
\end{thebibliography}
\end{document}

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images