修改 agsm.bst 包参考书目输出

修改 agsm.bst 包参考书目输出

我想更改 URL 输出从:

URL:html 链接

进入:

[在线]网址:[访问日期]

我在用:

\usepackage[comma]{natbib}
\bibliographystyle{agsm}

答案1

这里我已经逐步解释了如何修改哈佛束中的另一个 bst;请参考它以了解分步说明。

agsm.bst没有提供 urldate 字段,因此您必须自己添加到修改后的 bibtex 样式中。我agsm-url.bst从原始样式创建了agsm.bst并添加了urldate创建了并向其中这个答案. 差异:

43a44
>     urldate
165c166,171
<     { "\newline\harvardurl{" URL * "}" * write$ newline$ }
---
>     { "\newline\harvardurl{" URL * "}" * write$ newline$ 
>     urldate empty$
>       { skip$ }
>       { "[Accessed on: " urldate * "]" * write$ newline$ }
>       if$
>     }

如果你不想在 URL 块前换行,只需删除\newline

然后我\harvardurl用重新定义宏

\renewcommand{\harvardurl}[1]{[Online] URL: \textit{#1}}

这个答案关于重新定义它以添加超链接hyperref

以下是 MWE:

% Adapted bib file from tugboat.bib
\begin{filecontents}{\jobname.bib}
  @article{online,
    author = {Robert Welland},
    title = {{Editor's Comments}},
    journal = {TUGboat},
    volume = {1},
    number = {1},
    pages = {2--3},
    month = oct,
    year = {1980},
    ISSN = {0896-3207},
    urldate = {Fri Jul 13 10:24:20 MDT 2007},
    url = {http://www.math.utah.edu/pub/tex/bib/tugboat.bib}
  }
  @article{offline,
    author = {Richard Palais},
    title = {{Message from the Chairman}},
    journal = {TUGboat},
    volume = {1},
    number = {1},
    pages = {3--7},
    month = oct,
    year = {1980},
  }
\end{filecontents}
\documentclass{article}
\usepackage[comma]{natbib}
% natbib.sty, line 1042:
\renewcommand{\harvardurl}[1]{[Online] URL: \textit{#1}}
\begin{document}
\cite{online,offline}
\bibliographystyle{agsm-url}
\bibliography{\jobname}
\end{document}

输出结果如下:

mwe 样本

相关内容