Changing sorting in bibliography
I'd like to be able to tweak my CSL style so that dictionaries without authors can be sorted according to the dictionary title field in the Bibliography. So for example, the Oxford English Dictionary would appear under O. At the moment anything with no author is sorted at the end of the bibliography, and I can't work out how to change this. It's mainly dictionary entries that this applies to, but if anyone could tell me how to apply a general rule of substituting a title for an author in bibliography sorting, that would be even better.
Thanks in advance!
Thanks in advance!
"Substituting" is the right word here -- you'd put <text variable="titlte"/> in as a substitute condition in either the author macro (if the answer to the above question is yes) or in a separate author-sort macro you create & use for sorting.
Most existing styles use substitute rules for authors, so you can look at any range of them for a template.
Thanks for such a quick response. There are various titles this would apply to, so I think I'll have to add an author-sort macro. Is there a straightforward all-purpose way of doing this? I'm gradually getting my head around CSL syntax but I'm not quite there yet...
Thanks again.
If so, the author macro would do and it's look something like
<macro name="author">
<names variable="author">
<name names-as-sort-order="all"/>
<substitute>
<names variable="editor"/>
<names variable="container-title"/>
</substitute>
</names>
</macro>
and then under <sort> for the bibliography, make sure that the first entry is <key macro="author"/>, which likely is already the case.
You can tweak this further, including adding conditions into substitute like
<choose>
<if type="entry-dictionary">
<text variable="container-title"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
(only use publication title for dictionaries, otherwise use title) etc.