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
  • Try to add:
    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).
  • Thanks a lot. I tried and it seems to work fine. It might be one of the next changes in the 2.3.1 version, might it not?
  • This is (partly) related to RTF-Scan, right? If yes, a global option would be nice to change at once the colon, the parentheses and, depending on the locale, the quotes.
    http://forums.zotero.org/discussion/27674/how-to-edit-xpi-files/#Item_4
  • Yes, that would precisely be what is needed to make zotfile be integrated with RTF-scan.
    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.
  • Any suggestion? As I said I think that it is quite a minor problem, but since I have just started to study a bit of code I don't have the knowledge to work it out.
    Many thanks for your help.
Sign In or Register to comment.