1
  1. I want to add access date ahead of the url. How to modify the bibtex file?

  2. Could you tell me how to add [Online] as well?

Hawking, S. 2000. Professor Stephen Hawking's website. [Online]. [Accessed 25 August 2017]. Available from: http://www.hawking.org.uk/

The full .bst is available here which is made by makebst.

A MWE is

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\reff.bib}
@misc{hawking2000,
 author = {Hawking, S.},
 year = {2000},
 title = {{Professor Stephen Hawking's website}},
 urldate = {2017-08-25},
 url = {http://www.hawking.org.uk/}
}
\end{filecontents*}

\usepackage{natbib,url}
\begin{document}

As argued by \cite{hawking2000}, \dots

\bibliographystyle{myHarvard}
\bibliography{\reff}
\end{document}

The function of url format is

FUNCTION {format.url}
{
  url
  duplicate$ empty$
    { pop$ "" }
    {
       "\urlprefix\url{" swap$ * "}"  *  }
  if$
}
2
  • That bit of the .bst file only prints the URL. I guess it would be easier to help if we could see the entire .bst file and a short example document with an example citation that we can use to test our modifications (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864). If the .bst file is on CTAN or can be downloaded elsewhere, a link is enough, but if it is already a custom style it would probably be best if you could upload it to a text-sharing website (please avoid file-sharing websites where one has to download .zips or the like).
    – moewe
    Jan 20, 2019 at 13:57
  • @moewe Thanks a lot for the advice. The question is modified as required.
    – WZhao
    Jan 20, 2019 at 14:41

1 Answer 1

2

Add the following function solve the issue for me.

FUNCTION {format.urldate}
{ urldate duplicate$ empty$
    { pop$ "" }
    { "~[Accessed: " swap$ * "]" * "[Online]" add.period$ swap$ * }
  if$
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.