typst / hayagriva

Rusty bibliography management.
Apache License 2.0
347 stars 54 forks source link

Allow the use of CSL's `number-of-pages` number variable #169

Closed Andrew15-5 closed 1 month ago

Andrew15-5 commented 6 months ago

In BibTeX it looks like there is only the pages field and in CSL there are page and number-of-pages.

When I was testing Hayagriva is Typst with a custom CSL style I noticed that apparently Hayagriva's page-total is mapped to CSL's number-of-pages, but number-of-pages directly in the YAML file is not accessible. I don't see a reason to create a 3rd name for the same thing just to confuse CSL style developers. Why page-total is not named number-of-pages? I used volume until this moment, because I thought that number-of-pages just isn't supported yet. But it is, you just have to use non-CSL-standard page-total.

I want to either be allowed to use both fields (one is described here, and the other is inherited implicitly from CSL standard) that will map to the same CSL field/variable (i.e., aliases), or rename page-total to number-of-pages.

reknih commented 1 month ago

Hayagriva's data model is distinct from CSL because we expect to offer creating citation styles in Typst using it in the future.

@laurmaedje and I feel that CSL contains a few sub-par design choices which we do not want to grandfather into that system.

Andrew15-5 commented 1 month ago

I don't think that number-of-pages is a sub-par design choice. I think that it's more descriptive and slightly easier to understand what it refers to. But I at least expect to see a note about the CSL to Hayagriva field mapping in https://github.com/typst/hayagriva/blob/main/docs/file-format.md. This is so that CSL developers wouldn't fall into the same pitfall I did when started using Hayagriva.

laurmaedje commented 1 month ago

It’s not about the naming page-total vs number-of-pages. It’s that hayagriva is a completely separate data model and it existed before the CSL integration and it will likely survive CSL being the main way to format bibliographies in Typst. Thus, we don’t want to rename things just to match CSL.

That aside, I think it’s good that the term starts with „page“ rather than „number“. In an ordered list, it is easier to find.

I would also like to note that your bold „at least“ comes across as quite entitled.

Andrew15-5 commented 1 month ago

It’s not about the naming page-total vs number-of-pages. It’s that hayagriva is a completely separate data model and it existed before the CSL integration and it will likely survive CSL being the main way to format bibliographies in Typst. Thus, we don’t want to rename things just to match CSL.

I already forgot that CSL was integrated at some point. Yeah, I guess renaming is not the way.

That aside, I think it’s good that the term starts with „page“ rather than „number“. In an ordered list, it is easier to find.

You have a point there.

I would also like to note that your bold „at least“ comes across as quite entitled.

I think it's natural for people to have different expectations. I'm just putting stress at what I expect as a bare minimum solution/fix. I'm not sure what's entitled about that (or what it exactly mean here).

But regardless, what about the mapping? Was it even considered at some point? I think it's a good documentation improvement (from a migration/dev standpoint). I just don't know where else would be a good place to include such mapping notes other than directly in the list of fields defined as tables (so you would add another row to some fields).