Add title-short to disambiguate in bibliography only if necsessary

My citation guidelines request a note-style, which cites a book only by its author and the locator. So far so good – I can manage that in my own CSL file.

When there are two books by the same author, they are to be disambiguated by the title respectively the tittle-short field. That's also not a problem for the inline citations using a conditional.

But for the bibliography the "title-short" field should be only added, when there are two books by the same author.

As an example how it should look like:

only one book by a certain author:

bibliography:
Bock, Dennis, Wiederhohlungs- und Vertiefungskurs Strafrecht Besonderer Teil – Nichtvermögensdelikte, 2. Aufl. Heidelberg, Berlin 2016.

inline citation:
"Bock, S. 52"


two books by a certain author with the title short as an extra field in the bibliography

bibliography:
Bock, Dennis, Wiederholungs- und Vertiefungskurs Strafrecht Besonderer Teil – Nichtvermögensdelikte, 2. Aufl. Heidelberg, Berlin 2016 (zitiert als: Bock, Nichtvermögensdelikte).

Bock, Dennis, Wiederholungs- und Vertiefungskurs Strafrecht Besonderer Teil – Vermögensdelikte, 2. Aufl. Berlin, Heidelberg 2016 (zitiert als: Bock, Vermögensdelikte).

inline citation:
"Bock, Vermögensdelikte, S.52; Bock Nichtvermögensdelikte, S. 66"

The real problem is, that the "zitiert als: " part (translates to: "quoted as") appears always, even when there is only on book by a certain author and I can't get rid of it by any conditional. The only thing working is to leave the "title-short" field blank, which I don't want to do.
I would have to go through my whole library and look for different books by the same author manually and add a short title if I used both of them in the same document, which will be very time consuming.

Is there any way around this?
  • Can you share the CSL file? (If I understand the requirement correctly, it should be possible to control this with a disambiguate="true" conditional.)
  • The CSL File can be found under

    https://pastebin.com/c1SzfM26

    I tried the disambiguate="true" condition, but it doesn't seem to work inside the bibliography.
    For citations it does work to quote a book by its short-title, but this short-title should be printed in the bibliography after the entry as well (but only if there are two books by the same author).
  • Thanks, I'll take a look. That may be an edge case that we hadn't considered.
  • Thanks a lot.
    I'd like to point out, that the problem is not unsolvable in general, but would require to rifle through my Library for each document and add or remove short-titles manually, depending on whether there are two citations of the same author or not.

    If there was a solution or a work-around, I would very much appreciate that!
  • Zotero is meant to save time, so we'll see if we can make those extra steps unnecessary.
  • I have made a change to enable this, but we should step carefully, since there is a small chance that the change will affect the behavior of other styles.

    Here is a test that shows what goes in and what comes out.

    @adamsmith As you can see in the test, the way it works is to trigger disambiguate="true" in the bibliography, on items for which it is triggered in citations. The risk of putting this live would be that some styles in circulation may have been coded on the assumption that disambiguate="true" will have no effect inside cs:bibliography. It seems a useful facility, though, and a use case that could easily come up again. What do you think?
  • Let me think about this. I know that I typically wouldn't use disambiguate tests in a bibliography, so it'll definitely be rare and I see the upside.
  • edited February 17, 2018
    I just checked all of the repository styles that use disambiguate="true", and it looks like this would be safe. Only one (Leidraad voor juridische auteurs (Dutch)) makes use of the conditional inside cs:bibliography. It looks like the author was trying to do something similar to @F.Altermann; but the style uses the conditional only in cs:bibliography, so even after this change, it will never take effect.

    Most of the styles use disambiguate="true" in a very straighforward way (there are about four patterns that have been replicated across various styles), but there was one other interesting case. Environment and Urbanization uses disambiguate="true" twice, on nodes that are immediately adjacent. I think that (against your advice, actually, if I recall) the processor applies disambiguate="true" step-wise, so you might want to move those two nodes under a single condition, for an all-or-nothing effect. (The invocations are both under cs:citation in that style, so it would also not be impacted by the proposed change.)

    Anyway, this seems to be safe as far as the repo styles go. If you feel comfortable with it, I can go ahead and push the button on it.
  • I'm fine with this, but just to clarify this:
    the behavior in the bibliography would depend on this having been _actively triggered_ in the text, right?
    E.g., if you think of a style like MHRA, which uses if disambguate="true" to disambiguate subsequent, short form citations, and I have, e.g. two citations by Smith that _would_ trigger disambiguate in their short form, but they're only cited once (i.e. the short form is never used), disambiguate in the bibliography is false, correct?
    In line with that, this means that it's always false if you just create the bibliography without corresponding in text citations (e.g. via right-click or web API)?
  • Disambiguation is based on the subsequent form, regardless of whether that form of the cite appears in the document or no. So it would kick in in both of those cases.
  • OK, so the bibliography doesn't depend on how items are cited in the document, so the answer to my last question is also that disambiguate would be true for _just_ the bibliography. I think that's better; I was a bit wary of the "shifting" bibliography as I had understood this.
    So please go ahead with this, I don't see any problems.
  • Yay! Missed my calling, should have gone into sales. :)
  • edited February 19, 2018
    It's up now, as citeproc-js tag 1.1.186.

    @F.Altermann If install the Propachi plugin, you should be able to get the effect you desire from the style. The plugin is a temporary hotfix, you should remove it at the next Zotero release, which will likely include the 1.1.186 version of the processor.
  • Thank you very much for all the effort @fbennett and @adamsmith !

    I tried to install the Propachi plugin (running a Debian 64-bit System with the appropriate Zotero Standalone Version 5.0.35.1).When I do it via firefox nothing happens. When I download the plugin and try to install it in a running standalone session, the desired behaviour works like a charm, but when I close the session and restart, Zotero throws an error saying:

    [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIAppShellService.hiddenDOMWindow]" nsresult: "0x80004005 (NS_ERROR_FAILURE)"
    location: "JS frame :: chrome://zotero/content/xpcom/zotero.js :: this.init< :: line 219" data: no]

    until I disable the plugin in the addons menu. Any suggestion what else to do than to wait for the next Zotero release?
  • It works fine here on a restart (in very nearly the same environment, 64-bit Ubuntu). Probably your best bet will be to wait, and to suffer with disable/reenable of the plugin in the meantime. A Zotero release that includes processor version 1.1.86 or above probably isn't far away.
  • I installed the newest Version 1.1.117 and now it works perfectly without crashing! Thank you so much for taking care of that!
  • Yes -- sorry for not posting back. I don't know what I did in that "testing," but another user hit the same bug, and when I tested again, there it was. Thanks for your patience.
Sign In or Register to comment.