'edition' field: Superscript if number, in-line if text?

I'm trying to modify a bibliography style which renders the field 'edition' as a superscript to the year.

However, this field is often populated by values such as "3., vollständig überarb. und erw. Neuausg." which leads to messy bibliography entries. In these cases I'd rather print its content in-line, delimited by commas.

Is there a way to condition the rendering of said field on the type (number or string) and/or length of its respective values?
  • edited 9 days ago
    If I understand correctly, the answer is "yes." CSL has a "numeric" test that can be applied to the edition field:
    <choose>
    <if is-numeric="edition" match="none">
    [print the value inline]
    </if>
    </choose>
    and
    <choose>
    <if is-numeric="edition">
    [print the value as superscript]
    </if>
    </choose>

    I think. Check the CSL specification to be sure.
  • Thank you very much!, it worked.

    For future readers, one minor difference in the code above: '<if is-numeric=...'
  • Thanks back - fixed, for good measure.
  • Like your moniker, by the way.
  • Thanks. Are you a Malkmus aficionado? I borrowed it from one of his songs.
  • No, didn't know of his work or the song. The name just has a nice rhythm to it. Well chosen.
Sign In or Register to comment.