sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.61k stars 97 forks source link

Month, day and date formatting in bibliography references #2027

Open Omikhleia opened 1 month ago

Omikhleia commented 1 month ago

As of today, the bibtex package does it wrong

  1. The Chicago style implementation ignores the day although it shall be used when available for some formats (typically, journal articles)
  2. The month is output as set in the .bib file, but it should be replaced by a true month name (abbreviated or not depending on the citation style, Chicago if I read it correctly recommends the full month name). The problem is, BibTeX has a loose definition for month, which can be a number (e.g. "3") or a full string (e.g. "March") or a "standard" 3-letter code (= "mar"); the recommendation is to use the latter.[^1]

Moreover, the date shall likely be formatted according to language-specific rules.[^2]

Example: @article{..., day= {14}, month = {apr}, year = {2024} ...}

[^1]: Some references for month in BibTeX format:

[^2]: Note that babel for LaTeX has tables of month names and date rules for all supported languages... But it seems that language support for bibliographies comes with babelbib which also has month name translations. I'm a bit lost here, regarding how it works in the LaTeX world...

[^3]: At least according to some online citation tools I tried. I haven't looked deeply into CSL examples...

Omikhleia commented 3 weeks ago

Moreover, at syntax level, we also need to support the more modern (biblatex) extended date field (noted in passing when working on biblatex aliases, this one is of a slightly different nature). I've written an ISO 8601-2 EDTF parser in Lpeg, so I will contribute it.

Omikhleia commented 3 weeks ago

I've written an ISO 8601-2 EDTF parser in Lpeg, so I will contribute it.

I've added the ISO date-time parser, support for the date field, and slightly better date formatting in #2071 -- But there's more things needed to fully address the topic. Having to do our own "hand-made" implementation of the Chicago style, and to add a huge number of localization strings in our fluent files is cumbersome.

Omikhleia mutters: CSL would be the way, and is not that hard, compared to DocBook, USX or TEI... :smile_cat: