BibTeX, biblatex and biberHiding the URL/Doi field in bibliography list

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Hiding the URL/Doi field in bibliography list

Post by Matias »

I use LyX 1.6 and JabRef 2.5.

I use a bib style file called vancouver.bst.

Some entries (citations) in JabRef have an URL field. When using these the URL comes in the bibliography list. How can I avoid this?

Thank you all for your feedback.
Last edited by Matias on Sun Jan 24, 2010 8:36 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

olofos
Posts: 56
Joined: Tue Nov 24, 2009 10:37 pm

Hiding the URL/Doi field in bibliography list

Post by olofos »

vancouver.bst already contains configuration options for including eprint numbers, doi and hyper links, so let's add an option for the url field as well. Make a copy of vancouver.bst under a new name, say my-vancouver.bst, and make the following changes to that file:

Change the line

Code: Select all

INTEGERS { hrefform addeprints adddoiresolver }
to

Code: Select all

INTEGERS { hrefform addurls addeprints adddoiresolver }
In the function init.config.constants, add the line

Code: Select all

  #0 'addurls := % 0=no urls; 1=include urls
Finally, in the function output.url, change the first line

Code: Select all

{ url empty$
to

Code: Select all

{ addurls not url empty$ not and
Setting the flag addurls to #1, the output should be identical to that of the original vancouver.bst

Edit: I noted that your title says that you also want to hide the doi. In my Texlive 2009 copy of vancouver.bst, this is the default. However, there is a flag for changing this. Check in the function init.config.constants for the line

Code: Select all

  #1 'adddoiresolver := % 0=no DOI resolver; 1=include it
and change it to

Code: Select all

  #0 'adddoiresolver := % 0=no DOI resolver; 1=include it
which should give a bibliography without doi:s
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Re: Hiding the URL/Doi field in bibliography list

Post by Matias »

Really nice work.

I didn't need the last thing you described about doi. I just wanted the URL field (which had the doi thing in it) gone.

There is one concern left. I don't need it at the moment, but what if I need to cite a URL now? Is there a field in JabRef (or BibTex data entries) that I could use to include it?
olofos
Posts: 56
Joined: Tue Nov 24, 2009 10:37 pm

Re: Hiding the URL/Doi field in bibliography list

Post by olofos »

The field for adding a url to an entry is 'url' -- the one you just disabled. If you want to cite a webpage, vancouver.bst supports the 'webpage' entry type. The urls of these entries are still displayed even in the patched version. (The style seems to have a bug for these entries. Bibtex errors out on webpage entries unless there is a non-empty 'type' field.)

If you want an url in an entry of some other type you can always add it in the note field.
ast
Posts: 1
Joined: Mon Jul 02, 2012 3:37 pm

Re: Hiding the URL/Doi field in bibliography list

Post by ast »

Much easier solution:
Create a new optional field called "website" and paste your urls here. :idea:
You also can add "website" to Jabrefs optional fields so you will see it in Jabref, too. Now only add urls you really want in your bibliography to the url-field.
Post Reply