andras-simonyi / citeproc-el

A CSL 1.0.2 Citation Processor for Emacs.
GNU General Public License v3.0
85 stars 9 forks source link

Fix flipped 'chapter' and 'chapter-number' fields in Biblatex #90

Closed Quintus closed 2 years ago

Quintus commented 2 years ago

citeproc-el has chapter and chapter-number flipped currently; this PR fixes that. Take the following Biblatex file:

@InBook{breidenbach2021indurecht,
    langid = {ngerman},
    year = {2021},
    title = {Industrielle Rechtsdienstleistungen – Standardisierung von Recht auf hohem Niveau},
    author = {Stephan Breidenbach},
    chapter = {2.1},
    pages = {41-50},
    crossref = {breidenbach-glatz2021lt}
}

@Book{breidenbach-glatz2021lt,
    editor = {Stephan Breidenbach and Florian Glatz},
    title = {Rechtshandbuch Legal Tech},
    shorttitle = {Legal Tech-HdB},
    year = {2021},
    edition = {2},
    publisher = {C.H. Beck},
    location = {München},
    langid = {ngerman}
}

Trying to cite breidenbach2021indurecht with a CSL style that accesses

<text variable="chapter-number"/>

will fail, i.e. it will not produce the chapter value (2.1) – in fact, the variable appears to be empty. It looked to me as if the cause is that within citeproc-blt-to-csl-standard-alist the values for chapter and chapter-number are flipped. In that variable, the left-hand side should be Biblatex fields, and the right-hand side should be CSL variable names, but for chapter/chapter-number it is just the other way around. The PR flips the two items around; after that, accessing chapter-number via the aforementioned XML snippet works as expected.

-quintus

andras-simonyi commented 2 years ago

Thanks for catching this -- merged!

Quintus commented 2 years ago

Thanks!