[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36252: 26.1; bibtex-generate-autokey does not use use date field
From: |
Patrick M . Niedzielski |
Subject: |
bug#36252: 26.1; bibtex-generate-autokey does not use use date field |
Date: |
Sat, 05 Dec 2020 09:20:52 +0000 |
Lars Ingebrigtsen <larsi@gnus.org> skribis:
Lars Ingebrigtsen <larsi@gnus.org> writes:
This was five weeks ago, and there was no response, so I'm
closing this bug report. If progress can be made here, please
respond to the debbugs mail address, and we'll reopen the bug
report.
I’d like to reopen this bug, and submit the attached patch which I
believe fixes the issue. This patch teaches
‘bibtex-generate-autokey’ to prefer an ISO8601-formatted ‘date’
field when present, and fall back to a ‘year’, and is implemented
using Lars’ ISO8601 parsing functions.
Just some implementation notes: I don’t believe Ryan’s original
patch works as documented when ‘bibtex-autokey-use-crossref’ is
non-nil. In this case, his patch would seem to prefer a
crossref’d entry’s ‘year’ field to a local entry’s ‘date’ field.
More concretely, with the following BibLaTeX,
@misc{doe1995some,
title = {Some work},
author = {John Doe},
year = {1995},
date = {1995-01-01},
}
@misc{,
title = {Another work},
author = {Anon Y. Mous},
date = {1990-03-12},
crossref = {entry1},
}
When generating a key for entry2, the original patch would prefer
using the year 1995 to the year 1990, which is unintuitive. The
attached patch implements a different behavior instead, in which
an entry’s own ‘year/date’ field are prefered to the crossref’d
entry’s ‘year/date’ field. In the above case,
‘bibtex-generate-autokey’ will generate a entry key with the year
1990 rather than 1995.
Additionally, we prefer to use the ‘date’ field when present over
the ‘year’ field. This behavior is probably more correct, since
BibLaTeX deprecated the ‘year’ field in favor of its own ‘date’
field, which only should occur in BibLaTeX-flavor files. Note that
this is a breaking change from the prior behavior, but only when
an entry has incompatible ‘date’ and ‘year’ fields. If a file is
meant to support both BibTeX and BibLaTeX, the ‘date’ and ‘year’
fields should contain the same information.
The attached patch implements the above behavior.
Best,
Patrick
0001-Prefer-date-field-to-year-field-in-BibTex-entry.patch
Description: Text Data
- bug#36252: 26.1; bibtex-generate-autokey does not use use date field,
Patrick M . Niedzielski <=