Skip to content
Permalink
Browse files

Fix sort by single macro

So styles don't rely on the behavior described in 
citation-style-language/test-suite#31
  • Loading branch information
adam3smith committed Jun 27, 2020
1 parent f2a8fe3 commit 8caa90b79c056abe206ede95fbc13ca37f4cf6d2
@@ -128,7 +128,7 @@
<bibliography>
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">
@@ -146,7 +146,7 @@
<bibliography>
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=", ">
@@ -78,6 +78,9 @@
</else>
</choose>
</macro>
<macro name="year">
<date date-parts="year" form="text" variable="issued"/>
</macro>
<macro name="collection-title-number">
<group delimiter=" " prefix="(= " suffix=")">
<text variable="collection-title"/>
@@ -132,7 +135,7 @@
<bibliography delimiter-precedes-et-al="never" et-al-min="3" et-al-use-first="2" hanging-indent="true">
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">
@@ -60,6 +60,9 @@
<date date-parts="year" form="text" variable="issued"/>
</group>
</macro>
<macro name="year">
<date date-parts="year" form="text" variable="issued"/>
</macro>
<macro name="edition">
<choose>
<if match="any" is-numeric="edition">
@@ -135,7 +138,7 @@
<bibliography et-al-min="4" et-al-use-first="1">
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">
@@ -129,7 +129,7 @@
<bibliography>
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">
@@ -63,6 +63,9 @@
<date date-parts="year" form="text" variable="issued"/>
</group>
</macro>
<macro name="year">
<date date-parts="year" form="text" variable="issued"/>
</macro>
<macro name="edition">
<choose>
<if match="any" is-numeric="edition">
@@ -138,7 +141,7 @@
<bibliography et-al-min="4" et-al-use-first="1">
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">
@@ -232,6 +232,36 @@
</else>
</choose>
</macro>
<macro name="author-sort">
<choose>
<if type="legislation" match="any">
<group delimiter=" ">
<text variable="title"/>
<text variable="title-short" prefix="(" suffix=")"/>
</group>
</if>
<else>
<choose>
<if type="bill" match="any">
<choose>
<if match="none" variable="author editor">
<text variable="title-short"/>
</if>
<else>
<text macro="u__author"/>
</else>
</choose>
</if>
<else-if type="article-newspaper" match="any">
<text variable="container-title"/>
</else-if>
<else>
<text macro="u__author"/>
</else>
</choose>
</else>
</choose>
</macro>
<macro name="b__container">
<choose>
<if type="chapter report paper-conference" match="any">
@@ -412,7 +442,9 @@
</citation>
<bibliography et-al-min="4" et-al-use-first="3" initialize="false" entry-spacing="0" hanging-indent="true">
<sort>
<key macro="b__author-year-title"/>
<key macro="author-sort"/>
<key macro="u__issued"/>
<key macro="u__title"/>
</sort>
<layout suffix=".">
<group delimiter=". ">
@@ -220,6 +220,36 @@
</else>
</choose>
</macro>
<macro name="author-sort">
<choose>
<if type="legislation" match="any">
<group delimiter=" ">
<text variable="title"/>
<text variable="title-short" prefix="(" suffix=")"/>
</group>
</if>
<else>
<choose>
<if type="bill" match="any">
<choose>
<if match="none" variable="author editor">
<text variable="title-short"/>
</if>
<else>
<text macro="u__author"/>
</else>
</choose>
</if>
<else-if type="article-newspaper" match="any">
<text variable="container-title"/>
</else-if>
<else>
<text macro="u__author"/>
</else>
</choose>
</else>
</choose>
</macro>
<macro name="b__container">
<choose>
<if type="chapter report paper-conference" match="any">
@@ -389,7 +419,9 @@
</citation>
<bibliography entry-spacing="0" hanging-indent="true">
<sort>
<key macro="b__author-year-title"/>
<key macro="author-sort"/>
<key macro="u__issued"/>
<key macro="u__title"/>
</sort>
<layout suffix=".">
<choose>
@@ -277,6 +277,36 @@
</else>
</choose>
</macro>
<macro name="author-sort">
<choose>
<if type="legislation" match="any">
<group delimiter=" ">
<text variable="title"/>
<text variable="title-short" prefix="(" suffix=")"/>
</group>
</if>
<else>
<choose>
<if type="bill" match="any">
<choose>
<if match="none" variable="author editor">
<text variable="title-short"/>
</if>
<else>
<text macro="u__author"/>
</else>
</choose>
</if>
<else-if type="article-newspaper" match="any">
<text variable="container-title"/>
</else-if>
<else>
<text macro="u__author"/>
</else>
</choose>
</else>
</choose>
</macro>
<macro name="b__in-editor-container">
<choose>
<if type="chapter report paper-conference" match="any">
@@ -459,7 +489,9 @@
<bibliography initialize="false" entry-spacing="0" hanging-indent="true">
<sort>
<key macro="sort_keys"/>
<key macro="b__author-year-title"/>
<key macro="author-sort"/>
<key macro="u__issued"/>
<key macro="u__title"/>
</sort>
<layout>
<group delimiter=". ">
@@ -138,7 +138,7 @@
<bibliography>
<sort>
<key macro="creator-short"/>
<key macro="creator-year-short"/>
<key macro="year"/>
</sort>
<layout>
<group delimiter=". " suffix=".">

1 comment on commit 8caa90b

@adam3smith

This comment has been minimized.

Copy link
Member Author

@adam3smith adam3smith commented on 8caa90b Jun 27, 2020

@georgd -- since these are styles you maintain, I'm happy to change the naming of the author-sort macro, but having all sort conditions in a single macro won't work (I'm actually surprised you haven't gotten error reports on this from your users). I'll merge this some time next week if I don't hear back from you

Please sign in to comment.
You can’t perform that action at this time.