Problem with CSL (substitute does not work)

Hello everyone,

a few weeks ago, I completed my first pull request on GitHub for a CSL style (https://github.com/citation-style-language/styles/blob/master/deutsches-archaologisches-institut-romisch-germanische-kommission-author-date.csl). The reviewer had many useful suggestions, which I implemented. Among other things, he wanted me to use “substitute” in my macros instead of “choose,” which I also did.

However, because of this a problem has now arisen: when a book has no author but only an editor, the editor is not displayed in the bibliography. Here is an example:

How it looks now:
Mölders / Wolfram 2014
Schlüsselbegriffe der Prähistorischen Archäologie. Tübinger archäologische Taschenbücher 11 (Münster / New York 2014).

How it should look:
Mölders / Wolfram 2014
D. Mölders / S. Wolfram (Hrsg.), Schlüsselbegriffe der Prähistorischen Archäologie. Tübinger archäologische Taschenbücher 11 (Münster / New York 2014).

I would be very grateful if you could help me fix this error, as the style does not work correctly otherwise. Thanks a lot.

  • That was a misunderstanding during review -- if you need to repeat the same creators, as in your example, you need to use choose rather than substitute. One of the (usual) advantages of substitute is that it prevents e.g. editors to appear twice in a citation -- but that's specifically what you want here

    cc @damnation
  • edited yesterday at 2:18pm
    Thanks a lot for your quick reply!

    Okay, I tried to fix it and manged this by changing my "author-short" macro, using "choose". I am not sure if that is ellegant but it seems to work.


    <macro name="author-short">
    <choose>
    <if variable="author">
    <names variable="author">
    <name form="short" delimiter-precedes-last="always" et-al-min="3" et-al-use-first="1"/>
    </names>
    </if>
    <else>
    <names variable="editor">
    <name form="short" delimiter-precedes-last="always" et-al-min="3" et-al-use-first="1"/>
    </names>
    </else>
    </choose>
    </macro>

  • (you need to put <code></code> tags around code for it to appear here.)
  • Thank you very much for your help and the fix!
Sign In or Register to comment.