BibTeX: Modifying the translator [solved]

I'm trying to modify the BibTeX translator, but being unfamiliar with JavaScript, hope someone could help me a bit.

I'm hoping to make two modifications:

(1) I don't want to export the keywords and notes.

I guess I need to comment out a few lines, but which ones? (will // work for commenting out?)

(2) I want to map the "Meeting Name" in Zotero to "howpublished" in BibTeX.

BibTeX also has @CONFERENCE rather than the @MISC Zotero uses, but the former really is about conference proceedings rather than conference presentations. Currently Zotero ignores the all important meeting name.
  • 1)
    For keywords comment out:
    if(item.tags && item.tags.length) {
    var tagString = "";
    for(var i in item.tags) {
    var tag = item.tags[i];
    tagString += ", "+tag.tag;
    }
    writeField("keywords", tagString.substr(2));
    }



    You can disable exporting notes in bibtex export, but to disable it entirely, comment out:
    if (item.notes && Zotero.getOption("exportNotes")) {
    for(var i in item.notes) {
    var note = item.notes[i];
    writeField("annote", Zotero.Utilities.unescapeHTML(note["note"]));
    }
    }


    yes, // in front of every line will do or /* at the beginning and */ at the end of a block you want to comment out.

    2)
    Add somewhere around here: https://github.com/zotero/translators/blob/master/BibTeX.js#L2363

    if (item.meetingName){
    writeField("howpublished", item.meetingName);
    }


    Haven't tested any of this, so no guarantees. Note that your changes will be overwritten on each Zotero update as well as each update of the bibtex translator - my recommendation would be to just redo them, but if you really want to avoid this, you can change label and ID of your custom translator (though you won't get any of the other improvements/updates of bibtex in that case).
  • Thanks for the super-fast response. This will certainly get me started.

    I was aware that Zotero regularly overwrites translators, as I use a different BibTeX key. For the reasons you cite, I prefer to redo the modifications.
  • edited August 30, 2013
    (if noksagt or another bibtex specialist is around, I'm wondering if mapping meetingName to howpublished would make sense more generally.)
  • I don't think so--I can't think of any other program that does this. The conference name will also often be part of the name of the proceedings name.
  • meetingName is used in presentation only, which doesn't have a field for proceedings. Conference papers in proceedings are conferencePaper in Zotero and have conferenceName. But if this isn't used relatively widely it probably doesn't make any sense to map it, yes.
  • Zotero makes a clear distinction between conference presentations (not published as such), and proceedings (which are published). When exporting to BibTeX, for presentations Zotero simply ignores the meetingName field; there is no corresponding field in BibTeX. This leads to quite different output from what Zotero normally produces:

    Author, First. 2013. “Title of the Paper” presented at the Meeting Name, June 19, London.

    @misc{author_title_2013,
    address = {London},
    title = {Title of the Paper},
    author = {Author, First},
    month = jun,
    year = {2013},
    }

    the meeting name (and the day of the month) are no longer there.

    By using howpublished in BibTeX, at least the meeting name is maintained in some way; the prefix "presented at the" doesn't actually carry that much information, and the meeting name usually makes it clear we're looking at a conference presentation.
  • Fair point. I don't have a strong opinion. This is probably most commonly crammed into a note or into howpublished, but also with "clarifying info" (stating that it was a presentation (vs. a poster)). I don't have objections to us doing this.

    There's just no common way to solve this (perhaps in part because presentations/posters aren't usually cited in many fields and/or because they're sometimes just rolled into the @inproceedings type), so we can't point to anything that prompts us to one solution over another.
  • I think it would be a neat solution to add the mapping as described above (nothing lost, probably a small gain for those who cite presentations). I often see the @inproceedings type for presentations/posters, but it is Zotero that offers a distinction...
Sign In or Register to comment.