How to cite with a page number in GB/T 7714—2015 style?

Thanks, both of your replies are helpful! I marked flokl’s as the solution, because Eric’s code generates [1,326–329], which is not exactly desired. (IEEE ≠ GB)

Additionally, Eric mentioned two important points.

  1. #set super(typographic: false) to match the font variants of the citation number and the locator (i.e. page number).

  2. Citing consecutively is problematic. I guess the standard prefers A[1]326, BC[2-3] for A@a[326], BC@b@c. I don’t think it’s possible in CSL…

    A[1]326, BC[2-3]

Therefore, a single CSL might never solve all problems. I end up with the following.

#show cite.where(style: auto): it => {
  if it.supplement != none {
    let (key, ..args) = it.fields()
    cite(it.key, ..args, style: "a-dedicated-minimal.csl")
  } else {
    it
  }
}
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text">
  <info>
    <title>A dedicated minimal style</title>
    <id>https://forum.typst.app/t/how-to-cite-with-a-page-number-in-gb-t-7714-2015-style/1501/4</id>
  </info>
  <citation collapse="citation-number" after-collapse-delimiter=",">
    <sort>
      <key variable="citation-number" />
    </sort>
    <layout vertical-align="sup" delimiter=",">
      <text variable="citation-number" prefix="[" suffix="]" />
      <text variable="locator" />
    </layout>
  </citation>
</style>
2 Likes