I would like to change the URL output from:
URL: the html link
into:
[Online]URL: [Accessed on]
I am using:
\usepackage[comma]{natbib}
\bibliographystyle{agsm}
I would like to change the URL output from:
URL: the html link
into:
[Online]URL: [Accessed on]
I am using:
\usepackage[comma]{natbib}
\bibliographystyle{agsm}
Here I have explained the step by step to modify another bst from the harvard bundle; please refer to it for the step-by-step.
agsm.bst does not provide a urldate field, so you'd have to add by
yourself to a modified bibtex style. I created the agsm-url.bst from
the original agsm.bst and added a urldate field to it as in this
answer. The diff:
43a44
> urldate
165c166,171
< { "\newline\harvardurl{" URL * "}" * write$ newline$ }
---
> { "\newline\harvardurl{" URL * "}" * write$ newline$
> urldate empty$
> { skip$ }
> { "[Accessed on: " urldate * "]" * write$ newline$ }
> if$
> }
If you don't want the linebreak before the URL block, just delete the \newline
Then I redefined the \harvardurl macro with
\renewcommand{\harvardurl}[1]{[Online] URL: \textit{#1}}
See this answer about redefining it to add hyperlinks with hyperref
Here's a 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}
And the output:
agsm-url.difffile; 2. I copied theagsm.bstlocally with acp \kpsewhich agsm.bst` agsm-url.bst; 3. I patched the newagsm-url.bstfile with thedifffile mentioned before withpatch agsm-url.bst < agsm-url.diff`; 4. I copied the MWE and compiled it perfectly. – henrique Aug 23 '15 at 23:03