Delete fileds for certain reference type in the bibtex output using Better BibTex postscript

edited January 21, 2019
I want to delete specific field for certain reference type using Better BibTex postscript. I read the script manual (https://retorque.re/zotero-better-bibtex/scripting/) in the Better BibTex, but I can only find "this.add" function, how can I delete specific field?
  • So you only want to omit the fields for specific types, not all of them?
  • Yes, seems odd, but that is what I need.
  • Can I ask what exactly is your use case here?
  • 1. In better bibtex, if I select "Add URLs to BibTex export", there are "url" and "urldate" fields for websites. But I do not want to export url for journal articles. If I do not select "Add URLs to BibTex export", the url is stored in "howpublished" for website, but there is no access date.

    2. In better bibtex, the newspaper article is exported as article in the bibtex. I need url for this, but not for journal article.
  • I would recommend just controlling this using your BibTeX style—set your style to not show the URL if there are pages numbers, but to show it or the DOI if there are not.
  • Thanks a lot. I did not think of using page number to distinguish journal article and other type of articles. I could try this.

    By the way, if I still want to custom BibTex using the Better bibtex postscript, how can I delete certain filed? which function?
  • Sorry can’t really help you there. @emilianoeheyns might be able to.
  • Should also still be possible by controlling the bibtex style using its macros, but this should do the trick:

    if (Translator.BetterBibTeX && item.itemType == 'journalArticle') {
    delete this.has.url
    }
  • Thanks a lot. That is what I am looking for. cannot believe it is so simple command.
Sign In or Register to comment.