\documentclass[]{article}
\usepackage{harvard}
\bibliographystyle{agsm}
\usepackage{filecontents}
\begin{document}
\begin{filecontents*}{mybib.bib}
@article{roth2007,
title={Repugnance as a Constraint on Markets},
author={Roth, Alvin E},
journal={Journal of Economic Perspectives},
volume={21},
number={3},
pages={37--58},
year={2007}
}
\end{filecontents*}
\let\oldthebibliography\thebibliography
\renewcommand\thebibliography{\let\bf\relax\oldthebibliography}
\renewcommand\thebibliography{\let\em\relax\oldthebibliography}
\nocite{*}
%\setcitestyle{numbers}
\bibliography{mybib}
\end{document}
据我了解,该行\renewcommand\thebibliography{\let\bf\relax\oldthebibliography}
应该删除参考书目中的所有粗体编号。但是,如果您编译它,您会发现粗体编号仍然存在。
发生什么问题了?
答案1
你的修补\thebibliography
是错误的。首先你修补
\renewcommand\thebibliography{\let\bf\relax\oldthebibliography}
但在下一行你却
\renewcommand\thebibliography{\let\em\relax\oldthebibliography}
这意味着先前的重新定义\thebibliography
将被遗忘。最好只是在本地重新定义\bf
和\em
。
% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\documentclass[]{article}
\usepackage{harvard}
\bibliographystyle{agsm}
\usepackage{filecontents}
\begin{document}
\begin{filecontents*}{mybib.bib}
@article{roth2007,
title={Repugnance as a Constraint on Markets},
author={Roth, Alvin E},
journal={Journal of Economic Perspectives},
volume={21},
number={3},
pages={37--58},
year={2007}
}
\end{filecontents*}
\nocite{*}
%\setcitestyle{numbers}
\begingroup
\renewcommand\bf{}
\renewcommand\em{}
\bibliography{mybib}
\endgroup
\end{document}
答案2
只需同时进行两次重新定义
\newcommand{\oldthebibliography}{}
\let\oldthebibliography\thebibliography
\renewcommand\thebibliography{\let\bf\relax\let\em\relax\oldthebibliography}
我推荐看似无用的顶线:如果你加载的某个包有类似的技巧,你会得到通知。更改old
为OLD
或其他任何内容都可以解决问题。
如果你加载xpatch
并执行
\usepackage{xpatch} % in the package loading part
\pretocmd{\thebibliography}{\let\bf\relax\let\em\relax}{}{}