Delete fields for specific reference types when exporting as bibtex / biblatex

Is it possible to delete specific fields from specific reference types when exporting as bibtex / biblatex?

For example, I do not want to export "url" for @article (as the URL is superfluous in my bibliography).

PS: perhaps bibtex or biblatex has a way to suppress certain fields but I have not figured it ... I am hoping that "export" can some how be controlled at Zotero

PSS: I have too many entries in my bibliography to manually delete "url".
  • You would need to edit the translator to accomplish this--there is not any settings to allow this.

    If it was a style I used a lot, I'd rather fix the BST file if URLs are superfluous.
    If not, I'd change the 'url' field to something like 'opt_url' in the .bib file (using a text editor or sed or jabref, for example)
  • There's no built-in way to customize fields on export. You can edit the export translator though. BibTeX translator is not the easiest thing to work with, but depending on the extent of your customization, it might be ok.The translator is written in JavaScript and located in the translators folder in your Zotero data directory https://www.zotero.org/support/zotero_data

    You'll want to make a copy of the file, give it a new file name, and change the title and ID at the top of the file
  • If you are using biblatex (as opposed to bibtex) that's easily handled in the preferences in the latex preamble. E.g. mine which suppresses ISBN but includes other stuff :

    \usepackage[hyperref=true,style=verbose-trad2,citepages=omit,backend=biber,sorting=nyt,isbn=false,backref=true]{biblatex}

    If you really want to strip info out of a bib file, by far the easiest way is to use jabref which has an option for deleting field content. Just open your zotero export in jabref, make the field deletions and save. Then you're good to go to use the file in latex as usual.
  • In biblatex you can also remove or keep urls for certain item types. See: http://tex.stackexchange.com/a/52603
    I use:

    %removes url for every type except those listed here
    \AtEveryBibitem{%
    \ifboolexpr{ not (test {\ifentrytype{misc}} or test%
    {\ifentrytype{unpublished}} or test {\ifentrytype{online}}%
    or test {\ifentrytype{inreference}}%
    or test {\ifentrytype{report}}) }%
    {\clearfield{url} \clearfield{urlday} \clearfield{urlmonth} \clearfield{urlyear}}{}
    }
    }
    Kinda hackish but it works.
  • I wrote a program that does just this! Find it here: https://github.com/JakeC007/Biblatex-Field-Stripper
Sign In or Register to comment.