# Name-as-sort-order problems

**URL:** <https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818>\
**Category:** CSL Usage\
**Created:** [May 3, 2023, 10:02am UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818 "2023-05-03T10:02:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)\
**Post date:** [May 3, 2023, 10:02am UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/1 "2023-05-03T10:02:46Z")

</div>

Hi,

I’m currently working on a style for one of the departments at my institution: [\<?xml version="1.0" encoding="utf-8"?\>\<style class="note" version="1.0" name-d - Pastebin.com](https://pastebin.com/bdCraawE)

Name formatting gives me some headaches. In particular, I’m having trouble with this macro:

```xml
  <macro name="choreographie">
    <choose>
      <if type="performance motion_picture" match="any">
        <group delimiter=" ">
          <text value="Choreografie:"/>
          <names variable="script-writer"/>
        </group>
      </if>
    </choose>

```

My test data looks like this:

```json
{"id":"uhlichRavemachine2016","abstract":"Tanzaufführung","citation-key":"uhlichRavemachine2016","issued":{"date-parts":[[2016,10,12]]},"publisher-place":"brut Wien","script-writer":[{"family":"Uhlich","given":"Doris"}],"title":"Ravemachine","type":"performance"}

```

This should be formatted as

> Ravemachine. Choreografie: Doris Uhlich, brut Wien, Premiere: 12.10.2016.

Now, I’m getting this result in the online editor, and also with pandoc, but with Zotero the output is:

> Ravemachine. Choreografie: Uhlich, Doris, brut Wien, Premiere: 12.10.2016.

I’ve checked the style for dangling `name-as-sort-order` attributes, but they don’t appear on `cs:style` or `cs:bibliography`, so I don’t think this is an inheritance issue.

What am I missing here? Does anyone know?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Karcher](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/sebastian_karcher/32/176_2.png) [@Sebastian\_Karcher](https://discourse.citationstyles.org/u/Sebastian_Karcher)\
**Post date:** [May 3, 2023, 1:12pm UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/2 "2023-05-03T13:12:11Z")

</div>

How are you testing? I did a quick test in Zotero (which doesn’t import your CSL JSON into the right format, so had to tweak some & it might not be identical) and getting “Choreografie: Doris Uhlich” there

---

<div class="post-metadata">

**Author:** ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)\
**Post date:** [May 4, 2023, 6:54am UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/3 "2023-05-04T06:54:34Z")

</div>

That’s how to data looks in Zotero:

![grafik](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/242c0cf4a75ec39586065ce74cf18970b5a64dc5.png)

Anything wrong with that?

Regarding testing: I’ve checked in the included style editor, and in a dummy word document. (Or what do you mean with “How are you testing?”)

---

<div class="post-metadata">

**Author:** ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)\
**Post date:** [May 11, 2023, 11:58am UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/4 "2023-05-11T11:58:01Z")

</div>

Just a quick follow-up here. I’d still be interested to hear if there’s something wrong with how I enter the data. @Sebastian_Karcher how do you enter the item?

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [May 15, 2023, 1:56pm UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/5 "2023-05-15T13:56:59Z")

</div>

I also get the wrong result “Ravemachine. Choreografie: Uhlich, Doris, brut Wien, Premiere: 12.10.2016” in Zotero’s Style Editor (Zotero 6.0.26 on macOS 13.3.1).

 ![Screenshot 2023-05-15 at 21.48.50](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/e5b99dfd5f80b20ece33c93801e2116b8d8a4005.png)

 ![Screenshot 2023-05-15 at 21.49.09](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/382f38f582e010680a4afbede07f11f06431a633.png)

However when I run the fixture in the citeproc-js repository (laster master branch) with cslrun, it produces “Doris Uhlich” as expected.

> <https://gist.github.com/zepinglee/99f5f8c9e17fd1d486da5e00389a0e85>

It’s truly weird.

---

<div class="post-metadata">

**Author:** ![Denis\_Maier](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Denis\_Maier](https://discourse.citationstyles.org/u/Denis_Maier)\
**Post date:** [May 15, 2023, 3:03pm UTC](https://discourse.citationstyles.org/t/name-as-sort-order-problems/1818/6 "2023-05-15T15:03:29Z")

</div>

Thanks, @zepinglee, for your response. Now, I can guess what is going on, and it’s probably not so weird after all.

I bet @Sebastian_Karcher is using the latest beta version because with it the result is:

![grafik](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/c9133a7697d792daaad297d16273be6e1bfe83a7.png)

So, I guess the change is due to a change in citeproc-js, which must have been updated between Zotero 6.0.26 and 6.0.27-beta.3+3e12f3f20

Here we go: [Update citeproc-js to 1.4.63 · zotero/zotero@9ce8855 · GitHub](https://github.com/zotero/zotero/commit/9ce8855fa4d2363d1cb68cd330186e7327c63bbe)
