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.
  • edited October 5, 2012
    your author macro has a line that start with
    <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")
  • Yes, it should be -- I think. I can't remember whether there have been demands to sort editors and authors separately.
  • I've never seen that. Checked a couple of books and CMoS
    ("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?
  • That wouldn't be the way to do it, but you're right that it can be done (and better) if the labels are suppressed. (The right way would be to set only the editor on a second sort key, and sort descending on that key.) I have tested code in place that suppresses the label, but I've been on the road for the past 24 hours, and need to get some food and a shower before pushing it out to the repo.
  • ah yes, of course.
  • Thanks Adam - that was what I was looking for. I hadn't realised I'd need to remove label from both the editor and the author macros.

    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?
  • This will be in the next Zotero version, which I suspect will be out November 20th. Unless something goes wrong on fbennett's side (which is highly unlikely) it won't be later than that.
    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
    If multiple variables are selected (separated by single spaces, see example below), each variable is independently rendered in the order specified
    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?
  • I can't remember whether there have been demands to sort editors and authors separately.
    One case maybe: CV?
  • I would like to print a list of my own publications in reverse chronological order (for my academic CV). I would prefer to display them in the Chicago style because I have debugged those. I can easily capture and correctly sort them but the copy-paste re-orders them alphabetically. Is there a style option that I overlooked that accomplishes this?
  • no, you'd need a separate style.
  • "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.
    Thanks. The latter is indeed what I want.
    I thought citation collapsing worked with substitute, too - is that not the case?
    Certainly in the case I gave at the beginning of this thread collapsing doesn't work when using substitute. The author and the editor occurrence of the same names are rendered separately:

    (Pollitt and Bouckaert, 1995; Pollitt and Bouckaert, 2004)
  • I'll need some test data (input plus style code) to reproduce this. If you can export the references as Zotero RDF, paste the code into gist.github.com, save as a public gist and post the URL back here, and also paste your style code in the same way, I can take a look.
  • The references are at https://gist.github.com/3851549

    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.
  • Could someone please confirm that for correct sorting of works by the same person(s), whether editor, author, translator, or compiler, a modification of the processor, not the style files, was deemed necessary, and that it was implemented in this way in Zotero?

    This would clarify things concerning this very same issue in citeproc-hs. Thank you.
  • edited March 7, 2013
    To confirm, is the problem that the label is being included in the sort key?

    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
  • If that is the issue, though, you should be able to address it by adding a sort macro that does the same thing as the author macro, but omits the labels. I am sure the change would be accepted by the repository maintainers.
  • Thank you for the clarification.

    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?
  • I might open a discussion on the xbiblio list to involve all interested parties, but judging from this thread it seems like suppressing the name labels is generally desired, in which case it would make sense to make this the default CSL behavior.
  • yes, I'd much rather change the specs than all the styles here. I believe it's almost universally required to sort regardless of author type (i.e. without label), so if we don't change the specs we'd have to have separate author sort macros for 600+ styles.
  • @nickbart: If you paste the current macro(s) here enclosed in <code></code&gt tags (or point us at the style), we can take a look and make suggestions. (It looks like both labels and the "and" attribute may need to be removed to get the normally expected sort behaviour, if the current specification is followed strictly.)
  • Thank you all. Based on your input, I’ll try to convince the citeproc-hs author to implement the “new” behaviour in anticipation of a likely csl spec update.

    In the meantime, however, hints on how to modify one style in particular, chicago-author-date.csl, would be most welcome.
  • create a new macro - contributors-sort - which should be an exact copy of the macro contributors with the line starting with <label deleted.
    Then, almost all the way down in the style, replace
    <sort>
    <key macro="contributors"/>

    with
    <sort>
    <key macro="contributors-sort"/>
  • edited March 8, 2013
    Thank you, this fixed the sorting issue with pandoc/citeproc-hs—well, almost, since I found that chicago-author-date.csl did not sort by titles.

    (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?
  • that doesn't work in Zotero either.
    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?
  • I feel like there's been some discussion on this before - Rintze, Frank, do you recall anything?
    Is the question on whether or not to extend author-substitution to identical names from different name variables? If name labels are discarded for sorting, I think substitution should work here as well (especially if the "editor" name variable is substituted via cs:substitute).
  • Is the question on whether or not to extend author-substitution to identical names from different name variables?
    yes. I think I agree with substituting authors regardless of label, but maybe we're overlooking something?
  • edited March 9, 2013
    It does sound right that we should be indifferent to the author's role when applying the substitute string.

    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.
  • edited March 13, 2013
    Is the question on whether or not to extend author-substitution to identical names from different name variables?
    At least CMoS 16e is pretty clear about this issue:

    “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.

  • 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.
    The latest processor (provided by the patch plugin) now does this.
Sign In or Register to comment.