Best practices/workflow for helping with CSL questions?

What workflows do you have when answering questions about CSL styles?

The background for my question is: When asking questions about LaTeX it is common to provide a minimal working example that can be used to reproduce the problem and to start working on a solution. This makes it very easy for others to help. Now, with CSL it is a bit more compliced, you need a CSL style, item metadata and a document where you cite those items, so that you can see the output.

I find it a bit tedious to first add suitable entries in Zotero, then prepare a style and then add citations in a Word document; especially because the citation style needs to be updated in Zotero after each change.

Using the online editor is not particularly easier because here you’d have to import some suitable references first, and you are limited to three citations.

So, any suggestions?

  1. In my experience 95% of CSL questions can be answered based on the style and expected vs. actual output and info on the software used.

  2. Are you not aware of the Zotero style editor (accessible from the Cite tab of the preferences)? I virtually never use Word docs to test styles – that would indeed be terribly cumbersome.

  3. Where I do need a MWE, it works exactly like it would when developing a .bst style: You need the style file, metadata (CSL JSON is ideal, but most cases any format works, and you can use “import from clipboard” in Zotero) and expected vs. actual output just using copy&paste. No need for a document.

Thanks for reminding me of Zotero’s style editor. I have tried it before, but did not find it very user friendly for XML editing. But for testing purposes it is indeed much easier than setting up documents.

Yes, the Zotero editor is only suitable for minimal tweaks. For anything serious I use it in combination with an XML editor (Atom with the linter-autocomplete-jing package ) and just select all and copy&paste for testing. Code highlighting in the editor would be nice, but Zotero is understandably not too keen to weigh it down with a whole editor in there.

(I’d be fine adding ACE or CodeMirror there. I think being able to edit both styles and translators (the latter by bundling Scaffold) in Zotero itself would be great for encouraging community development. JS code size was more of an issue in the Firefox extension days, but these days it doesn’t really matter.)

1 Like

That sounds like a great idea. Being able to edit styles in Zotero itself would be a great improvement.

I just finished work on a rewrite of the citeproc-js test runner that you might look at. It has a “watch” mode that you can use to quickly build a set of test fixtures from items in your library. You can then set it to perform validation and testing on the fly in a terminal window as you work on a style in the editor of your choice.