# Bug in 'Format citations'?

**URL:** <https://forum.paperpile.com/t/bug-in-format-citations/921>\
**Category:** Support\
**Tags:** google-docs, resolved, citation-formatting\
**Created:** [December 4, 2015, 5:22pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921 "2015-12-04T17:22:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 4, 2015, 5:22pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/1 "2015-12-04T17:22:53Z")

</div>

I could not get Paperpile to format citations where there is only an editor, no author, with my own CSL , so I checked with the standard APA 6th edition CSL and the problem remains.

- Book, no authors, one editor.
- Editor’s name in field as Surname, Firstname.
- Citation style: American Psychological Association, 6th edition.

If I use the quick ‘Cite’ button in Paperpile, this is copied to the clipboard in the following format, as expected:

- Insoll, T. (Ed.). (2007). The archaeology of identities : a reader. London: Routledge.

When I am creating a document in Google Docs and use CTRL-ALT-P to insert this item as an inline citation it gives:

- (Insoll 2007)

But when I use ‘Format citations’ in the Paperpile menu this is changed to:

- (Timothy Insoll, 2007)

and the reference is formatted as:

- Timothy Insoll. (2007). The archaeology of identities : a reader. London: Routledge.

When they should be:

- (Insoll, 2007)
- Insoll, T. (Ed.). (2007). The archaeology of identities : a reader. London: Routledge.

Let me know if you need any more information needed.

---

<div class="post-metadata">

**Author:** ![stefan](https://forum.paperpile.com/user_avatar/forum.paperpile.com/stefan/32/1729_2.png) [@stefan](https://forum.paperpile.com/u/stefan)\
**Post date:** [December 4, 2015, 5:39pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/2 "2015-12-04T17:39:54Z")

</div>

Can you have a look at this thread: [Bibliography: First name included even though APA style selected](https://forum.paperpile.com/t/bibliography-first-name-included-even-though-apa-style-selected/124)

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 4, 2015, 5:43pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/3 "2015-12-04T17:43:28Z")

</div>

But in Paperpile there is only this one reference with Insoll as the author.

---

<div class="post-metadata">

**Author:** ![stefan](https://forum.paperpile.com/user_avatar/forum.paperpile.com/stefan/32/1729_2.png) [@stefan](https://forum.paperpile.com/u/stefan)\
**Post date:** [December 4, 2015, 6:02pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/4 "2015-12-04T18:02:30Z")

</div>

If you click ‘cite’ in Paperpile the citation is formatted under the assumption that this is the only item in your bibliography so there is never disambiguation going on if you just have selected one item.

If you cite multiple papers in one Google Doc with the same author APA will disambiguate.

It could be totally unrelated and if you really only have one item with the author Insoll in your library it might be something different.

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 4, 2015, 6:11pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/5 "2015-12-04T18:11:32Z")

</div>

I can confirm that “Insoll” appears only once in my Paperpile database and there is only one inline citation in my document.

It is not just APA - the same incorrect formatting occurs in my own Harvard-based CSL.

I wonder if it is how the Paperpile formatting engine implements “substitute” ?

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 4, 2015, 6:13pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/6 "2015-12-04T18:13:07Z")

</div>

Oh, I included an XML snippet in that last comment but it didn’t appear - perhaps this will be better:

```
<macro name="author-short">
<names variable="author">
  <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
  <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
  </substitute>
</names>

```

---

<div class="post-metadata">

**Author:** ![stefan](https://forum.paperpile.com/user_avatar/forum.paperpile.com/stefan/32/1729_2.png) [@stefan](https://forum.paperpile.com/u/stefan)\
**Post date:** [December 4, 2015, 6:24pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/7 "2015-12-04T18:24:53Z")

</div>

Thanks, we will have a look at it.

---

<div class="post-metadata">

**Author:** ![andreas](https://forum.paperpile.com/user_avatar/forum.paperpile.com/andreas/32/36_2.png) [@andreas](https://forum.paperpile.com/u/andreas)\
**Post date:** [December 8, 2015, 9:35am UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/8 "2015-12-08T09:35:30Z")

</div>

[quote=“richardm, post:1, topic:921”][/quote]

You are on the right track. The same processing that is applied to the author variable, needs to be applied to the editor variable. The CSL file needs to edited this way:

```
<names variable="editor">
  <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
  <label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
</names>

```

And the same needs to be done for the “author-short” macro:

```
<macro name="author-short">
  <names variable="author">
    <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
    <substitute>
       <names variable="editor">
         <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
       </names>
   ...
```

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 8, 2015, 12:00pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/9 "2015-12-08T12:00:22Z")

</div>

By my reading of the specification the substituted element inherits the earlier name attribute values (see [here][1]):

“A shorthand version of [cs:names] without child elements, which inherits the attributes values set on the [cs:name] and [cs:et-al] child elements of the original [cs:names] element, may also be used.”

I understand that to mean that this is a simple and straightforward way of applying the the same values whether it is an author or editor.

I am testing with the APA 6th ed CSL and that has the simple layout as above and Zotero interprets that correctly (i.e. in line with my understanding of the specification) in formatting both inline ciation and the reference, whereas Paperpile does not.

Am I missing something…?

Thanks.  
[1]: [http://docs.citationstyles.org/en/stable/specification.html#substitute](http://docs.citationstyles.org/en/stable/specification.html#substitute)

---

<div class="post-metadata">

**Author:** ![andreas](https://forum.paperpile.com/user_avatar/forum.paperpile.com/andreas/32/36_2.png) [@andreas](https://forum.paperpile.com/u/andreas)\
**Post date:** [December 9, 2015, 6:38am UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/10 "2015-12-09T06:38:46Z")

</div>

I also talked to the Zotero developers and the error seems to be in the CSL processing engine citeproc.js used by both Zotero and Paperpile. I am currently looking into the requirements to update it to a new version.

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 10, 2015, 1:14pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/11 "2015-12-10T13:14:35Z")

</div>

Thanks Andreas.

---

<div class="post-metadata">

**Author:** ![andreas](https://forum.paperpile.com/user_avatar/forum.paperpile.com/andreas/32/36_2.png) [@andreas](https://forum.paperpile.com/u/andreas)\
**Post date:** [December 15, 2015, 11:02am UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/12 "2015-12-15T11:02:06Z")

</div>

We have updated citeproc-js to version 1.1.63, which should fix the issues you mentioned.

---

<div class="post-metadata">

**Author:** ![richardm](https://forum.paperpile.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardm](https://forum.paperpile.com/u/richardm)\
**Post date:** [December 16, 2015, 7:55pm UTC](https://forum.paperpile.com/t/bug-in-format-citations/921/13 "2015-12-16T19:55:49Z")

</div>

Thanks Andreas - I’ve just done a quick check and it looks good.
