Problem with Disambiguation - year suffix

edited May 2, 2019
Hello,
I have edited a csl format to match new Social Cognitive and Affective Neuroscience Journal citation/references format.
I was able to make all the modifications I needed using csl visual editor except for disambiguation when an author has several papers the same year.
Target format is Doe et al., 2017a; Doe et el., 2017b etc by order of insertion in the article text.
When I enter citation corresponding to Doe et al., 2017a and then the second one it will change 2017a to 2017b.
it looks like there is another layer of sorting but I can't put my finger on it.
Please could anyone help with this? I ran out of options here.
(Code below)

Thank you very much.

------
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl"; class="in-text" version="1.0" and="symbol" page-range-format="chicago" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
<info>
<title>Social Cognitive and Affective Neuroscience_2019_page number in book_disambiguation wo add name</title>
<title-short>SCAN</title-short>
<id>http://www.zotero.org/styles/social-cognitive-and-affective-neuroscience_2019_page-number-in-book_disambiguation-wo-add-name</id>;
<link href="http://www.zotero.org/styles/social-cognitive-and-affective-neuroscience_2019_page-number-in-book_disambiguation-wo-add-name"; rel="self"/>
<link href="http://www.zotero.org/styles/harvard-the-university-of-northampton"; rel="template"/>
<link href="https://academic.oup.com/scan/pages/General_Instructions"; rel="documentation"/>
<author>
<name>Patrick O'Brien</name>
</author>
<category citation-format="author-date"/>
<category field="medicine"/>
<issn>1749-5016</issn>
<eissn>1749-5024</eissn>
<updated>2019-04-30T23:11:43+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="editor">
<names variable="editor" delimiter=", ">
<name initialize-with=". "/>
<label form="short" strip-periods="true" prefix=" (" suffix=")"/>
</names>
</macro>
<macro name="anon">
<text term="anonymous" form="short" text-case="capitalize-first" strip-periods="true"/>
</macro>
<macro name="author">
<names variable="author">
<name and="symbol" et-al-min="7" et-al-use-first="6" initialize-with="." name-as-sort-order="all"/>
<label form="short" prefix=" "/>
<substitute>
<names variable="editor"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1"/>
<et-al font-style="normal"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="access">
<choose>
<if type="webpage post-weblog post graphic" match="any">
<choose>
<if variable="URL">
<text value="[online]. Available from:" suffix=" "/>
<text variable="URL"/>
<group prefix=" [" suffix="]">
<text term="accessed" text-case="capitalize-first" suffix=" "/>
<date variable="accessed">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
<text variable="title" font-style="normal"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher" form="short"/>
<number prefix="p. " variable="number-of-pages"/>
</group>
</macro>
<macro name="year-date">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="pages">
<group>
<label plural="never" suffix=" " variable="page" form="short"/>
<text variable="page"/>
</group>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="false" disambiguate-add-givenname="false">
<sort>
<key macro="year-date"/>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="year-date"/>
<group>
<label variable="locator" form="short"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>
<bibliography et-al-min="4" et-al-use-first="3" hanging-indent="true">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout>
<group delimiter=" ">
<text macro="author"/>
<date variable="issued" prefix="(" suffix=")">
<date-part name="year"/>
</date>
</group>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=". " prefix=" " suffix=".">
<text macro="title"/>
<text macro="edition"/>
<text macro="editor"/>
</group>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter paper-conference" match="any">
<text macro="title" prefix=" " suffix="."/>
<group prefix=" " delimiter=" ">
<text term="in" text-case="capitalize-first" suffix=":"/>
<text macro="editor" suffix="."/>
<text variable="container-title" font-style="italic" suffix="."/>
<text variable="collection-title" suffix="."/>
<text variable="event" suffix="."/>
<group suffix="." delimiter=", ">
<text macro="publisher" prefix=" "/>
<text macro="pages"/>
</group>
</group>
</else-if>
<else-if type="thesis">
<group prefix=" " suffix="." delimiter=". ">
<text macro="title"/>
<text variable="genre"/>
<text macro="publisher"/>
</group>
</else-if>
<else>
<group delimiter=". ">
<group>
<text macro="title" prefix=" "/>
<text macro="editor" prefix=" "/>
</group>
<group delimiter=", ">
<text variable="container-title" font-style="normal"/>
<text variable="volume" font-weight="normal"/>
<text variable="page" suffix="."/>
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access" suffix="."/>
</layout>
</bibliography>
</style>
  • What is the order of the items in the bibliography?
  • Or to re-phrase fbennett -- the a/b is determined by the order of items in the bibliography, with a always listed before b -- you're likely sorting by item title. (If you want to share large amounts of code, use a site such as hastebin.com )
  • edited May 2, 2019
    Thank you for getting back to me. Much appreciated.

    I am going touse actual examples to be as precise as possible.
    Items are sorted by authors in the library with van Lutterveld, Houlihan, et al., 2017 appearing before van Lutterveld, van Dellen, et al., 2017.
    I want van Lutterveld, Houlihan, et al., 2017 to be van Lutterveld et al., 2017a and van Lutterveld, van Dellen, et al., 2017 to be van Lutterveld et al., 2017b

    My goal is to have the first article cited in the article van Lutterveld et al., 2017a
    = order of appearance.

    When I use the default setting of the format using disambiguation by adding a name, the order is maintained.
    After changing the type of disambiguation to use a suffix, letters a and b are inverted.

    I am showing a short section of code here - let me know if you want the full code via hastebin.com)

    1. initial code - disambiguation by adding name - order OK.

    <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true">
    <sort>
    <key macro="year-date"/>
    <key macro="author"/>
    <key variable="title"/>
    </sort>


    2. modified code - disambiguation year suffix - order NOT OK (1st ref cited is attributed b)

    <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="false" disambiguate-add-givenname="false">
    <sort>
    <key macro="author"/>
    <key macro="year-date"/>
    </sort>


    I played with removing the sort, adding rule etc, nothing works.

    Thank you for your feedback, would like to avoid any manual editing!


  • Please follow adamsmith's guidance above, and use https://hastebin.com to share code here. We can't work from code samples pasted directly into forum posts.
  • How do those appear in the bibliography? As I say above, the assignment of a and b is determined by the order in the bibliography (as it should be -- it makes no sense to have 2017b appear before 2017a in the bibliography, which is, after all, alphabetical).

  • Hello,
    I agree with you. It does not make sense to me either.

    Maybe I was not clear in my response above: I am using a (mendeley) library where items are sorted by authors name alphabetically. In my library reference 2017a appears first. When I tried to change the code countless times it is changed to 2017b.

    Am I missing some library features (like order saved or this kind of things)?

    Here is the original code I used where disambiguation is done by adding name, not year suffix.

    https://www.hastebin.com/rayodutune.xml

    I see (at least) 2 options here:

    1. library sorting
    2. code for disambiguation

    How would you code the disambiguation by year suffix and make sure it is sorted correctly?
    Loads of thanks from a newbie to coding!
  • edited May 2, 2019
    Do you use "library" as a synonym for bibliography? Those aren't the same thing. Could you paste the _bibliography_ as it appears with your modified style?

    Also, it's not OK to wait until this far into the thread to mention that you're using Mendeley. Mendeley is not the same product as Zotero and will not consistently behave in the same way with citation styles, so this can cause us to waste a lot of time. We'll try to help with citation styles as a courtesy (though maybe the fact that you're relying on the help of volunteers of a competing open source project while using software produced by a multi-billion dollar company should lead you to rethink that choice), but if this turns out to be a bug, this is at least as likely to be a problem of Mendeley.
  • I hear you. I was not aware of these distinctions. Zotero appearing in the code, I looked for resources to get help without knowing what you explain and thought they shared common development platforms. Apologies if I offended you. No harm intended or bad intentions just a whole new world. I appreciate your comment and help and respect whatever works for you. Thank you.

    Here's the code for bibliography from the modified code.
    https://www.hastebin.com/gegawenixi.xml

    When I generate references list in the word file by inserting bibliography, reference 2017b (the one that appears first and need t be 2017a) appears after a.

    Paste selection of bibliography generated:

    van Lutterveld, R. & Brewer, J. (2015) Neurofeedback from the Posterior Cingulate Cortex as a Mental Mirror for Meditation. Biofeedback, 43, 117–20.
    van Lutterveld, R., van Dellen, E., Pal, P., Yang, H., Stam, C.J., & Brewer, J. (2017a) Meditation is associated with increased brain network integration. NeuroImage, 158, 18–25.
    van Lutterveld, R., Houlihan, S.D., Pal, P., Sacchet, M.D., McFarlane-Blake, C., Patel, P.R., et al. (2017b) Source-space EEG neurofeedback links subjective experience with brain activity during effortless awareness meditation. NeuroImage, 151, 117–27.



  • edited May 2, 2019
    Right, so the cause here is the order in the bibliography. The item appearing first in the bibliography will always get the a). van Dellen appears before "Houlihan" because you have demote-non-dropping-particles="sort-only" in the style, which means that van Dellen is sorted as D. If you don't want that, set this to never (the sort order in your library is irrelevant to citation styles).

    If you want to keep that general pattern but still always get the first mentioned item listed first in the bibliography (personally, I don't think that's a good rule), you'd have to do something like sorting by the first author, then by date, then by citation number, then by the remaining names, then by title (or so). That's possible, but a bit involved to set up.
  • Done! I very much appreciate your help, thank you.
Sign In or Register to comment.