3

I am interested in using natbib and citep to display both the author and a number. For example, that \citep{author} displays (author [1]), rather than [1] in numbers mode, or (author, year) in authoryear mode.

I know that I can manually achieve what I want using (\citet{author}), however, it would be nice to automate this with \citep to take advantage of sort&compress when there are multiple citations.

If there is a solution that combines authoryear and number, that's also great.

The code snippet below is an MWE.

\documentclass{article}
\usepackage[numbers]{natbib}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@article{greenwade93,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}
@book{goossens93,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@book{knuth1984texbook,
  title={The texbook},
  author={Knuth, Donald Ervin and Bibby, Duane},
  volume={3},
  year={1984},
  publisher={Addison-Wesley Reading}
}
\end{filecontents}


\begin{document}
I want \texttt{citep} to format as (author [1], author[2], and author[3]),
which seems to be a combination of \texttt{authoryear} and
\texttt{numbers}.

I can manually achieve what I want using \texttt{numbers} and \texttt{citet}:
(\citet{knuth1984texbook}, \citet{goossens93}, and \citet{greenwade93}).
If I use \texttt{citep}, the result is multiple numbers within square
brackets \citep{knuth1984texbook,goossens93,greenwade93}.


The Oxford comma is not crucial.

\bibliographystyle{abbrvnat}
\bibliography{\jobname}

\end{document}

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.