Secondary Sorting in HTML Export
Pardon me if this question has been asked before but I'm not having any luck.
I'm working on exporting a bibliography to HTNL to then put on a departmental webpage. When I do this I can only export based on one sort criteria as displayed in the Firefox plug-in. I want the list to display the list as Date First, then within the date sorted by Author last name. I've tried tinkering with the .CSL file to properly display the results, but then I've had trouble getting the .CSL file to load.
If anyone can help with the issue of permanence in sorting when exporting to HTML that would be great.
Or if there is an alternate route that you recommend that would also be helpful.
I'm working on exporting a bibliography to HTNL to then put on a departmental webpage. When I do this I can only export based on one sort criteria as displayed in the Firefox plug-in. I want the list to display the list as Date First, then within the date sorted by Author last name. I've tried tinkering with the .CSL file to properly display the results, but then I've had trouble getting the .CSL file to load.
If anyone can help with the issue of permanence in sorting when exporting to HTML that would be great.
Or if there is an alternate route that you recommend that would also be helpful.
Bibliographies can be exported as html and there are hundreds of citation styles with various sorting criteria - if you create a bibliography in HTML it will be sorted according to the criteria of the citation style you pick.
If you're not happy with that sorting, either pick a different style, or describe specifically what you want to do and where exactly you've been having problems with the CSL.
I hoped to see if he knew whether sorting a bibliography my multiple keys is possible and whether he encountered any problems or known bugs. Since he had not done this, he searched the web and posted this query. I've now found that it is indeed possible to do what I need.
Here's the solution I found; I'd be grateful for any comments or suggestions for improvement.
I created a new style, starting with nature.csl, then borrowed a macro from cell.csl:
<macro name="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
and changed the bibliography sort keys as follows:
...
<bibliography et-al-min="6" et-al-use-first="1" second-field-align="flush" entry-spacing="0">
<sort>
<key macro="issued"/>
<key macro="author"/>
</sort>
<layout>
...
This seems to do what I want. Again, suggestions for improvement are welcome. I wonder whether the macro is the right one to capture the year of publication.