# Sort keys on CSL styles

**URL:** <https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096>\
**Category:** CSL Development\
**Created:** [May 11, 2012, 12:16am UTC](https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096 "2012-05-11T00:16:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [May 11, 2012, 12:16am UTC](https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096/1 "2012-05-11T00:16:06Z")

</div>

A user on [zotero.org](http://zotero.org) recently reported a problem with sorting in  
Chicago Manual of Style (note). No need to review the discussion (it’s  
a longish thing), but the link to it is here:

[http://forums.zotero.org/discussion/23276/different-works-by-same-author-listed-without-dash-replacing-authors-name/#Item\_33](http://forums.zotero.org/discussion/23276/different-works-by-same-author-listed-without-dash-replacing-authors-name/#Item_33)

The short story is that several styles in the repo use composite keys  
created by a macro, like:

It is very unlikely that style guides will expect author names and a  
following title to be treated as a single sort key – see the  
screenshots linked from the discussion thread above for some examples  
of what happens when that’s done. If I remember correctly, the early  
CSL processor in Zotero had problems sorting on more than two keys,  
and that may be why these macros were introduced.

The individual elements of these macros should now be broken out to  
separate sort keys, after checking through them manually to see what  
they are trying to do. Here is an initial list of 21 obvious  
malefactors:

chicago-annotated-bibliography.csl  
chicago-dated-note-biblio-no-ibid.csl  
chicago-fullnote-bibliography.csl  
chicago-fullnote-bibliography-no-ibid.csl  
chicago-library-list.csl  
chicago-note-biblio-no-ibid.csl  
international-organization.csl  
inter-ro.csl  
irish-historical-studies.csl  
law1-de.csl  
mcrj7.csl  
mla-notes.csl  
national-archives-of-australia.csl  
radiopaedia.csl  
romanian-humanities.csl  
sbl-fullnote-bibliography.csl  
society-for-general-microbiology.csl  
turabian-fullnote-bibliography.csl  
universidad-evangelica-del-paraguay.csl  
universita-di-bologna-lettere.csl  
wheaton-college-phd-in-biblical-and-theological-studies.csl

It’s not an urgent thing – complaints have been very slow to emerge,  
which is kind of surprising – but since the problem is clear it  
should be fixed up as and when we have time to spare. Since I’ve  
raised my hand about the issue, I’ll be happy to help out, of course.

Frank

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [May 11, 2012, 1:08pm UTC](https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096/2 "2012-05-11T13:08:19Z")

</div>

Is that documented anywhere? I couldn’t find any mention in the archives,  
and don’t remember ever discussing this. Elena, Sebastian, has this been a  
known issue?

RintzeOn Thu, May 10, 2012 at 8:16 PM, Frank Bennett \<@Frank\_Bennett\>wrote:

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [May 19, 2012, 4:44am UTC](https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096/3 "2012-05-19T04:44:13Z")

</div>

I corrected all the styles with either a “sort-key” or “contributors-sort”  
macro:

> <https://github.com/citation-style-language/styles/commit/7966cb2a460ab46f2999c1d12f4c632469fdf7e2>

  

> <https://github.com/citation-style-language/styles/commit/76f5f35dcfcd7b992fb23820bbd8375253f0d411>

RintzeOn Thu, May 10, 2012 at 8:16 PM, Frank Bennett \<@Frank\_Bennett\>wrote:

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [May 19, 2012, 5:26am UTC](https://discourse.citationstyles.org/t/sort-keys-on-csl-styles/1096/4 "2012-05-19T05:26:18Z")

</div>

Great stuff! Big round of applause.

Frank
