使用 natbib 斜体引用作者姓名

使用 natbib 斜体引用作者姓名

natbib我正在尝试使用带样式的斜体来显示引文中的作者姓名agsm

我的 MWE:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{Smith2011,
  author = {Joe Smith},
  title = {The Lord of the Wings},
  year = {2011},
  publisher = {Amazon},
}
\end{filecontents}
\documentclass{article}
\usepackage[authoryear]{natbib} % natbib used for reference style

\begin{document}
So the following should show the name \citeauthor{Smith2011} in italic \citep{Smith2011}, but it doesn't work?
\bibliographystyle{agsm} % AGSM style matches closely to Brunel style
\bibliography{\jobname}
\end{document}

我必须使用哈佛风格来编写报告,但是当我尝试用 替换时agsmharvard却找不到该风格?我以为它自带了natbib

答案1

使用 egreg 的回答如何使用 \citet 以小写字母引用作者?并替换\scshape\itshape

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{Smith2011,
  author = {Joe Smith},
  title = {The Lord of the Wings},
  year = {2011},
  publisher = {Amazon},
}
\end{filecontents}
\documentclass{article}
\usepackage[authoryear]{natbib} % natbib used for reference style

\usepackage{etoolbox}
\makeatletter
\patchcmd{\NAT@test}{\else\NAT@nm}{\else\NAT@nmfmt{\NAT@nm}}{}{}
\let\NAT@up\itshape
\makeatother

\begin{document}
So the following should show the name \citeauthor{Smith2011} in italic \citep{Smith2011}, but it doesn't work?
\bibliographystyle{agsm} % AGSM style matches closely to Brunel style
\bibliography{\jobname}
\end{document}

在此处输入图片描述

编辑:natbib提供样式plainnatabbrvnatunsrtnatharvard 包裹提供了可与 一起使用的其他样式natbib,但没有“harvard”风格

相关内容