BiBTeX - Doubled URL

Hey,

I hope u can help me with this:

If I set an entry as "Website" and export my library to BiBTeX, this entry will look like this (without "-->"):

@misc{google_project_2012,
title = {{{Project} Glass}},
--> url = {https://plus.google.com/111626127367496192147/posts},
author = {{{Google}}},
year = {2012},
--> howpublished = {https://plus.google.com/111626127367496192147/posts},
}

The problem: Now I've got a double URL in my bibliography.

Is there any way of telling Zotero not to export the URL-Property to both "url" and "howpublished"?

Thanks for your help!
  • Same problem here!
  • Same problem here! When I remove the URL both fields disappear.
  • I found a solution by adjusting the bibliography style file I used.
    The url shows up twice because it exports it in boththe howpublished and URL fields.

    My solution works with natbib. You can find the file here:
    plainnat_no_howpublished.bst

    Instructions
    1. Make sure you use natbib. There should be \usepackage{natbib} in your preamble

    2. Place the downloaded file in the directory where your latex document(s) are.

    3. Use the downloaded file. Place \bibliographystyle{plainnat_no_howpublished} after \usepackage{natbib}

    4. Compile your latex file twice. Done.

    This not only removes the first occurrence of your url (the non-clickable one), it also adds the date on which you accessed the website, which is required for some projects.
  • Thanks for the quick feedback ninovanhooff, what happens though if you aren't using natbib?

    The journal I'm looking at looks like it insists on using it's own .bst file. Is the modification of that file major or minor?
  • Hey dsmurrell,

    To edit your own file:

    1. add "urldate" to the ENTRY list. Line 76 in my file.
    2. Add function format.urldate after format.url. Line 303 in my file.

    FUNCTION {format.urldate}
    { urldate empty$
    { "" }
    { "accessed " urldate * }
    if$
    }

    3. In function {misc}, add "format.urldate output" between format.url and new.block. Line 954 in my file.

    Hope this works for you
  • Also see http://codydunne.blogspot.nl/2012/01/suppressing-bibtex-fields-for-specific.html

    For an option inside latex. I think it should be

    \AtEveryBibitem{% Clean up the bibtex rather than editing it

    \ifentrytype{misc}{% websites are of misc type
    \clearfield{howpublished}
    }{}
    }

    But haven't tested it
  • (IIRC this is actually a bug we want to fix - Zotero should only output one of the two, but I forgot which we decided on).
  • There's not a "please everyone" answer. Some (old) BibTeX styles still don't support 'url' field, so 'howpublished' is the only option. That's presumably why it was added long ago.

    However, these legacy styles are getting fewer and farther between.

    Bibutils, Bibsonomy, CiteULike, KBibTeX, Referencer (gnome), and Mendeley just export to 'url' and not 'howpublished'. I'd propose we do the same, though a few BibTeX users will complain anyway.
  • thanks. Sounds good to me. I can probably just comment out the "howpublished" mapping so it's relatively easy for people to put back in if they want to.
  • that was indeed quite easy. I removed howpublished, urls are now only printed to "url"
    the code is commented out and easy to put back in in a custom version for those who want to.

    Your version of Zotero will automatically update within 24hs, or you can update manually using the "Update Now" button in the "General" tab of the Zotero preferences.
Sign In or Register to comment.