Related to the question I asked here Lyx - change URL appearance in bibtex bibliography, I would like to include something like "Accessed at: Date (dd.mm.yyyy)" in my bibliography. I am not 100 % sure "accessed at" is the right wording in english but this question is more focussed on how to implement this.

I am using Lyx with the Natbib setting and the else-harv biblipgraphy style. I only want the accessed at date for all URLs that are displayed in the bibliography. I have no clue how to start about it, apart from that probably something has to be changed in the .bst file ? Or is there some easiere solution to this.

What it should look like:

URL: www.whatever.com (Accessed at: Date)

I am not sure about the style whether this is common with or without brackets around the accessed at, but I guess either will do.


documentclass[11pt,twoside,english,openright, bibliography=totoc]{scrreprt}
% the following is useful when we have the old nomencl.sty package

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
{scrpage2} &oldpackage
\usepackage[automark, headsepline, footsepline, plainfootsepline]{scrlayer-scrpage}
\renewcommand\nomname{List of Acronyms}


\usepackage {blindtext} 

\usepackage {media9} 
\usepackage[colorlinks=true, urlcolor=black, linkcolor=black,  citecolor=black]{hyperref} 





Here is a patch file for the elsarticle-harv style:

--- /usr/share/texmf-dist/bibtex/bst/elsarticle/elsarticle-harv.bst 2016-08-03 08:15:22.000000000 +0200
+++ elsarticle-harv.bst 2016-08-26 11:28:47.873108598 +0200
@@ -67,6 +67,7 @@
+    urldate
@@ -368,7 +369,14 @@
 FUNCTION {write.url}
 { url empty$
     { skip$ }
-    { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
+    {
+      "\newline\urlprefix\url{" url * "}" *
+      urldate empty$
+        'skip$
+        { " (Accessed at " * urldate * ")" * }
+      if$
+      write$ newline$
+    }

Copy your elsarticle-harv-bst to your project and apply this patch. If you are on unix, save the patch in patch.txt and run

cp /usr/share/texmf-dist/bibtex/bst/elsarticle/elsarticle-harv.bst . && patch < patch.txt

This patch extends the write.url function to include the date defined in the field urldate.










  • I am quite new to playing around with the .bst files so what exactly do you mean by appyling the patch? Do I copy in what you posted and if yes where abouts ? Thanks a lot! – KiW Aug 26 '16 at 9:54
  • the lines starting with @@ separate different chunks of changes. After the @@ are the line numbers where the changes start (in this case, 67 and 368). Then, every line preceded by a - is deleted in the original version, and you add every line starting with a +. (Lines without a + or - remain unchanged and are for context only.) — edit: on unix, you can use the patch command. – Martin Nyolt Aug 26 '16 at 9:58
  • Awesome! Thanks a lot - I will give it a try! – KiW Aug 26 '16 at 10:00
  • Just out of curiosity it looks like you can run that patch somehow, how would you do that ? EDIT: I am using Windows ;) ... I guess you just answered this one – KiW Aug 26 '16 at 10:02

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.