I am using apalile-url.bst to get APA references formatting, but I want to format the reference link when I am using a URL, for example when I reference a URL I get.
this is a url reference [StackExchange, ], this is a book reference [Jones, 2001]
As you can see if the URL does not have a year it still uses the [name,year] format, but I want the link to the reference to look like
this is a url reference [StackExchange], this is a book reference [Jones, 2001]
Any ideas on how can I modify the .bst file?
EDIT: added working example
\documentclass[letterpaper,12pt,oneside,onecolumn,final,openany]{report}
\usepackage{url}
\begin{document}
\chapter{Test}
This shows the url \cite{google}
\clearpage
\addcontentsline{toc}{chapter}{References}
\bibliographystyle{./reference/apalike-url}
\bibliography{./reference/refdatabasewok}
\end{document}
refdatabasewok is
@ELECTRONIC{google,
author = {Google},
title = {Google},
url = {https://www.google.com}
}
Best Answer
The part to modify in the
opaline-url.bst
file is the functionFUNCTION {calculable}
. IN my copy of the file starts at line 1137. The function must be modified as follows:The original style inserts
", "
, what you have to do is to insert it only if there is a value foryear
. So you can create a conditional that checks whether there is a value for the year:year empty$
and if there is no value it does not insert anything, and it insert the comma and a space after it, i.e,", "
, if there is ayear
.Change the name of the
.bst
file after you modified it.