-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect formatting of collapsed in-text citations when using collapse
and after-collapse-delimiter
attribute in CSL
#154
Comments
This is indeed a bug, thank you for spotting! A PR would be most appreciated. |
bluebear94
added a commit
to bluebear94/hayagriva
that referenced
this issue
May 28, 2024
bluebear94
added a commit
to bluebear94/hayagriva
that referenced
this issue
May 28, 2024
1 task
bluebear94
added a commit
to bluebear94/hayagriva
that referenced
this issue
Aug 7, 2024
bluebear94
added a commit
to bluebear94/hayagriva
that referenced
this issue
Aug 7, 2024
PgBiel
pushed a commit
that referenced
this issue
Aug 8, 2024
* Update preset styles * Add failing test for #154 * Fix formatting of collapsed numeric citations * Revert changes to archive * Refactor collapse_items * Replace collapse test with local version * Remove styles/numeric.csl * simplify test * slightly improve collapse code * remove redundant test import * wrap comment at 80 columns
danilasar
pushed a commit
to danilasar/hayagriva
that referenced
this issue
Dec 31, 2024
* Update preset styles * Add failing test for typst#154 * Fix formatting of collapsed numeric citations * Revert changes to archive * Refactor collapse_items * Replace collapse test with local version * Remove styles/numeric.csl * simplify test * slightly improve collapse code * remove redundant test import * wrap comment at 80 columns
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have encountered an issue with the collapsing behavior of consecutive citation numbers in in-text citations when using the
bibliography
function in Typst. Using the citation style"gb-7714-2015-numeric"
, the relevant CSL code for citation rendering is as follows:According to this style, in-text citations should be rendered as superscript numbers enclosed in square brackets, e.g.,
[1]
. If multiple references are cited at the same location, their numbers should be separated by commas, e.g.,[1,3,5]
. If the cited reference numbers are consecutive, they should be collapsed, e.g.,[1-3,5]
. Zotero also renders in-text citations in this manner.However, in Typst, the collapsing behavior does not work as expected. When citing multiple consecutive references at the same location, Typst displays them as
[1,3]
instead of the expected[1-3]
. Similarly, when citing references 1, 2, 3, and 5 at the same location, Typst renders them as[1,3,5]
instead of the expected[1-3,5]
.Through testing, I found that in Typst/hayagriva the
after-collapse-delimiter
attribute in the CSL file controls the delimiter used for collapsing consecutive numbers. Changingafter-collapse-delimiter=","
toafter-collapse-delimiter="-"
results in the expected behavior, displaying[1-3,5]
.However, according to the CSL 1.0.2 documentation - Cite Collapsing, the
after-collapse-delimiter
attribute is described as:Based on the example provided in the documentation, I think this attribute should control the comma (
,
) in[1-3,5]
, not the hyphen (-
). I have tested other numeric citation styles with thecollapse
attribute and observed similar issues.I kindly request guidance on whether this behavior is intended or if there is a potential issue with the collapsing implementation in Typst/hayagriva.
The text was updated successfully, but these errors were encountered: