Logic: Check for multiple works by same author

I'm working on updating the McGill Guide for legal citation, and I've run into a problem. The guide specifies that subsequent references to an author's work should in general only mention the author's name (Eg. 23. Murphy, supra note 3 at 203) — UNLESS there are multiple works by the same author. In that case the rule is to mention the author's name and the work's short title (Eg. 23. Murphy, "Law stuff", supra note 3 at 203).

I'm getting comfortable writing conditions in CSL, but I'm not sure how to write an if-then logic that checks for whether there are multiple works by the same author.

Any tips?
  • Yes, that's a bit tricky to figure out. You want to test for <if disambiguate="true">
    The MHRA style does exactly what you want:

    It's possible, though, that the inclusion of a supra note will screw with that (since, with the supra, the citations aren't technically ambiguous anymore). In that case I don't think it's going to be possible to implement. Not sure, though - you'll have to test.
  • Right. Per the CSL specification, "A cite is ambiguous when it matches multiple bibliographic entries." Does that mean that will only return "true" if entries match each other exactly within the Zotero database? Or only if, per the citation rules, they would appear identical?

    I'll have to play around with this.
  • Or only if, per the citation rules, they would appear identical?
    this. They obviously don't have to be the same in Zotero. This is meant for exactly the use case you have - see the MHRA style - except that the supra might kill it.
  • When comparing for ambiguity, the processor replaces a note number with a slug. The back reference shouldn't affect the result.
  • thanks Frank, I wasn't sure what it did & was too lazy to test ;)
  • Fixed it. I've been correcting the McGill Guide CSL for a little while now — I have it up on my own github, but people might be interested in it. Is there a place I can let people know where to find it?

    FYI the code was:

    <macro name="mcgill-secondary-subsequent-default">
    <if disambiguate="true">
    <group delimiter=", ">
    <text macro="mcgill-contributors-short"/>
    <text macro="mcgill-title-short"/>
    <group delimiter=", ">
    <text macro="mcgill-contributors-short"/>
  • see instructions for contributing here:
    for something as complex as the McGill guide, we'd very much ask for a pull request, which greatly facilitates review.
  • I can do that. Is this the MLZ version of the McGill Guide on the github directory?
  • are you working with the MLZ version or the regular Zotero version? The two are different & have different distribution channels.
  • I'm working with the MLZ version, but I just found fbennet's repository, so I'll do the pulls there.
  • Ok. This question should apply to the MLZ and to the regular zotero version. I've been working on my own version of a style on my own repository for a while. If I just copy my version over top of the MLZ/Zotero distribution channel, the pull request will show the entire file as changed, correct? Won't it lose my commit comments and make it really hard to examine the difference?

    Sorry if off-topic.

  • no, it'll create a diff - only lines that have actually changed will be highlighted as changed (provided you haven't messed with the indenting - it should be two spaces per level). It will lose your commit messages, but most repositories frown on multiple commit messages in a pull request anyway, so you should just explain your changes in one message.
Sign In or Register to comment.