[Tex/LaTex] change citation font style using natbib

bibtexcitingfontsnatbib

How can I change the font style of the authorname in a citation like \citep{} to \textsc?

I tried changing the command of \citep to \textsc{\citep} (see MWE).
But this of course creates problems with multiple authors, as i don't want any "and" printed in \textsc as well.

But there must be a way to refer to the authorname similar to \bibfont being the reference to the fontstyle of the bibliography.

I read the natbib documenation and searched this forum. similar problems only focused on the package biblatex.
However, let's assume I don't want to change the package.

Note: this is not the same question as this:
Format natbib font style
(which is about fontstyles in the bibliography):

MWE:

\documentclass[]{scrartcl}
\usepackage[authoryear,sort]{natbib}            
\usepackage{filecontents}

\begin{filecontents}{bib.bib}
@artice{who,
author={Dr Who},
title={said that},
year={2017}
}

@artice{no,
author={Dr No},
title={said otherwise},
year={2017}
}

\end{filecontents}


\begin{document}
\makeatletter
\renewcommand{\cite}[1]{\textsc{\citeauthor{#1}} (\citeyear{#1})}
\renewcommand{\citep}[1]{(\textsc{\citeauthor{#1}} \citeyear{#1})}
\makeatother

I say this \citep{who,no}.
\cite{who} said that.

\bibliographystyle{dinat}
\bibliography{bib}
\end{document}

Best Answer

It seems that the natbib package uses the macro \NAT@nmfmt to format the author names in in-text citations. We can redefine it to use small caps.

\documentclass[]{scrartcl}
\usepackage[authoryear,sort]{natbib}
\usepackage{filecontents}

\makeatletter
\def\NAT@nmfmt#1{\textsc{#1}}
\makeatother

\begin{filecontents}{bib.bib}
@artice{who,
author={Dr Who},
title={said that},
year={2017}
}

@artice{no,
author={Dr No},
title={said otherwise},
year={2017}
}

\end{filecontents}


\begin{document}

I say this \citep{who,no}.
\cite{who} said that.

\bibliographystyle{dinat}
\bibliography{bib}
\end{document}

Note that this redefinition will prevent natbib's package option nonamebreak from working. The effect of that option should be obtained with

\makeatletter
\def\NAT@nmfmt#1{\mbox{\textsc{#1}}}
\makeatother

instead of the above redefinition.

Please note that I tested this answer only with your example code and not with any larger real-life document.

Related Question