[HELP] multicitation delimiter

Do someone how to do the next thing in the in-text citation:

when there is only one article there is no problem, it is just 1

the problem is that when there is two articles, there should appear something like 2,3 with the delimiter =","
and when there is 3 articles it should be like
1-3

I have searched other style but I have not found any with this characteristics. I have thought to use an "if", but I do not know how to say {if two citation delimiter =","} {else delimiter="-"}
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout delimiter="," vertical-align="sup" prefix="" suffix=" ">
<text variable="citation-number"/>
</layout>
</citation>


(modification from the "Journal of Agricultural and Food Chemistry" style)
  • edited February 24, 2012
    Most numerical styles do that, see e.g. the ACS style
    <citation collapse="citation-number">
    <sort>
    <key variable="citation-number"/>
    </sort>
    <layout delimiter="," vertical-align="sup">
    <text variable="citation-number"/>
    </layout>
    </citation>

    The collapse attribute turns the delimiter into a hyphen for ranges.
  • @adamsmith thank you for your fast response!
    I made a stupid error with the citation test (not with the code), that's why it didn't collapse.

    I've been wasting a lot of time trying to solve the "problem" :(

    Thanks again, "problem" fixed
  • happens to all of us all the time. Remember to make your style available publicly once you're done if it has the potential to be of broader interest:
    https://github.com/citation-style-language/styles/wiki/Submitting-Styles
Sign In or Register to comment.