5

Is there a way to get Natbib to use an Oxford comma when citing multiple papers? I would like to retain the automatic formatting/sorting when using \citet{}. I don't want this to affect the behaviour of \citep{}.

Oxford comma example

I have found examples of similar behaviour using normal references:

but nothing for Natbib for what I want. If this involves creating a new command such as \citetoxf{} is no great loss, but I would be interested to see if both solutions are possible.

MWE:

\begin{filecontents}{references.bib}
@book{author00,
title = {{A Title}},
publisher = {Alpha},
year = {2008},
editor = {Author, A},
address = {London}
}
@book{buthor00,
title = {{B Title}},
publisher = {Bravo},
year = {1990},
author = {Buthor, B},
address = {New York}
}
@book{cuthor00,
title = {{C Title}},
publisher = {Charlie},
year = {1960},
author = {Cuthor, C},
address = {Tokyo}
}
\end{filecontents}

\documentclass[11pt, a4paper, twoside]{extarticle}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=endash,figurewithin=section,tablewithin=section]{caption}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue,anchorcolor=blue]{hyperref} % Colour links.
\usepackage{cleveref,lipsum}
\usepackage[numbers, sort&compress]{natbib} % Nice references.
\bibliographystyle{unsrtnat}
\begin{document}
\noindent
No Oxford comma: \citet{author00,buthor00,cuthor00}. \\
Oxford comma: \citet{author00,buthor00}, and \citet{cuthor00}. \\
Automatic sorting: \citet{cuthor00,buthor00,author00}.
\bibliography{references}
\end{document}
  • 1
    Your write-up is quite confusing, I'm afraid: It looks like the change you want to make is not about getting an "Oxford comma" between the penultimate and final items in the list. Instead, the change appears to be about getting the word and inserted after the final ("Oxford") comma in the list of citation call-outs. Note that it is not recommended to use \citet with multiple arguments and authoryear-style citation call-outs. Using \citep with multiple arguments is OK, though -- you just don't get the word "and" after the final comma... – Mico Jul 3 '17 at 23:47
  • 1
    That is close to impossible. You would have to hook into the Natbib code to manipulate the printing of the last citation in the list. Having once debugged a Natbib problem I can tell you that the code is horrible and absolutely unreadable. If you want to tackle this, \NAT@citexnum is the macro you want to look at. – Henri Menke Jul 4 '17 at 3:49
  • 1
    If you can, just use biblatex instead. It has natbib emulation. – Henri Menke Jul 4 '17 at 23:46
  • 2
    I stand by my earlier comment, which was based on a recommendation that's made in the user guide of the natbib package: Don't use \citet to generate citation call-outs to multiple entries unless all entries have the same author(s). – Mico Oct 1 '17 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.