BibTeX keywords export glitch

Hello everyone -

When exporting citations from Zotero using the BibTeX format, the keywords get formatted improperly:

keywords = {{ABILITY,Character-based} {trust,DETERMINANTS,EMPLOYEES} – Attitudes,facet {theory,FAIRNESS,GROUP} {process,INTEGRITY,INTERPERSONAL} {relations,LEADERSHIP,ORGANIZATIONAL} change,smallest space analysis},

this should have been

keywords = {ABILITY,Character-based trust, DETERMINANTS, EMPLOYEES – Attitudes, facet theory, FAIRNESS, GROUP process, INTEGRITY, INTERPERSONAL relations, LEADERSHIP, ORGANIZATIONAL change,smallest space analysis},

Is there any way to modify the export translator file to tell it not to include any extra curly braces and just put commas and spaces in between?

Thank you!
  • It isn't obvious to me that stripping braces is the "proper" way to handle mix-cased words. Why do you think this?

    I do agree that keywords should probably be delimited by a comma and a space, though. This would be a trivial change to the translator.
  • Thank you for your input noksagt!

    I agree that is definitely not the "proper" thing; but that is the thing I need :)

    The reason being is that the resulting BibTeX file is later getting imported into our installation of WIKINDX, and with curly braces all over the place it is a nightmare. WIKINDX wants keywords without curly braces around them, just separated by commas and a space.

    Is that trivial change you talk about something I could do myself using Scaffold?
  • edited April 14, 2009
    Can wikindx not handle proper braces? Even if it can't, I don't think this is a reason to limit the BibTeX export filter--other programs can take advantage of bracing & Mark is usually fairly responsive to feature requests. How does it handle bracing in other fields?

    As a workaround to apparent limitations with both Zotero export and wikindx import, could you import some other format (such as Refer or RIS) into wikindx instead?
    Is that trivial change you talk about something I could do myself using Scaffold?
    Sure (assuming you're using a version where Scaffold still works). Line 1996 in BibTeX.js reads:
    tagString += ","+tag.tag; and you should be able to replace "," with ", ".
  • Mark can correct me if I am wrong, but I think that wikindx handles the braces in fields like "title" but not in "keyword" or "abstract".

    wikindx also doesn't support RIS imports as far as I know. I tried to cross process RIS using EndNote and then feed EndNote BibTeX into wikindx - still a mess.

    Can killing braces also be done with Scaffold?
  • edited April 14, 2009
    wikindx also doesn't support RIS imports as far as I know.
    Can someone confirm this? RIS import is listed at http://en.wikipedia.org/wiki/Comparison_of_reference_management_software#Import_file_formats (which Mark edited) & their site claims that it "can import and export other bibliographic formats including BibTeX or Endnote format." I can remember helping Mark with some of the formats used in endnote, but that might have been for export...
    Can killing braces also be done with Scaffold?
    Yes. While adding spaces to further delimit keywords should probably be done in the translator used by Zotero, I still don't think that all users would want the braces to be removed (improved placement would be worthwhile, though). If you wish to make your custom modifications, line 1808 is where the braces are added:if(!isMacro) value = value.replace(/([^\s]+[A-Z][^\s]*)/g, "{$1}");Either comment it out or add another conditional to make it to this for fewer fields.
  • Thank you again!

    RIS imports may very well be supported by wikindx - I probably just don't know how to do it. I have been using BibTeX for everything and got used to it so I didn't investigate the other options much.

    For the two custom edits (killing braces and adding spaces) that I should do locally (I agree that it is not something everyone would benefit from) - how do I go about doing that? That might sound like a stupid question but all this stuff is new to me - I didn't know about Scaffold until this morning. Do I edit the BibTeX.js file manually? If so, where is it located?
  • I got it to work - I didn't realize I had to upgrade to 1.5 to do it.
    Edited the file in Dreamweaver - works like a charm!
    Thank you for your help!!
  • For what it is worth: you didn't have to upgrade to 1.5; you could have edited the translator in 1.0 using scaffold, as per Dan's comments in your other thread.

    In 1.0, there was not a separate BibTeX.js file (all translators were in scrapers.sql, which you could either edit directly (prior to opening firefox) or by using scaffold).
  • Thank you! I didn't know that - I looked high and low for it using this page

    http://www.zotero.org/support/dev/modifying_zotero_files

    as guidance and it didn't work

    That's good to know because I have to do this for our entire research team and this way they don't have to upgrade to a beta version (some of them might be unwilling to do that)
  • The documentation on:
    http://www.zotero.org/support/dev/creating_translators_for_sites
    might be more pertinent to translators (rather than general changes to the code), but you might have to wade through it just a bit if you wanted to make a simple change like this.

This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.