I'm having a problem integrating asmems4.bst
supplied by my department for my thesis. Several of my references are websites and asmems4.bst
doesn't output URLs in my bibliography. From an answer to another question, I modified the .bst file as below, but with worse results. When I include format.url output
into my code, the compiled PDF no longer shows the title
field of the webpage, only the author
and date
fields and no contents of the url
field.
(No format.url)
[6] Statista, 2019. Electricity prices for households in Spain from 2010 to 2018, semi-annually (in euro cents per kilowatt-hour).
vs.
(With format.url)
[6] Statista, 2019.
This is the function I added:
FUNCTION {format.url}
{ url duplicate$ empty$
{ pop$ "" }
{ "\url{" swap$ * "}" *
urldate duplicate$ empty$
{ pop$ }
{ " (Accessed: " swap$ * ")" * * }
if$
}
if$
}
Then I modified the function misc
, which processes entries of type @misc
:
FUNCTION {misc}
{ output.bibitem
format.authors output
author format.key output % ASME puts year
output.year.check % after author(s)
title howpublished new.block.checkb
format.title output
howpublished new.block.checka
howpublished output
format.date output
new.block
note output
%I added this format line
format.url output
fin.entry
empty.misc.check
}
Any suggestions?
UPDATE:
I found another question that was similar and have changed some things. I have been using Mendeley to auto-populate my refs.bib
but apparently the access date doesn't make it through the synchronization from Mendeley to Overleaf. So, I have created a 2nd web.bib
file for my website references.
In addition to that, I have included url
and urldate
in the ENTRY of asmems4.bst
. Using the same format.url
function as included above, I now have a large gap between the website reference and the next reference, but no url or accessed date. In the picture below, references [6] and [7] are both online references with large gaps following them whereas [5] and [8] are journal articles with half the space.
url
? Is the fileasmems4.bst
available online?.bib
file and it seems that it isn't including the accessed date in the misc items in myrefs.bib
. I tried commenting out sections of myformat.url
with no success in my References section.FUNCTION {format.url} { url duplicate$ empty$ { pop$ "" } { "\url{" swap$ * "}" * % urldate duplicate$ empty$ { pop$ ""} % { " (Accessed: " swap$ * ")" * * } if$ } if$ }