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}
我必须使用哈佛风格来编写报告,但是当我尝试用 替换时agsm
,harvard
却找不到该风格?我以为它自带了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
提供样式plainnat
、abbrvnat
和unsrtnat
。harvard
包裹提供了可与 一起使用的其他样式natbib
,但没有“harvard”风格。