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.
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.
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).
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.
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.
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.