1

I am trying to maintain author-year citation style throughout my article (using citep, citet), but occasionally I need to do \citenum{} e.g. in tikz diagrams due to space constraints.

\usepackage[authoryear,square]{natbib}
\bibliographystyle{plainnat}

For example, here the numbers in the square brackets are made using \citenum{someref}, while the ref in the caption is made using \citet[][Figure 9]{goodfellow2016}:

Example of cites

However, the references list lacks numbers:

enter image description here

What I would really want is this, but I cannot for the life of me figure out how to achieve this while maintaining the author-year style as shown above:

enter image description here

The closest I found was this answer: https://tex.stackexchange.com/a/17059/155844 However, I cannot figure out how to get the optional arguments to work (e.g. the optioinal arguments see and Figure 9 in \citet[see ][Figure 9]{goodfellow2016} => see Goodfellow [2016, Figure 9]). So far I've got something like this (but this doesn't work):

\setcitestyle{numbers}
\renewcommand{\citet}[3]{#1\citeauthor{#3}~[\citeyear{#3}, #2]}

Another option I thought of was then editing the plainnat style directly to add the reference number to the beginning of each entry, but I can't find a resource on how to do that.

1
  • 2
    It is usually not recommended to mix citation styles. One of the most important principles of citation and bibliography styles is consistency. The problem with introducing numbers to a bibliography style for otherwise author-year citations is that the numbers draw away attention from what actually matters: author and year.
    – moewe
    May 14, 2020 at 18:32

1 Answer 1

2

As I mentioned in the comments I don't think it is a particularly good idea to mix citation styles in such an arbitrary way in your document. If there is one important principle that most citation and bibliography styles agree on it is consistency.

The problem with introducing numbers to a bibliography style for otherwise author-year citations is that the numbers draw away attention from what actually matters in the bibliography: author and year. (To be fair the two are already a bit tricky to find with plainnat: The year is at the end and the author name is not inverted so that the entry starts with the given name not the family name from the citation.)

Since natbib can switch easily between numbers and authoryear it is possible to switch the bibliography, but not the citations. We only need to change the two internal macros \@biblabel and \@bibsetup

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[authoryear,square]{natbib}
\bibliographystyle{plainnat}

\makeatletter
\AtBeginDocument{%
  \let\@biblabel\NAT@biblabelnum
  \let\@bibsetup\NAT@bibsetnum}
\makeatother

\begin{document}
\cite{incollection-full,incollection-minimal}

\citenum{incollection-full}

\bibliography{xampl}
\end{document}

Numbered bibliography with author-year citations.

1
  • Thank you, this is so brilliant! I would never have been able to come up with this simple solution. Thanks for the point also about how the numbers detract from author-year citation style, that is indeed something to think about May 15, 2020 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .