Tweaks to an existing style

I wonder if anyone can help. The reference style of the American Political Science Association is quite close to the styles we use for our journals ... with a few tweaks the APSA style could be the Zotero APSjournals style.

Title -- not in quotes

Volume / page
Whereas the APSA style contains a reference to issue, our style calls only for Volume:Page (with no spaces).

Steve Kronmiller
The American Phytopathological Society
«1
  • this is quite easy
    look here for how to get a new style into Zt, where to format etc.:
    http://forums.zotero.org/discussion/5104/modifying-word-plugin-using-journal-abbreviation-instead-of-publication-name/#Item_2

    for your specific requests
    1. Title -- not in quotes
    remove quotes="true"
    from this

    <else-if type="chapter">
    <text macro="title" prefix=" " suffix="." quotes="true"/>
    <group class="container" prefix=" " delimiter=" ">
    <text term="in" text-case="capitalize-first"/>
    and this
    <else>
    <group prefix=" " delimiter=" " suffix=".">
    <text macro="title" quotes="true"/>
    <text macro="editor" />
    </group>


    2. Volume:Page (with no spaces).
    change
    <group prefix=" ">
    <text variable="volume" />
    <text variable="issue" prefix="(" suffix=")"/>
    </group>
    <text variable="page" prefix=": "/>
    </group>

    to
    this:
    <group prefix=" ">
    <text variable="volume" />
    <text variable="page" prefix=":" suffix=""/>
    </group>
    </group>

    Then please submit the style to the repository
  • http://www.zotero.org/styles/american-phytopathological-society

    @Steve: please check it, and list any additional metadata (documentation link, field(s), etc.) that should be added here.
  • thanks Bruce - I should really start doing this myself...
  • edited March 13, 2009
    Yes, Adam, I'd say if you know what you're doing, easier to just add it, particularly given all the recent problems with people posting "bugs" about the formatting engine that are really bugs with the styles they're trying to use.

    I'd also like to strongly urge people like Steve, BTW, to host these styles themselves. For authors, it's really convenient to be able to go to a journal website and just click to install the style (CSL is now starting to be used in a number of different projects; not just Zotero). That's in fact always been the vision behind CSL. If you're willing to do that, it'd be make sense to remove this one from the zotero repo.

    Dan, if you're around, can we document somewhere the .htaccess rules and such that would make it easy for people like Steve to do this?
  • edited March 13, 2009
    particularly given all the recent problems with people posting "bugs" about the formatting engine that are really bugs with the styles they're trying to use.
    It's a bit off-topic, but I think part of the problem is that style validation is not really user-friendly. This is partly because only few software packages support Relax NG Compact schemas. Have you considered providing the CSL schema in different formats (using Trang, http://www.thaiopensource.com/relaxng/trang.html) in the xbiblio SVN repository? That would open the way to more easy online XML validation: there are quite a few tools available for this, but I haven't found one that accepts Relax NG compact.
  • I was hoping to declare a stable 1.0 release before formally releasing the schemas, since it's hard to maintain different files in sync.

    Yeah; maybe we need a little webservice for this. The RVP thing that accompanies RNV would probably be good for this.

    The only format, BTW, that is reasonable to convert to is the RNG XML syntax; neither XSD nor DTDs are rich enough to represent CSL.
  • Alright, I just added csl.rng to the repo.
  • A webservice wouldn't be a bad idea; I'm surprised that nothing exists that uses rnv or jing already. I think rnv is fairly trivial to run & it'd be a good idea to have it as part of the online CSL generator.

    If I'm not mistaken, Zotero's SVN validates CSL using an pre-commit hook for rnv. If this is the case, perhaps we should do more to encourage "commit early, commit often" of styles to force people to validate styles they write.

    In most cases, it seems like only more-or-less final styles are committed. This does have advantages to those looking forward to using the style, but disadvantages for style developers who want to collaborate and get assistance in fixing a style.
  • edited March 14, 2009
    I just found an open source online XML validation service that supports both RELAX NG compact and XML syntax which may be of interest (it's the first I've come across):

    http://validator.nu/

    Selecting a style (e.g. https://www.zotero.org/trac/export/4227/csl/apa.csl), the CSL schema (either http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/csl/schema/trunk/csl.rnc or csl.rng) and checking the option "Be lax about HTTP Content-Type" does the trick.
  • That's an excellent catch. Would be good to document that somewhere obvious on the wiki.

    Note, though: the styles in the SVN (like the apa.csl above) are not valid because of the empty updated value. Would be nice, following noksagt's point, if this value was inserted/updated as a pre-commit, and then validated.
  • the styles in the SVN (like the apa.csl above) are not valid because of the empty updated value. Would be nice, following noksagt's point, if this value was inserted/updated as a pre-commit, and then validated
    SVN != the repo. <updated> is already updated automatically in the repo on commit, and then the style is validated. It's the files in SVN that may or may not have an updated timestamp, because it's not necessary. (You can certainly put in a dummy timestamp while editing in order to validate, but it'd be overwritten anyway in the repo.)

    As far as I know a pre-commit hook can't modify the contents of the commit (because then the working copy would be immediately out of date).
  • Would be good to document that somewhere obvious on the wiki.
    Done: http://www.zotero.org/support/dev/creating_citation_styles#xml_validation
    As far as I know a pre-commit hook can't modify the contents of the commit (because then the working copy would be immediately out of date).
    But would it be possible to validate the commit and cancel it if the committed style doesn't comply with the schema, while reporting the errors to the committer?
  • But would it be possible to validate the commit and cancel it if the committed style doesn't comply with the schema, while reporting the errors to the committer?
    Sure. I think I was originally going to do that but decided just to verify that it's a valid XML file and then display if the style is invalid on the repo page. This gets styles into the repo where they can be fixed up, but perhaps it's better just to force the original author to do the work.

    If there's a consensus to go that route, I'd be happy to make the change.
  • edited March 15, 2009
    Well, you've got my vote. IMHO, ideally there should be a focus on validation at any point where styles are either created or imported: e.g. Zotero could provide an error box with an URL to http://www.zotero.org/support/dev/creating_citation_styles#xml_validation when someone tries to install an invalid CSL style, and csledit.xul could offer some kind of validation option (validator.nu does offer an API).
  • Ditto Rintze.
  • Thanks all for your help and the great suggestions ... especially Adam and bdarcus. I was able to modify existing .csl files to come up with a good match for our citation and bibliographic style. My only hangup was that the metadata available for our journals does not quite match the criteria of our own reference style ... so I will need to do a bit of work on our metadata to get a better match. We will host our .csl file to make it available to our authors and other Zotero users. I guess that means that the dev file for The American Phytopathological Society that was kindly posted by bdarcus can come down. If there is an opportunity to add our revised style sheet to the style sheet page, let me know. Thanks again. Steve
  • edited March 17, 2009
    On hosting your styles, note how the Zotero archive works. There's a link to the raw style file, and then there's an "install" link which serves the file with a "text/x-csl" content type. This allows people to one-click install the style (no need to bother manually downloading and such).

    I think it would make sense, then, for Zotero to add section of links to third-party styles and repos.

    Finally, what do you mean by the following?
    My only hangup was that the metadata available for our journals does not quite match the criteria of our own reference style ... so I will need to do a bit of work on our metadata to get a better match.
  • If there is an opportunity to add our revised style sheet to the style sheet page, let me know.
    Refer to the bottom of the styles repository:
    Commit access is open to all users with SVN/Trac accounts.
    So, you can request an SVN account & then upload the style yourself.
  • @noksagt: you're missing the discussion. I asked him to host the style himself (since it should be the goal that journals host their own styles; that there is only one repo effectively now is a short-term condition). I think he's just asking that there's a link back to their site (or some such).
  • bdarcus:
    re: My only hangup was that the metadata available for our journals does not quite match the criteria of our own reference style ... so I will need to do a bit of work on our metadata to get a better match

    For instance, our journals abbreviations are not listed properly in our metadata (this is an easy fix); and, our recommended citation style calls for intital caps in the title of an article and then lower case unless the title includes proper names; and authors are listed in our metadata by first and second name initials sometimes, and sometimes by full name -- our style calls for intitials only.

    In response to hosting the styles ... having the style available in the Zotero list would be very convenient ... but if you host every publishers' style, the list could get fairly long.
  • I think styles should be in both places - people who come to Zotero should see the amazing number of styles and people who come to your journal webpage should see that you're supporting Zotero.
    In terms of web-space hosting a couple of thousand styles is vanishingly small in comparison to the synced libraries.

    As for Metadata - some of this you'll indeed have to fix, but Zotero can deal with initials vs. whole first names.
  • For instance, our journals abbreviations are not listed properly in our metadata (this is an easy fix);
    Are you referring to your own journals (so that you might have a dependent style for each journal & those styles could be easily located by name) or are you talking about abbreviations to use within a bibliography? AFAIK, CSL still hasn't yet solved the latter.
    our recommended citation style calls for intital caps in the title of an article and then lower case unless the title includes proper names;
    I'm not clear how this differs from any of the text-case attributes that are available in Zotero. It is true that Zotero doesn't know much about what is a proper name & what isn't, so those names might end up with the wrong capitalization (unless you use one of the methods that didn't rewrite latter characters in the word & trusted users to have well-formatted data).
    and authors are listed in our metadata by first and second name initials sometimes, and sometimes by full name -- our style calls for intitials only.
    Do you mean that different journals call for different methods? If so, I'd just make two styles & make a dependent style for each journal that used the right one.
    having the style available in the Zotero list would be very convenient ... but if you host every publishers' style, the list could get fairly long.
    I don't think that should stop you from uploading it. Eventually, a better interface to all of the files would be nice anyway.

    Though, where to host a file does bring up a good design question: I don't really like the idea of multiple copies of a particular style floating around (lest a publisher need to update both their file & the one in public repositories, such as Zotero's). This happens with bibtex and endnote style files to some extent, so it is manageable. But it might be more elegant to have the style in a single, canonical location & to have dependent styles at other locations point to the canonical version. I haven't tried: is this currently possible with Zotero's implementation of CSL?
  • edited March 17, 2009
    @adam:
    I think styles should be in both places - people who come to Zotero should see the amazing number of styles and people who come to your journal webpage should see that you're supporting Zotero.
    CSL is NOT Zotero-specific; that's the whole point! I already have three different applications on one of my machines that all support CSL. There will be more soon.

    Consider also that we've long talked about exploiting some of the Atom-friendliness of CSL (it's metadata design is basically stolen from Atom) to allow users to subscribe to CSL repositories (or portions of repositories), and have the styles they activate be automatically updated.

    So while I agree with you that it should be easy for Zotero users to get journal-hosted CSL styles, and for journals to signal they support Zotero, I don't think it follows that the best way to do this is to have copies of all CSL styles hosted in the Zotero repository. As an author, I really just want to go to my journal site, and click some CSL logo to install and activate the style (ideally for any CSL-compliant application on my system). I have to go there anyway, after all, to get all the other details of the style guidelines (which reminds me; would be nice if all journals also hosted templates for OOXML and ODF).

    Finally, what noksagt said.
  • But it might be more elegant to have the style in a single, canonical location & to have dependent styles at other locations point to the canonical version. I haven't tried: is this currently possible with Zotero's implementation of CSL?
    Isn't this what Zotero is doing at the moment? It was my understanding and all styles created for Zotero are added to the xbiblio project and that Zotero just mirrors xbiblio's CSL directory. Is this not true?
  • I agree with the strategy for listing styles in Zotero as well as on our journal pages.

    And, I would love to code switches to reduce an author's whole first name to an initial ... Can you tell me how to go about it?
  • edited March 17, 2009
    Isn't this what Zotero is doing at the moment? It was my understanding and all styles created for Zotero are added to the xbiblio project and that Zotero just mirrors xbiblio's CSL directory. Is this not true?
    That is not true. xbiblio's SVN directory of styles is quite sparse and has more limited commit access than Zotero's repository, which has more styles, more people committing, and a hook to validate styles.
  • edited March 17, 2009
    AFAIK, the only thing mirrored to xbiblio are the locales files. That's fine by me.

    Rick is asking whether a dependent style in the Zotero repo can point to a style hosted somewhere else. I would presume the answer is yes, but I don't know.

    BTW, my concern about this is tied to the fact that different applications are now implementing CSL, and they're not doing it in a consistent way. Mendeley, for example, stores their CSL files (which I think they just copy from the Zotero archive) in the application package. This really isn't what I want to happen, where projects are forking styles effectively, and a user may have multiple versions of the same style scattered across their account.
  • And, I would love to code switches to reduce an author's whole first name to an initial ... Can you tell me how to go about it?
    Use the 'initialize-with' attribute of the name element.
  • edited March 17, 2009
    AFAIK, the only thing mirrored to xbiblio are the locales files.
    Right, I forgot about that.
    That is not true. xbiblio's SVN directory of styles is quite sparse and has more limited commit access than Zotero's repository, which has more styles, more people committing, and a hook to validate styles.
    Does it make sense to mirror the styles to xbiblio in the same way Z mirrors locales? Or, we could just accept the fact that Zotero Style Repository is in fact the master CSL repository, and allow various other applications automatically update their styles from Zotero. Mendeley's styles are not automatically updated I think.
  • edited March 17, 2009
    I think Zotero's repo is the de facto master repo ATM, but that we should expect that to change. I see no reason why Mendeley, for example, can't have their own (for styles they or their users create). But if that happens, then there has to be some agreement and cooperation to make sure there's a consistency of vision and user experience.

    In general, I'm a big believer in distributed (linked) data and styles.
Sign In or Register to comment.