I am looking at sort_BibliographyCitationNumberDescendingViaMacro.txt
It is pretty simple. It has eight basic input references and this sorting configuration:
<sort>
<key macro="citation-number" sort="ascending"/>
<key macro="citation-number" sort="descending"/>
</sort>
<macro name="citation-number">
<text variable="citation-number"/>
</macro>
I am confused, however, by the expected output of
<layout>
<text variable="citation-number" prefix="[" suffix="] "/>
<text variable="title" />
</layout>
as
[8] Book One
[7] Book Three
[6] Book Four
[5] Book Six
[4] Book Two
[3] Book Five
[2] Book Seven
[1] Book Eight
The titles are in the given input order but the citation numbers are in reverse order.
However, when I read the spec, a second <sort><key/></sort>
is only used for "items sharing the first sort key value,” in this case, the same citation-number
. So the sort=“descending”
variant in this test shouldn’t apply.
There could be a feedback loop I’m missing since it seems this is sorting by the same value it’s altering, that is, the position of the reference in the bibliography. But I still don’t see a scenario where references would have the same citation-number
.