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

Citations: non-page locators placed in front of citation #57

Closed Quintus closed 2 years ago

Quintus commented 2 years ago

I seem to have a talent in triggering unusual edge cases -- anyway, forwarded from https://list.orgmode.org/87h7dotzcw.fsf@nicolasgoaziou.fr/T/ by suggestion of Nicolas:


Dear all,

apologies for my frequent e-mails. It’s just that I am evaluating the citations facility for me.

This time it’s about non-page locators. Take the following document:

#+TITLE: Test
#+AUTHOR: testauthor
#+LANGUAGE: de
#+bibliography: /tmp/mwe/mwe.bib
#+cite_export: csl /tmp/mwe/juristische-schulung.csl

Das ist ein Test [cite:@saenger2013gsr § 12 Rn. 488].

juristische-schulung.csl is https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-schulung.csl.

This is mwe.bib:

@Book{saenger2013gsr,
  author       = {Ingo Saenger},
  title        = {Gesellschaftsrecht},
  year      = {2013},
  edition   = {2},
  publisher = {Franz Vahlen},
  location  = {München},
  langid    = {ngerman}}

Note how this work is not cited by page, but instead (which is common among German judicial literature) by section number (§) plus margin number (Rn.). Exporting this e.g. to HTML yields in Footnote 1:

§  Saenger, Gesellschaftsrecht, 2. Aufl. (2013), 12 Rn. 488

That is rather unexpected. It has pulled the § sign in front of the citation. The citation should have looked like this:

Saenger, Gesellschaftsrecht, 2. Aufl. (2013), § 12 Rn. 488

If I replace the citation in the document with

Das ist ein Test [cite:@saenger2013gsr p. 245].

then it produces the expected

Saenger, Gesellschaftsrecht, 2. Aufl. (2013), 245

(the page locator label, "S." in German, is intentionally suppressed by the CSL style, so this is not a bug. However, the § locator has to appear and is not suppressed by the CSL style).

If I export with the default "bare" processor, the citation comes out fine as "(Ingo Saenger, 2013 § 12 Rn. 488)".

I conclude from this that org somehow mistreats the locator if it is not a page number. I used org 9.5 from MELPA and Citeproc.el from commit 34e66583d95a8d80fb5b9f2960f3382ca0e6d3ab.

Is it a bug or (again) my error?

-quintus

andras-simonyi commented 2 years ago

This particular issue (placing locators in front) seems to have been an Org problem and fixed in the Org maint branch so in the absence of objections I'm going to close it soon.

Quintus commented 2 years ago

I'm fine with that.