# citeproc-js bug in handling lists of mixed authors?

**URL:** <https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248>\
**Category:** CSL Development\
**Created:** [February 7, 2015, 2:41am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248 "2015-02-07T02:41:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maloney\_Christopher](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Maloney\_Christopher](https://discourse.citationstyles.org/u/Maloney_Christopher)\
**Post date:** [February 7, 2015, 2:41am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/1 "2015-02-07T02:41:27Z")

</div>

Hi,

We’ve encountered a problem that I suspect is a bug in citeproc-js. I’m attaching the citeproc-json file. Note how there are a lot of authors, some of which have family/given names, and some of which are specified with “literal”.

The output that I’m getting has the order of the authors all wrong, for all of the three styles that we’re using. It seems that the literal authors are causing the processor to break. The outputs are below (sans some formatting).

Is this a known bug, or is there something I’m missing?

american-medical-association:

Vv V, Ww W, Xx X, et al. with Aa A, Bb B, Cc C et al., Literal J, Kk K, Ll L, Mm M et al., Literal U. Stuff and nonsense. My Favorite Journal. 2015;24(2):582-596. doi:10.1234/mfj/1234.

modern-language-association:

Vv, V et al. with Aa, A, B Bb, et al., Literal J and Kk, K, L Ll et al., Literal U. “Stuff and Nonsense.” My Favorite Journal 24.2 (2015): 582–596. PMC. Web. 6 Feb. 2015.

apa:

Vv, V., Ww, W., Xx, X., Yy, Y., Zz, Z., Aaa, A., … Fff, F. with Aa, A., Bb, B., Cc, C., Dd, D., Ee, E., Ff, F., … Ii, I., Literal J and Kk, K., Ll, L., Mm, M., Nn, N., Oo, O., Pp, P., … Tt, T., Literal U. (2015). Stuff and nonsense. My Favorite Journal, 24(2), 582–596. doi:10.1234/mfj/1234–  
Chris Maloney  
NIH/NLM/NCBI (Contractor)  
Building 45, 4AN36D-12  
301-594-2842

---

<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:** [February 7, 2015, 3:48am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/2 "2015-02-07T03:48:50Z")

</div>

FWIW, while Zotero does import/export single-field authors as literal  
to CSL JSON when using export, it looks like it passes them on to  
citeproc-js just as family with an empty given (or at least that’s  
what ends up embeded in documents).

Odd. Maybe Frank can shed light on this.

Though I’m confused about the JSON you attached and the output you’re  
getting–I only see 5 authors total (3 regular 2 literal) in the JSON,  
so that couldn’t possibly produce what you have.

---

<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:** [February 7, 2015, 10:23am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/3 "2015-02-07T10:23:00Z")

</div>

Chris,

I think you’re seeing this, which dates back to the early development  
of the processor:

```
http://citationstylist.org/docs/citeproc-js-csl.html#cs-institution-extension

```

When the “literal” element is used, the processor interprets it as an  
institution. Authors listed before an institution name are grouped  
with it in the rendered author list, as affiliated to the institution.  
This works out nicely but for one detail - unaffiliated authors. To  
capture that information in the simple list structure accepted by the  
processor, unaffiliated authors are taken from the end of the list,  
after the last institution. This is obviously confusing, since they  
render at the beginning of the list in a citation, followed by "with"  
to set them off from the author/institution groups that follow.

If you want institutional authors to be treated as first-class authors  
in the list, just send them as a “family” element, with no “given”.  
That’s what Zotero does - their intention with “single-field entry” in  
the UI had not been to treat them as institutional authors, and they  
were concerned about user confusion. (In the MLZ variant that I  
maintain, single-field entries are sent to the processor as “literal”,  
and are treated as institutions.)

It is unfortunate that the reversal of position can be alarming - but  
on the other hand, we had to turn backflips in CSL to cope with the  
scientists’ convention of placing the principle investigator at the  
end of an author list. Sometimes there isn’t quite enough bandwidth in  
a schema.

Anyway, I’m pretty sure that’s what’s going on with those. (I’ll now  
brace myself for the onslaught of rotten tomatoes.)

Frank

---

<div class="post-metadata">

**Author:** ![Maloney\_Christopher](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Maloney\_Christopher](https://discourse.citationstyles.org/u/Maloney_Christopher)\
**Post date:** [February 9, 2015, 6:54pm UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/4 "2015-02-09T18:54:45Z")

</div>

Yes, sorry, I attached the wrong file. Here is the one that produced the  
output I quoted.–  
Chris Maloney  
NIH/NLM/NCBI (Contractor)  
Building 45, 4AN36D-12  
301-594-2842

“Sebastian Karcher” wrote:

[4275071.testcase.json](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/f9f55d2b0ce588320cfb4f02670fd2b0f8622184.json) (2.91 KB)

---

<div class="post-metadata">

**Author:** ![Maloney\_Christopher](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Maloney\_Christopher](https://discourse.citationstyles.org/u/Maloney_Christopher)\
**Post date:** [February 9, 2015, 7:16pm UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/5 "2015-02-09T19:16:34Z")

</div>

Frank,

Thanks for your detailed explanation.

I think we can adjust our output to conform to these conventions. (And,  
anyway, I’m out of tomatoes at the moment!)

I created this issue,  
[https://bitbucket.org/fbennett/citeproc-js/issue/172/please-update-the-cite](https://bitbucket.org/fbennett/citeproc-js/issue/172/please-update-the-cite)  
proc-js-manual-with, to suggest that you update the citeproc-js manual  
with this info — that seems to be the closest thing to a human-readable  
description of the schema, and there’s no mention there of this  
interpretation of the “literal” values.–  
Chris Maloney  
NIH/NLM/NCBI (Contractor)  
Building 45, 4AN36D-12  
301-594-2842

---

<div class="post-metadata">

**Author:** ![Maloney\_Christopher](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Maloney\_Christopher](https://discourse.citationstyles.org/u/Maloney_Christopher)\
**Post date:** [February 10, 2015, 7:53pm UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/6 "2015-02-10T19:53:15Z")

</div>

Frank,

I read the section that you linked to,  
[http://citationstylist.org/docs/citeproc-js-csl.html#cs-institution-extensi](http://citationstylist.org/docs/citeproc-js-csl.html#cs-institution-extensi)  
on, and I see that it says that this extension is enabled by default. Is  
there any way to turn it off? (I’m running citeproc-js via citeproc-java).  
I don’t see any mention of how to turn on/off extensions in the  
Integrator’s Manual  
([http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#instantiation-csl-engin](http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#instantiation-csl-engin)  
e).

Thanks!

Chris Maloney

---

<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:** [February 14, 2015, 3:36am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/7 "2015-02-14T03:36:50Z")

</div>

Chris,

In the current citeproc-js code, the only way of controlling  
institution treatment is in the input data. That’s not good, and I  
would like to fix it (and the documentation) for better control and  
clarity.

It’s a problem specific to citeproc-js, and I have some questions  
about the requirements, so let’s take the discussion over to the  
citeproc-js issue tracker:

```
https://bitbucket.org/fbennett/citeproc-js/issues?status=new&status=open

```

Frank

---

<div class="post-metadata">

**Author:** ![Maloney\_Christopher](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@Maloney\_Christopher](https://discourse.citationstyles.org/u/Maloney_Christopher)\
**Post date:** [February 16, 2015, 12:34am UTC](https://discourse.citationstyles.org/t/citeproc-js-bug-in-handling-lists-of-mixed-authors/1248/8 "2015-02-16T00:34:10Z")

</div>

Okay, thanks,  
I created #173 - Fix institutional authors jiggery-pokery  
[https://bitbucket.org/fbennett/citeproc-js/issue/173/fix-institutional-auth](https://bitbucket.org/fbennett/citeproc-js/issue/173/fix-institutional-auth)  
ors-jiggery-pokery–  
Chris Maloney  
NIH/NLM/NCBI (Contractor)  
Building 45, 4AN36D-12  
301-594-2842

“Frank Bennett” wrote:
