[Tex/LaTex] How to use natbib to get both superscript-style citations and “authoryear”-style citations in the same document

bibtexcitingnatbib

Depending on the context, I might prefer to use superscript-style citations (i.e. a recent paper\cite{paper} said XYZ –> a recent paper1 said XYZ) or author-year-style citations (i.e. \citet{paper} said XYZ –> John Smith (1990) said XYZ) in the same document. How can I do this with natbib?

I am aware that using \usepackage[super]{natbib} allows me to have superscript-citations with the \cite command. But this causes the \citet command to print "John Smith1 said XYZ" instead of the above, and causes the \citep command to print "1 said XYZ".

Is there any way I can sometimes use superscript-style citations, and sometimes use authoryear-style citations, using the natbib interface/some workaround?

Here's a quick example:

\documentclass[11pt]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[super,comma]{natbib}
\bibliographystyle{plainnat} % most basic and widely used bibliography style
\begin{filecontents}{\jobname.bib}
@article{ref1,
    author = {Smith, John},
    journal = {Very Important Journal},
    title = {Very Important Paper},
    year = {2000}
}
@article{ref2,
    author = {Smith, John},
    journal = {Another Very Important Journal},
    title = {Another Very Important Paper},
    year = {2001}
}
\end{filecontents}

% Body
\begin{document}
  Results from \citep{ref1} and \citet{ref2} imply XYZ\cite{ref1,ref2}.
  \bibliography{\jobname}
\end{document}

which produces

enter image description here

Best Answer

As you've discovered, if the super option of the natbib package is in place, both \cite and \citep generate just superscript-style numeric citation call-outs, while \citet generates a hybrid name-superscript citation call-out.

If natbib's super option is in effect, the commands \citename and \citeyear remain available. The following example document defines the macros \citeA, \citeY, \citeAYp, and \citeAYt to help you achieve your formatting needs. Note that I would recommend against redefining the behavior of the package's \cite, \citep, and \citet directly.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{ref1,
    author  = {Smith, John},
    journal = {Very Important Journal},
    title   = {Very Important Paper},
    year    = {2000},
}
@article{ref2,
    author  = {Smith, John},
    journal = {Another Important Journal},
    title   = {Another Important Paper},
    year    = {2001},
}
\end{filecontents}

\documentclass{article}

\bibliographystyle{plainnat} 
\usepackage[super,comma]{natbib}
\newcommand\citeA[1]{\citeauthor{#1}}
\newcommand\citeY[1]{(\citeyear{#1})}
\newcommand\citeAYt[1]{\citeauthor{#1} (\citeyear{#1})}
\newcommand\citeAYp[1]{(\citeauthor{#1} \citeyear{#1})}

\begin{document}
\begin{tabular}{ll}
\verb+\cite+    & \cite{ref1}\\
\verb+\citep+   & \citep{ref2}\\
\verb+\citet+   & \citet{ref2}\\
\verb+\citeA+   & \citeA{ref1}\\
\verb+\citeY+   & \citeY{ref2}\\
\verb+\citeAYp+ & \citeAYp{ref2}\\
\verb+\citeAYt+ & \citeAYt{ref1}
\end{tabular}

\bibliography{mybib}
\end{document}