Installing a New Style

I'm having difficulty getting Zotero to accept a new style. I'm working with Chicago Author-Date 17th, and I'm trying to get it to stop listing three author names in in-text citations, and instead use the conventional 'et al.' Following threads on the forums, I used the style editor to change the limit numbers and successfully got the right use of 'et al' in my citations. But every time I close and re-open Zotero, it reverts.

I did save the modified style code as a separate .csl file and attempt to install it through the style editor, but it still reverts. Then I followed advice on the forums also to try changing the name and URL of the style right in the code, and then the style editor rejects the file with an error message saying there was a problem installing it.

Any help?
  • edited January 16, 2020
    You also need to change the filename, file ID and self link. Otherwise Zotero does not know how to differentiate the styles and just overwrite it again.
    Explained here: https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
  • As you noted, you need to change the style title and id

    Hard to say why there'd be an error message after changing the style name and ID, but could be because you added illegal characters? Beyond that, we'd have to see the style. Post to hastebin.com or similar and link here.

    (Btw. there's nothing conventional about using et al. for 3 authors in Chicago style -- the Chicago Manual has been prescribing up to three authors listed in the text since at least its 15th edition)
  • Thanks for these suggestions. I did see those pages, and tried to change the style title and ID, and that's when I started getting error messages. (Before, I wasn't getting an error message, but it also just wasn't installing.)

    Here's the text - https://pastebin.com/aBzCnfgm

    All I (think that I) changed was the style and ID stuff in the first few lines (only added 'modified' after 'chicago-author-date,' and then the numbers for et-al limits near the very bottom.

    Thanks!
  • It's the curly quote in line 6: chicago-author-date-modified”
    That needs to be chicago-author-date-modified"
    Never edit code in Word or similar word processors.
  • Oh, I see. Yes, I did start editing it in Word before copying it in TextEdit.
    Is TextEdit also a problem? Because now I've tried doing it again with clean code pulled from the original style in Zotero and pasting straight into TextEdit, and I'm still getting the error message.

    This latest code is here - https://pastebin.com/DEc36G9u

  • You still have that same curly quote. Maybe just try edit in Zotero's style editor directly? I thought TextEdit worked, but Mac does all sorts of weird things these days, so who knows.
  • Huh, I can just edit it directly in Zotero. That's so much simpler than the other instructions on here.

    But... I'm still getting the same error. This time I edited it fresh from the original style, and then saved it as a new .csl file directly from the style editor. I only edited the title and ID text this time, nothing more than the section pasted below. Doesn't look like the curly quotes are there...?

    <?xml version="1.0" encoding="utf-8"?>


    Chicago Manual of Style 17th edition (author-date) modified
    http://www.zotero.org/styles/chicago-author-date-modified


  • The forum swallows XML, that's why we ask for hastebin/pastebin
  • Can you post the full style, along with a Report ID from after trying to install it?
  • (the header looks OK, hence the request for the whole thing)
  • Gotcha.

    Here's the full style, edited:
    https://hastebin.com/cicekegeze.xml

    And here's the Report ID - hope this is the right thing.
    https://hastebin.com/degutacibo.rb
  • It looks like you’re saving the file as RTF. You need to save it as a plain-text file. In TextEdit there’s a menu option to switch between plain text and rich text.
  • Hmm. Just tried it, same problem. Also, the last one I posted above wasn't done in TextEdit, just straight from the Style Editor in Zotero.

    (Error Report for the TextEdit trial here - https://hastebin.com/payagutegu.rb)
  • It's possible that was just from an earlier attempt.
    [JavaScript Error: "_styles is not iterable" {file: "chrome://zotero/content/xpcom/style.js" line: 387}]
    Try resetting your styles from the Advanced → Files and Folders pane of the Zotero preferences — you may have an invalid style that's breaking things. (Make a backup of any other custom styles you have.)
  • Hm. Okay, did that, tried editing again, still only changing the header, by adding 'modified' into three lines where the style name is. Still got the same error.

    Here's the code again.
    https://pastebin.com/jrBxYWXG
    This time I edited it directly in the Zotero Style Editor, and then copied it directly from that window into pastebin.

    Here's the Error Report
    https://pastebin.com/2zJLzrsN

    ??
  • That style is valid and installs for me.

    Try closing Zotero and just deleting the 'styles' folder within your Zotero data directory. Zotero should recreate it on startup.
  • Hey - thanks for this, and sorry for the delay. I had to step away from this troubleshooting and the project it's for, for a bit. I'm back now and would love to solve the issue.

    I followed those directions, closing Zotero and deleting the styles folder. It did recreate on startup, with my modified file no longer there. I worked within the Style Editor, changed only one thing, adding 'modified' on just one line, saved it as a new .csl file all within Zotero still, and then tried to add it, and got the same error. Any other ideas??

    Once again, code -

    https://hastebin.com/sivameqamu.xml

    Error Report -

    https://hastebin.com/irecaruzes.rb

    Thank you!
  • [JavaScript Error: "Translators not yet loaded"]
    [JavaScript Error: "_styles is not iterable" {file: "chrome://zotero/content/xpcom/style.js" line: 387}]
    This still shows problems loading translators and styles.

    Can you provide a Debug ID just for Zotero startup through opening the Cite pane of the preferences, using the "Restart with Logging Enabled…" option?
  • Hey! That seems to have worked!
    Somehow, just restarting it with the 'Restart with Logging Enabled' option seems to have made it work. I can't understand why, but... I guess it doesn't matter, b/c problem solved?

    Thank you so much for this patient help! Dstillman and adamsmith both.
  • OK — that's really not meant to be a fix for anything, though, so I wouldn't be surprised if it happens again, whatever the problem is.
  • Yeah, it seemed strange. But I guess if the problem isn't happening now, I can't generate a Debug ID, right? I'd have to wait until it happens again?
  • That's right.
  • Great, thanks so much. I'll do that.
Sign In or Register to comment.