[Tex/LaTex] How to remove ‘URL’ prefixed before the URL in bibliography

bibliographiescustom-biburls

I had to create my own bibliography style to format my .bib database using custom-bib and an external language file.

I have a couple of problems left, one is that when I have an entry with a URL, the style inserts the text 'URL' before the URL so it looks like e.g.:

URL https://tex.stackexchange.com/questions/ask.

Is there an easy way to edit the .bst file to remove the prefix 'URL'?

The .bst file has the following function:

FUNCTION {write.url}

{

  url

  duplicate$ empty$

   { pop$ }

   { "\newline\urlprefix\url{" swap$ * "}" * write$ newline$ 

}

I'm using LyX and I'm not a programmer so if it gets too hairy it's probably not worth it.

Best Answer

Is there an easy way to edit the .bst file to remove the prefix 'URL'?

Good news: You needn't edit your bespoke bibliography style file. It suffices to issue the instruction

\def\urlprefix{}

somewhere in the preamble. After making this change, be sure to re-run LaTeX, BibTeX, and LaTeX twice more to fully propagate the change.


If you wanted to edit the bst file, you could proceed as follows: Open the bst file in an editor and locate the function format.url. It should look like this:

FUNCTION {format.url}
{ url empty$
    { "" }
    { "\urlprefix\url{" url * "}" * }
  if$
}

Delete the substring \urlprefix. Then, save the bst file and rerun BibTeX and LaTeX. If, instead, the makebst utility created a function called write.url, simply delete the substring \urlprefix from that function.

Related Question