Sorting and editors
Is it possible to suppress the editors label? I've tried removing the label element from the name block, but that just reverts it to its default form. I see it doesn't appear in my citations, but only in the references, but I can't work out why.
The reason I want to do this is sorting. At present I sort on macro="author", with secondary sorting on macro="year-date". This creates a problem with these:
Pollitt, C. and Bouckaert, G. (2004) Public management and reform: a comparative analysis. 2nd ed. Oxford: Oxford University Press
Pollitt, C. and Bouckaert, G. (eds.) (1995) Quality improvement in European public services: concepts, cases and commentary. London: Sage
I would like to write a special macro just for sorting, let's call it author-sort, so that the term '(eds.)' is ignored in sorting and the earlier work appears first in the list.
The reason I want to do this is sorting. At present I sort on macro="author", with secondary sorting on macro="year-date". This creates a problem with these:
Pollitt, C. and Bouckaert, G. (2004) Public management and reform: a comparative analysis. 2nd ed. Oxford: Oxford University Press
Pollitt, C. and Bouckaert, G. (eds.) (1995) Quality improvement in European public services: concepts, cases and commentary. London: Sage
I would like to write a special macro just for sorting, let's call it author-sort, so that the term '(eds.)' is ignored in sorting and the earlier work appears first in the list.
<label form="short"....
that's what prints the (eds.). Removing it in your search macro should get rid of it.
(On a general note, I wonder if this isn't something the processor should address when using a macro as a sort key - it already disregards the "et al" or "and others")
("Note that all works by the same person (or by the same persons in the same order)—whether that person is editor, author, translator, or compiler—appear together, regardless of the added abbreviation. " 14.67 including an example to that effect)
_If_ a style really requires that, if I see this correctly it would still be possible to write a sort macro
<macro name="sort">
<text macro="author">
<choose>
<if variable="author" match="none">
<names variable="editor"/>
</if>
</choose>
</macro>
that would sort editors of the same name after authors - but I think we can assume this is the exception, no?
So is there a need for me to do this? Sounds like changes to the processor are on their way - how long is it likely to be before these appear in a release?
A supplementary question... you've probably worked out that this is about harvard-university-of-birmingham. At present the 'author-short' macro used for citations starts off with a <names variable="author"> and then brings the editor in as a substitution:
<names variable="author">
<name form="short" and="text" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
<substitute>
<text macro="cite-editor"/>
<text variable="title" />
<names variable="translator"/>
</substitute>
What is the difference between this and <names variable="author editor">? One desirable difference is that in the case I gave in the original question citation collapsing works. But are there other differences that might break things?
It's up to you how you want to handle that. I'd be inclined to just let it be and wait for the Zotero fix, but it's "your" style and I'm happy to accept the pull request now and then another one removing that once the fix is in late November.
"author editor" will list both authors and editors when you have both (think chapter of an edited volume).
http://citationstyles.org/downloads/specification.html#names Substitute will only print editors when you have no authors. I suspect you want the latter.
I thought citation collapsing worked with substitute, too - is that not the case?
(Pollitt and Bouckaert, 1995; Pollitt and Bouckaert, 2004)
The style code is at https://github.com/tipichris/styles/blob/master/harvard-university-of-birmingham.csl
It does actually seem to a problem with my CSL. If I add the following to the citation block collapsing works
<sort>
<key macro="author"/>
<key macro="year-date"/>
</sort>
But for some reason changing the first key to "author-sort" or "author-short" breaks it again. author-sort should be exactly the same as author but without the labels.
This would clarify things concerning this very same issue in citeproc-hs. Thank you.
If so, I think I know what's coming. The CSL Specification does not currently require that labels be removed from names when they are included in a sort key via a macro. Strictly speaking, therefore, citeproc-js does not conform to the CSL specification. The behaviour will remain as it is, however, as it saves unnecessary work for style maintainers.
In answer to your question, though, yes, I did modify the processor in response to this thread. The changeset is here:
https://bitbucket.org/fbennett/citeproc-js/commits/0fe178a573b45d2325e295d314871a57b68ef49b
Now, sorry for not being that skilled in csl: How would such a macro have to look like?
And will citeproc-js’s current behaviour eventually make it into the CSL spec?
In the meantime, however, hints on how to modify one style in particular, chicago-author-date.csl, would be most welcome.
Then, almost all the way down in the style, replace
<sort>
<key macro="contributors"/>
with
<sort>
<key macro="contributors-sort"/>
(See CMoS 16e, 15.19: “Two or more works by the same author in the same year must be differentiated by the addition of *a*, *b*, and so forth (regardless of whether they were authored, edited, compiled, or translated), and are listed alphabetically by title.”)
I had to change
<sort>
<key macro="contributors-sort"/>
<key variable="issued"/>
</sort>
which produces:
Jones, Jim. 2011a. *A Title*. Location: Publisher.
———. 2011b. *C Title*. Location: Publisher.
Jones, Jim, ed. 2011c. *B Title*. Location: Publisher.
Jones, Jim, and Steve Smith. 2011. *D Title*. Location: Publisher.
to
<sort>
<key macro="contributors-sort"/>
<key variable="issued"/>
<key variable="title"/>
</sort>
which produces the correct order:
Jones, Jim. 2011a. *A Title*. Location: Publisher.
Jones, Jim, ed. 2011b. *B Title*. Location: Publisher.
———. 2011c. *C Title*. Location: Publisher.
Jones, Jim, and Steve Smith. 2011. *D Title*. Location: Publisher.
However, as you see, subsequent-author-substitute still does not work quite as expected; it should of course be
Jones, Jim. 2011a. *A Title*. Location: Publisher.
———, ed. 2011b. *B Title*. Location: Publisher.
———. 2011c. *C Title*. Location: Publisher.
Jones, Jim, and Steve Smith. 2011. *D Title*. Location: Publisher.
So, my question to the csl experts: Can this be fixed on the csl side, too?
You could try setting
subsequent-author-substitute-rule="partial-each"
which does work with Zotero. I don't think the specs are clear on what should happen in this case though, so I have no idea what -hs will do.
I feel like there's been some discussion on this before - Rintze, Frank, do you recall anything?
There are a couple wrinkles that make this interesting to implement. One is the need to preserve the label when applying the default "complete-all" substitution rule. In the output queue of citeproc-js (where the substitution takes place), we have something like this:
Names Blob
Name Blob (1)
Name Blob (2)
...
Label Blob
I've now set up to replace "blobs" that represent names, and preserve a label blob that follows them. I've ignored leading label blobs. The code could be made smarter, but I'm assuming that leading labels will not be used on first-position names in a bibliography when subsequent-author-substitute is used.
The other tricky bit is that a name object might call a non-name macro via cs:substitute (typically for a title), and we currently apply the substitute string in this case as well. I've set that up as well, it's passing its tests, we'll see how it goes.
I've made a fresh processor release with these changes. You can try out the new behaviour by installing (or upgrading) the processor patch plugin.
“15.18 The 3-em dash with edited, translated, or compiled works. The 3-em dash replaces the preceding name or names only, not an added ed., trans., comp., or whatever. The chronological order is maintained, regardless of the added abbreviation.
15.19 Reference list entries with same author(s), same year. Two or more works by the same author in the same year must be differentiated by the addition of a, b, and so forth (regardless of whether they were authored, edited, compiled, or translated), and are listed alphabetically by title. Text citations consist of author and year plus letter.”
BTW, “compiler” is missing in CSL, as well as Zotero. Since CMoS refers to this role throughout the manual, alongside editor and translator, it would probably be a good idea to include it future versions of CSL.