Extraction format of Zotfile
Hi,
I was wondering how to make Zotfile-extraction cite the title in "," when there is no author of the item. The result would be the following: ("Title," Year:page)
Any idea?
Thanks
I was wondering how to make Zotfile-extraction cite the title in "," when there is no author of the item. The result would be the following: ("Title," Year:page)
Any idea?
Thanks
if(cite.match(/^\s{1}\d{4}/)) cite=cite.replace(/^\s{1}/, "\""+Zotero.ZotFile.truncateTitle(item.getField("title"))+",\" ");
after these lines in zotfile.js:
// get citation
var cite="p. ";
if(Zotero.ZotFile.prefs.getBoolPref("pdfExtraction.NoteFullCite")) cite=Zotero.ZotFile.replaceWildcard(item, "%a %y"+ypDelimiter).replace(/_(?!.*_)/," and ").replace(/_/g,", ");
It's a bit hackish but should work (I haven't tested it extensively).
http://forums.zotero.org/discussion/27674/how-to-edit-xpi-files/#Item_4
In the meanwhile, I have another trouble. After having included the changes you suggested, my code looks like the following:
if(Zotero.ZotFile.prefs.getBoolPref("pdfExtraction.NoteFullCite"))
cite=Zotero.ZotFile.replaceWildcard(item, "%a, %y, ").replace(/_(?!.*_)/," and ").replace(/_/g,", ");
if(cite.match(/^\s{1}\d{4}/)) cite=cite.replace(/^\s{1}/, "\""+Zotero.ZotFile.truncateTitle(item.getField("title"))+",\" ");
You would have realised that I added a comma between the author and the year to be coherent with the rules of RTF-scan. Now, the problem is that when there is not author in a item, zotfile creates tags which look like this {, year, page}. I would make zotfile create tag such this {"title," year, page}.
I am sure the problem is that comma as previously without comma, the modified code worked fine.
Any suggestion?
Many thanks.
Many thanks for your help.