Problem with Editor reference in Bibliography

Hi Folks,

i am working on my own style and stumbled over a problem with the editor reference in the bibliography. I used the havard author-date style to start with.
For testing Reasons i created some fake entrys, one of them is like this: "Tester Klaus (ed.), A testbook (Berlin 2012)", so the Book has no author but an Editor instead.
My citation macros for the author are these:
<!-- Long Author Quote -->
<macro name="author">
<names variable="author">
<name sort-separator=", " initialize-with="."
delimiter-precedes-last="always" delimiter=" – " />
<substitute>
<names variable="editor" />
<text macro="anon" />
</substitute>
</names>
</macro>
<!-- Short Author Quote -->
<macro name="author-short">
<names variable="author" >
<name form="short" delimiter=" – " delimiter-precedes-last="always"
initialize-with=". " et-al-min="3" et-al-use-first="1" />
<substitute>
<names variable="editor" />
<names variable="translator" />
<text macro="anon" />
</substitute>
</names>
</macro>
So citing the book in a footnote makes no problems, the macro "author-short" substituts to editor and everything works just fine. But in my Bibliography i call the macro "author", which basicly does the same as author short, but not in short form. Long story short, in the Bibliography he didn't substituts to editor but to "anon" which is the anonymous call. I am starring on my code know for a couple of hours and couldnt find the error, so i am asking you what is wrong with it?

Regards Nils
  • edited May 15, 2012
    Paste the code of the full style to http://gist.github.com, save it as a Public Gist and post the URL from the address bar back here, and we'll take a look. (Just guessing, but it's likely due to invalid syntax somewhere in the CSL code.)
  • Okay i made a step nearer the solution:

    in my bibliography i wrote this:
    <group delimiter=" " suffix=": " display="right-inline">
    <text macro="author-short" />
    <text macro="year-date" />
    </group>
    <text macro="author" suffix="," />
    <choose>
    <if type="book">
    <!-- here comes the different entry-typs -->

    When i erase the first author-short the second author will do his job. So its seems like i can't call the editor variable in the Bibliography twice, is this so, and why? How do i resolve my short author date quotes then?

    regards again nils
  • Oh, right, okay. When an alternative creator variable is rendered via substitute, it is suppressed through the rest of the citation. That behavior follows the CSL specification.

    To render the editor twice in this case, you will need to construct a condition using choose, if, else-if and else.
  • @fbennet

    Sorry didn't saw your comment:
    here it is:

    my_style
  • edited May 15, 2012
    thank you for your answer fbennet,
    but i am still wondering why it is working this way when i have a author instead of an editor.

    (edit):ahh okay due to the substitution, right? okay i should read more carefully.

    thanks again
Sign In or Register to comment.