Italicize a prefix

Hello,

I'm tweaking a CSL style for zotero more or less successfully, but there's one thing that I can't get to work. I need the prefix "in" when citing a chapter from an edited book to be in italics. In the style I'm changing, this is the only part where "in" occurs:

<else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
<group>
<group suffix=", ">
<text variable="title" text-case="capitalize-first" quotes="true"/>
</group>
<text macro="editor" prefix=" in " suffix=", "/>
<text variable="container-title" text-case="capitalize-first" font-style="italic"/>
</group>
</else-if>

I tried adding font style="italic" somewhere in there but it doesn't work (I don't know anything about CSL).

Thank you for your help.
  • You can't style strings set in the affix attributes. You can add it as a localized term, like this:
    <text term="in"/>
  • so in this case that'd be something like
    <group delimiter=" ">
    <text term="in" font-style="italic"/>
    <text macro="editor"/>
    </group>
  • I had trouble at first placing your bit of code but I managed to make it work in the end. Thank you both!

    For future reference, this is what I ended up with:

    <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
    <group>
    <group suffix=", ">
    <text variable="title" text-case="capitalize-first" quotes="true"/>
    </group>
    <group delimiter=" ">
    <text term="in" font-style="italic"/>
    <text macro="editor" suffix=", "/>
    </group>
    <text suffix=", "/>
    <text variable="container-title" text-case="capitalize-first" font-style="italic"/>
    </group>
    </else-if>

    It's probably not kosher but it works.
  • That's definitely the right way to do it.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.