Closed phiresky closed 3 years ago
Sure enough, we're just taking the first date variable in the list.
How should it work? Should this always be issued
(and nothing if there is no issued
variable)? Or should it try for issued
and fall back to something else?
In general I'd say it should use the same logic as is used for the year in normal author-year styles.. seems to work "as expected" for those? The accessed date would be wrong there too..
Other than that, I'd say it should maybe be issued
, fall back to submitted
, then either fall back to accessed or directly throw an error / show ??.
it should use the same logic as is used for the year in normal author-year styles
There's no fixed logic for this; it all depends on the CSL style. But in chicago-author-date, it goes issued
-> status
-> no-date
term.
See https://github.com/citation-style-language/schema/issues/295
It looks like CSL is moving to making the citation label generation explicit in styles.
So in the future this will have to be handled differently, but for now I can just change the code to privilege issued
.
it all depends on the CSL style
Ah, didn't know that. And I guess it's not flexible in the "label" style since for some reason no one uses it? Then yeah forcing it to use issued seems like a good idea.
Note that you can explicitly specify a citation-label
variable in your bibliography, to avoid the autogenerated one.
Command:
pandoc -i content.md --citeproc --bibliography bib.json --csl style.csl
Output:
<p><span class="citation" data-cites="ppo">[SWDR21]</span></p>
Expected Output:
<p><span class="citation" data-cites="ppo">[SWDR17]</span></p>
If I remove the "accessed" field completely from the json, the problem goes away.
The related code is probably somewhere here: https://github.com/jgm/citeproc/blob/7cbd847da4b5a95fd28b666c48c6bdc80247cde6/src/Citeproc/Eval.hs#L2549
content.md
bib.json
style.csl