Appending attributed author's name with custom string

edited April 9, 2024
Friends, I'm a great fan of Zotero, especially happy with the beta that I'm running on macOS, using Word.

Thing is, I'm working with a lot of very old (religious) texts. With these types of sources, authorship is often dubious. In such instances, I'd like to list the supposed author, but yet make clear that authorship has only been attributed and thus isn't certain.

(Btw, I'm using Chicago 17, though with some modifications I already implemented to make working with old texts more convenient.)

A good example would be, e.g., the works of Ignatius. He's an early Christian source and thus often cited, but what works actually are and aren't his is a massive debate that I obviously won't get into here. Nevertheless, it serves as a good example of what I'm trying to achieve.

Example of a work we may assume to have been written by Ignatius:
https://s3.amazonaws.com/zotero.org/images/forums/u13592578/grh5lniz0nnmvlkai8g8.png
Now, an example of a work attributed to him but where the authorship is not certain:
https://s3.amazonaws.com/zotero.org/images/forums/u13592578/bnzi26hszl4h61wqzgji.png
Now, that I would like to do is have the author's name for the second example be appended with a custom text "(attributed)". Ideally, whatever the custom text should be would be pulled from an extra field in Zotero. Currently, I have already provided the following string in the extra fields for any applicable sources: "original-author: attributed" (Chicago doesn't use the original-author field so that doesn't cause me any troubles).

To show you what I mean, this would be the desired outcome:
https://s3.amazonaws.com/zotero.org/images/forums/u13592578/dn21g958rvrzwghg2ja2.png
It's not that I haven't tried myself to get this to work--I have put a lot of time into it already. I also have experience modifying the CSL and have done so several times before. It's just that in this instance I can't seem to make it function properly.

I was really hoping someone here might be able to help out. Maybe point me in the right direction or provide some code for me to copy over.

Some extra info:
• In the short form, I wouldn't require it be shown. I.e., the short note could still just look like this, as it does now:
https://s3.amazonaws.com/zotero.org/images/forums/u13592578/w4ke86f0015p4q4bcl5a.png• I don't have any occurrences of this happening to a work with more than one author, so accounting for that will not be necessary.
• Sometimes, the author name will be a single field (e.g., "Ignatius of Antioch"), sometimes a double field (e.g., "ben Neriah, Baruch"). In that case, we'd want it to look like "ben Neriah, Baruch (attributed)", not "ben Neriah (attributed), Baruch".
• Don't know if this is relevant, but these works often have editors and translators (as with the examples provided). It is, of course, only ever the author's name that's attributed. We don't have to account for any of the other fields.
• For the sorting, it should list it like any other work of the author it's attributed to, not create two author entries for just a single author, one for attributed works, one for reasonably certain works. We just want one entry, but only show the "(attributed)" string for the relevant works.

Hope all this makes any sense...

Would much appreciate some expert help here. Again, I'm not clueless when it comes to modding the CSL, but this is getting a bit too complex for me, unfortunately...

Kind regards, Mark

If it should be of any help, I have hosted the custom CSL I'm currently working with here:
https://pastebin.com/Vvv14AKz
  • The best workaround I can think of is to enter the author into Extra as an author type that you're definitely not going to use (see list here: https://docs.citationstyles.org/en/stable/specification.html#name-variables ), so e.g.
    Narrator: Ignatius of Antioch
    and then handle that creator type with a special "if" in the style.
  • edited April 10, 2024
    Thanks Adam, that's helpful. You mention an IF condition. Would you think a similar thing could be used in the setup I proposed in my initial post? I.e., use the normal author field, but put this in extra: "original-author: attributed", then IF extra should contain any "original-author" value, append it (in parenthesis) after the first author listed (should only ever be one author anyway)?

    I would favor that approach because it would allow me to have all the data structured in the normal way, and I like my database to be nice and tidy. Besides, the cool thing would be I could in theory replace "attributed" with whatever other term may be relevant (maybe "pseudonym" for example?).

    To me it would seem like this type of IF logic should be possible, but I have been struggling in finding exactly where to put it and, yes, to a degree also how to write the exact code required...

    I've been looking some more, and I think the relevant code should be around here somewhere (line 188):
    < macro name="contributors">
    < group delimiter=". ">
    < names variable="author">

    Say that it would be possible to condition this kind of like this (just to give an idea):
    < choose>
    < if variable="original-author" match="any">
    < names variable="author">
    < names variable="original-author" prefix=" (" suffix=")"/>
    < /if>
    < /choose>

    I think that in here, I need to first check if original-author contains any value. if so, the name should be followed with " (original-author value here)". Otherwise it should just display the author's name as usual.

    Hope someone more knowledgeable than me may be willing to advise.
  • edited April 10, 2024
    After some more messing around with the code, I actually got it to work for the short notes:
    https://s3.amazonaws.com/zotero.org/images/forums/u13592578/y8t476qjmf8mzoy9mx8x.png
    For this I'm using the following code (line 214+)
    < macro name="contributors-short">
    < group delimiter=" ">
    < names variable="author">
    < name form="short" and="text" delimiter=", "/>
    < substitute>
    < names variable="editor"/>
    < names variable="translator"/>
    < /substitute>
    < /names>
    < choose>
    < if variable="original-author" match="any">
    < names variable="original-author" prefix=" (" suffix=")"/>
    < /if>
    < /choose>
    < text macro="recipient-short"/>
    < /group>
    < /macro>

    Very happy I kind of got it to work, but I'm still lost when it comes to the bibliography listing (the part that's most important to me)... I've tried putting it int he "contributors" macro, and it does appear, but there will be a period after the author's name first. Ideally it would be right after the name, with the period after the "(attributed)" text.
    https://s3.amazonaws.com/zotero.org/images/forums/u13592578/j2e4sbd9z5dc7whu1l7t.png
  • Sweet, after some more tinkering, I've managed to make it work. :) And doesn't it look neat?
    https://s3.amazonaws.com/zotero.org/images/forums/u13592578/v1rczog6blc4brma0cwc.png

    I gave it some more thought and considered that, if I wanted the text to appear before the period, I'd probably just have to move the if statement up the chain.

    I think this might also be helpful for people wanting to mark pseudonyms or really any other kind of note people might want to attach to an author's name.

    To save others some work, here's what I'm working with for Chicago 17. Customize to your liking.

    Short form (modify macro "contributors-short"):
    <macro name="contributors-short">
    <group delimiter=" ">
    <names variable="author">
    <name form="short" and="text" delimiter=", "/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    </substitute>
    </names>
    <!-- This section is CUSTOMIZED to account for attributed works. -->
    <!-- If applicable, set "original-author" to "attributed" (or any other desired value). -->
    <choose>
    <if variable="author original-author" match="all">
    <names variable="original-author" prefix=" (" suffix=")"/>
    </if>
    </choose>
    <!-- End of CUSTOMIZED section. Original skips this section. -->
    <text macro="recipient-short"/>
    </group>
    </macro>


    Bibliography (modify macro "contributors"):
    <macro name="contributors">
    <!-- This section is CUSTOMIZED to account for attributed works. -->
    <!-- If applicable, set "original-author" to "attributed" (or any other desired value). -->
    <choose>
    <if variable="author original-author" match="all">
    <names variable="author"/>
    <names variable="original-author" prefix=" (" suffix=")"/>
    </if>
    <else>
    <group delimiter=". ">
    <names variable="author">
    <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
    <substitute>
    <text macro="editor"/>
    <text macro="translator"/>
    <choose>
    <if type="article-magazine article-newspaper" match="any">
    <text variable="container-title" font-style="italic"/>
    </if>
    <else-if type="webpage post-weblog" match="any">
    <text variable="container-title"/>
    </else-if>
    </choose>
    </substitute>
    </names>
    <text macro="recipient"/>
    </group>
    </else>
    </choose>
    <!-- End of CUSTOMIZED section. -->
    </macro>
  • great -- I'm glad you got this the way you wanted!
Sign In or Register to comment.