typst / hayagriva

Rusty bibliography management.
Apache License 2.0
314 stars 47 forks source link

pages field too strict #103

Closed mpmdean closed 8 months ago

mpmdean commented 9 months ago

Description

The pages entry in articles is too strict. If, as is common for modern articles, the pages entry is a single value, typst ignores it where regular bibtex would simply print it.

main.typ is

If I cite a paper such as  @Shen2023electronic where the pages is a single value, the pages entry is ignored.

Note that modern articles are often specified with a single page number. e.g.
https://journals.aps.org/prx/abstract/10.1103/PhysRevX.13.011021

#bibliography("refs.bib",
style: "american-physics-society")

ref.bib is

@article{Shen2023electronic,
  title = {Electronic Character of Charge Order in Square-Planar Low-Valence Nickelates},
  author = {Shen, Y. and Sears, J. and Fabbris, G. and Li, J. and Pelliciari, J. and Mitrano, M. and He, W. and Zhang, Junjie and Mitchell, J. F. and Bisogni, V. and Norman, M. R. and Johnston, S. and Dean, M. P. M.},
  journal = {Phys. Rev. X},
  volume = {13},
  issue = {1},
  pages = {011021},
  numpages = {9},
  year = {2023},
  month = {Feb},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevX.13.011021},
  url = {https://link.aps.org/doi/10.1103/PhysRevX.13.011021}
}

}

Screenshot 2023-12-12 at 9 57 46 PM

Operating system

Typst version

Thanks for all the great work on Typst and hayagriva!

DerDrodt commented 9 months ago

I fixed the issue in #104. The pages entry is actually not too strict. The problem was that your style doesn't use the page variable but page-first, where a range was expected by hayagriva.

Something else you might want to look at: In your bibliography, the issue is missing. That's because your style expects the issue to be in the number variable (which is not ideal). Maybe fix that yourself or contact the maintainers of the style. As far as I can see, hayagriva behaves correctly in this case.

mpmdean commented 9 months ago

Thanks @DerDrodt !