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!
  • Is the square-brace entry sorted to the top in all styles that sort by author (such as any of Chicago Manual styles), or only in this one style?
  • At least for the ones I've tried so far it's always that way. I tested APA 6th, Harvard and my custom style.
  • The platform may be significant. What is your operating system, which Zotero configuration (FF, Standalone) are you running, and what is its version?
  • I use Windows 7 and have both the FF and the Standalone version installed (3.0.8).
  • Ok. I have a copy of Windows 7 here, I'll do some tests and write a bit later.
  • edited August 14, 2012
    I get the same bad sort of the square brace entry in Windows 7, so it's due to the platform. An installable fix is on the way, but here's the story behind it.

    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.
  • edited August 14, 2012
    A little update as I work through this. In the Windows 7 version of Firefox, the localeCompare() function and the collation string compare method (compareString()) appear to produce the same results. Both seem to work correctly on the Japanese kana used in the test page linked above, but neither ignores punctuation, which is where your sort failure is coming from.

    (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.)
  • edited August 13, 2012
    The brace issue is now fixed in the processor. The update should appear in the next version of Zotero. If you need the fix sooner, you can install this Zotero Processor Gadget plugin; its only effect is to replace the processor in Zotero with a more recent version. The gadget should be removed when you upgrade Zotero.

    For your von Hippel sorting issue, the details are in the CSL Specification.
  • Thanks a lot for the quick help!
  • While having CSLĀ rules for name sort order is great, it won't satisfy everyone. In some countries, family name prefixes (notably "von") are considered part of the family name, in some they are ignored in sorting. As an example, a Swiss "Von Lanthen" would be sorted under "v" while my Norwegian boss "von Krogh" wants to be sorted under "K", even in the same bibliography.

    So introducing an explicit sort-order field is IMHO the only way to go in the long term....
  • edited August 14, 2012
    Assuming data entry as "Von Lanthen | John" for a non-dropping particle and "Krogh | John von" for a dropping particle, how would the rules fail?

    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.
  • @fbennett, is the parsing behavior of particles described anywhere? (I don't think it belongs in the CSL spec, since that assumes structured data)
  • @fbennett: Your second link seems to be misdirected.
  • edited August 14, 2012
    @ajlyon: Oops! Fixed now.

    @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.
  • (This is mostly a single-issue troubleshooting thread, it can be closed now.)
This discussion has been closed.