Author sorting as in zotero software
Hi,
I am having trouble with the author sorting in my current zotero style. I have one source that starts with [x], an x in brackets. Also, I have an author named Eric von Hippel, with a von in the last name. In the zotero software, the [x] entry is put between w and y, and von Hippel is put between u and w, as is correct. My style, however, considers the [ only and puts the entry at the very beginning, while he considers von Hippel to start with H and sorts it accordingly.
I believe the problem to be in this code bit:
<macro name="author">
<names variable="author">
<name name-as-sort-order="all"
sort-separator=", "
initialize-with=". "
delimiter=", "
delimiter-precedes-last="always"
and="text" />
</names>
</macro>
as the bibliography is sorted by the macro sort order, which has author as first condition.
Can anyone help me fix this?
Thanks!
I am having trouble with the author sorting in my current zotero style. I have one source that starts with [x], an x in brackets. Also, I have an author named Eric von Hippel, with a von in the last name. In the zotero software, the [x] entry is put between w and y, and von Hippel is put between u and w, as is correct. My style, however, considers the [ only and puts the entry at the very beginning, while he considers von Hippel to start with H and sorts it accordingly.
I believe the problem to be in this code bit:
<macro name="author">
<names variable="author">
<name name-as-sort-order="all"
sort-separator=", "
initialize-with=". "
delimiter=", "
delimiter-precedes-last="always"
and="text" />
</names>
</macro>
as the bibliography is sorted by the macro sort order, which has author as first condition.
Can anyone help me fix this?
Thanks!
This discussion has been closed.
The sort compare functions in Firefox (and Standalone, which runs on the same engine) suffer from various quirks. Two methods of "alphabetical" sorting are available for Unicode text in Firefox. One (localeCompare) is available in all Javascript engines. Ideally, we would just use that for sorting, but it is broken on some implementations (a test page here tells me it fails in Firefox 12.0 under Linux).
The other method of locale-sensitive string compare is to use a Firefox-specific collation method. A year and a half ago, I introduced a workaround in the processor that calls that method when it is available. Unfortunately, it does not work correctly in Firefox running on Windows 7 -- but localeCompare() apparently does work in that environment, as the test page linked above shows.
So we still need workarounds, but the conditions for applying them have shifted a bit. I'll cast a fresh processor release and update plugin, and post again soon.
(In Firefox under Linux, localeCompare() fails, but the collation string compare method ignores punctuation, which is why sorts have been coming out correctly in my environment. It works correctly, full stop, for both Japanese kana and braces/punctuation in the Rhino implementation of Javascript that I use for processor pre-release testing, which is why this wasn't picked up earlier.)
The Zotero UI uses the collation compareString() method, but leading and trailing square braces and quotes (single and double) are specifically cut from titles and creators before the string compare, which is why the sort of your [x] name entry comes out correctly in the UI under both Linux and Windows 7.
It looks like there is some i18n API activity in Javascript development that will eventually clean things up for us. Meanwhile, the citation processor can cope by doing the same thing Zotero does, stripping out punctuation before performing a sort. I'm minded to make the processor strip operation more aggressive, since punctuation should always be ignored in sort comparisions.
Should have something up in a bit, please stand by.
(Edit: For the present, I decided to strip only leading and trailing braces and quotes, as in Zotero proper. Further adjustments can be made if there are further reported problems with sort behavior.)
For your von Hippel sorting issue, the details are in the CSL Specification.
So introducing an explicit sort-order field is IMHO the only way to go in the long term....
Alternative sort fields can be set in multilingual Zotero (MLZ -- screenshot) but they are mainly intended for Asian names written in ideographic scripts. Correct me if I'm wrong, but I think the normal setup will cover the cases you describe without any difficulty.
@Rintze: Only in the processor manual (which needs an update on some other matters). I don't think there is a description on zotero.org.