-
-
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
Merged citations aren't sorted in increasing order #115
Comments
The latest version of IEEE reference guide (V 11.29.2023, accessed from https://journals.ieeeauthorcenter.ieee.org/your-role-in-article-production/ieee-editorial-style-manual/) requires all citations written out without compressing. The citations are not sorted as specified in the CSL style. This can be reproduced with Typst v0.9.0 and the following MRE. @ieee.a.1:01 @ieee.b.1:01 @ieee.k.1:01 @ieee.o.1:01
@ieee.b.1:01 @ieee.k.1:01 @ieee.a.1:01 @ieee.o.1:01
#cite(<ieee.b.1:01>) #cite(<ieee.k.1:01>) #cite(<ieee.a.1:01>) #cite(<ieee.o.1:01>)
#bibliography("test.bib", style: "ieee") @book{ieee.a.1:01,
title = {Robot Vision},
author = {Klaus, B. and Horn, P.},
year = {1986},
publisher = {{MIT Press}},
address = {{Cambridge, MA, USA}}
}
@inproceedings{ieee.b.1:01,
title = {Analytical Placement Technique for Sparse Arrays},
booktitle = {32nd {{ESA}} Antenna Workshop},
author = {Caratelli, D. and Vigan{\'o}, M. C. and Toso, G. and Angeletti, P.},
year = {2010},
address = {{Noordwijk, The Netherlands}}
}
@article{ieee.k.1:01,
title = {Induction of Electric Field in Human Bodies Moving near {{MRI}}: {{An}} Efficient {{BEM}} Computational Procedure},
author = {Chiampi, M. M. and Zilberti, L. L.},
year = {2011},
month = oct,
journal = {IEEE Trans. Biomed. Eng.},
volume = {58},
pages = {2787--2793},
doi = {10.1109/TBME.2011.2158315}
}
@phdthesis{ieee.o.1:01,
title = {Narrow-Band Analyzer},
author = {Williams, J. O.},
year = {1993},
type = {Ph.D. dissertation},
address = {{Cambridge, MA, USA}},
school = {Dept. Elect. Eng., Harvard Univ.}
} |
That specific change would not be typst's responsibility though, but on https://github.com/citation-style-language/styles The sorting merged citations I assume is not specific to IEEE. |
Looks like sorting items within a citation by citation number has not been implemented yet. The key code is in csl/sort.rs:
cmp_entries is fed 0's for the citation numbers, rather than collecting them from the items. Item sorting within a citation never appears to happen within BibliographyDriver::finish, nor could it using the current sort function. I imagine sort may need to be adjusted to wire the citation numbers in after they are generated with the citation_number closure. |
We need to defer sorting the citations until the citation numbers are assigned. Fixes typst#115
Description
At least when using the IEEE style, merged citations are not sorted in increasing order, unless that happens to be the first time they are cited. This means one might end up with something ugly like [48], [49], [35], [50] instead of the more compact [35], [48]-[50].
Reproduction URL
No response
Operating system
No response
Typst version
The text was updated successfully, but these errors were encountered: