Author names with "and"
Dear all,
I am having a problem with formatting my author names.
I would like to achieve the fllowing output:
1 author: J Doe, ...
2 authors: J Doe and A Lincoln, ...
3 authors: J Doe, A Lincoln and JF Kennedy, ...
4 authors or more: J Doe and others, ...
Same for cross-citations:
1 author: J Doe (n 1)
2 authors: J Doe and A Lincoln (n 2)
3 authors: J Doe, A Lincoln and JF Kennedy (n 3)
4 authors or more: J Doe and others (n 4)
I achieved that I get an "and" between two authors for the first citation and the "and others" for 4 authors. However, the code does not work for either cross-citations for 2 authors (I get: "J Doe, A Lincoln n 1) nor for 3 authors in the first citation (I get: "J Doe and A Lincoln and JF Kennedy".
I'll just leave part of my code here, any help/advice would be greatly appreciated!!
I am having a problem with formatting my author names.
I would like to achieve the fllowing output:
1 author: J Doe, ...
2 authors: J Doe and A Lincoln, ...
3 authors: J Doe, A Lincoln and JF Kennedy, ...
4 authors or more: J Doe and others, ...
Same for cross-citations:
1 author: J Doe (n 1)
2 authors: J Doe and A Lincoln (n 2)
3 authors: J Doe, A Lincoln and JF Kennedy (n 3)
4 authors or more: J Doe and others (n 4)
I achieved that I get an "and" between two authors for the first citation and the "and others" for 4 authors. However, the code does not work for either cross-citations for 2 authors (I get: "J Doe, A Lincoln n 1) nor for 3 authors in the first citation (I get: "J Doe and A Lincoln and JF Kennedy".
I'll just leave part of my code here, any help/advice would be greatly appreciated!!
<macro name="author-note">
<choose>
<if type="interview">
<group delimiter=" and ">
<names variable="interviewer">
<name form="long" initialize-with=""/>
</names>
<names variable="author">
<name form="long" initialize-with=""/>
</names>
</group>
</if>
<else-if type="personal_communication">
<group delimiter=" ">
<group delimiter=" from ">
<text variable="genre"/>
<names variable="author" delimiter=" and ">
<name form="long" initialize-with=""/>
</names>
</group>
<names variable="recipient" delimiter=" and " prefix="to ">
<name form="long" initialize-with=""/>
</names>
</group>
</else-if>
<else-if type="broadcast">
<text variable="publisher"/>
</else-if>
<else>
<choose>
<if variable="author">
<names variable="author" delimiter=" and ">
<name delimiter=" and " initialize-with=""/>
</names>
</if>
<else-if variable="editor">
<names variable="editor" delimiter=" and ">
<name form="long" initialize-with=""/>
</names>
</else-if>
<else-if variable="translator">
<names variable="translator" delimiter=" and ">
<name form="long" initialize-with=""/>
</names>
</else-if>
<else>
<text macro="title"/>
</else>
</choose>
</else>
</choose>
</macro>
<citation et-al-min="4" et-al-use-first="1">
<layout delimiter="; " suffix=".">
<choose>
<if position="first">
<text macro="entry"/>
</if>
<else>
<group delimiter=" ">
<choose>
<if variable="author">
<names variable="author">
<name form="short"/>
</names>
</if>
<else-if variable="editor">
<names variable="editor">
<name form="short"/>
</names>
<text value="(eds)"/>
</else-if>
</choose>
<group prefix="(n " suffix=")">
<text variable="first-reference-note-number"/>
</group>
<text macro="pinpoint"/>
</group>
</else>
</choose>
</layout>
</citation>
But you need to do these things
1. On your <name> element, set and="text" and delimiter-precedes-et-al="never" and delimiter-precedes-last="never"
2. On <names> (or <citation>, <binliogrpahy>, or <style>), Set et-al-min=4 and et-al-use-first=1
3. Under <names> (after <name>), add an <et-al> with term="and others"
In CSL 1.0.2, it seems I can’t use et-al-min, et-al-use-first, or delimiter-precedes-last on when it’s inside a macro like
<author-note>
. Those attributes are only valid on<citation>, <bibliography>, or <style>
.From what I can tell, it’s a limitation of CSL itself, unless I’m missing something?
<macro name="author">
<names variable="author">
<name delimiter-precedes-last="always" et-al-min="3" et-al-use-first="1" initialize-with="" name-as-sort-order="all" sort-separator=" "/>
<label form="short" strip-periods="true" prefix=" (" suffix=")"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
However, I prefer to set these on citation or bibliography respectively.
I think I fixed it now by moving list/et-al settings from
<names>
to the parents so they inherit to all names. In<citation>/<bibliography>
I used:and="text" name-delimiter=", " delimiter-precedes-last="never" delimiter-precedes-et-al="never" et-al-min="4" et-al-use-first="1"
(and keep the localized<term name="et-al">and others</term>
). Then keep every<names>
clean and put formatting only on<name>
: e.g., in macros<names variable="author"><name initialize-with=""/></names>
, and in subsequent notes<names variable="author"><name form="short" initialize-with=""/></names>
. This yields: 1 authorJ Doe
; 2 authorsJ Doe and A Lincoln
; 3 authorsJ Doe, A Lincoln and JF Kennedy
; 4+ authorsJ Doe and others
, and passes the CSL validator.