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

Missing date bug? #28

Closed bdarcus closed 3 years ago

bdarcus commented 3 years ago

I've mentioned this before, but am confirming with the merged version.

Source:

#+language: en
#+cite_export: csl
#+bibliography: test.bib

[cite:@low2001]

#+print_bibliography:

Output:

(Low, n.d.)

Low, Setha M. n.d. “The Edge and the Center: Gated Communities and the
Discourse of Urban Fear.” /American Anthropologist/ 103
(1):45–58. [https://doi.org/10.1525/aa.2001.103.1.45].

[https://doi.org/10.1525/aa.2001.103.1.45]
<https://doi.org/10.1525/aa.2001.103.1.45>

Biblatex file:

@article{low2001,
  author = {Low, Setha M.},
  title = {The Edge and the Center: Gated Communities and the Discourse
    of Urban Fear},
  journal = {American Anthropologist},
  volume = {103},
  number = {1},
  pages = {45-58},
  date = {2001-03-01},
  urldate = {2016-02-18},
  doi = {10.1525/aa.2001.103.1.45},
  issn = {1548-1433},
  langid = {en}
}
andras-simonyi commented 3 years ago

This may not be relevant after alll but the components of the example don't really add up: the bibliographies don't seem to include any item with the key ratto2014.

bdarcus commented 3 years ago

Oops; sorry. Fixed.

andras-simonyi commented 3 years ago

Could you update the output as well?

bdarcus commented 3 years ago

Actually, though this doesn't appear to be the problem, I'm having problems getting the local bib to work, to ensure these all line up.

What's wrong with this?

#+bibliography: test.bib

... or:

#+bibliography: ~/bib/test.bib
andras-simonyi commented 3 years ago

On my system all these ways of specifying the bib file work, and I don't get "n.d."-s in the citations instead of the year.

bdarcus commented 3 years ago

That's so weird.

You would think if I had one output problem it would be more pervasive.

I'll try reinstalling my packages and report back.

andras-simonyi commented 3 years ago

Well the package (citeproc-el) has support for running the whole CSL test suite, this could be a way of getting a more general picture of what is going on.

bdarcus commented 3 years ago

Something is just wrong. I reinstalled everything, and get the same behavior.

Local bibs don't work, and I get the same output, without dates.

How do I run the test suite?

bdarcus commented 3 years ago

Actually, I get it running with my emacs -Q script, which works as expected with local bibs, but produces the same output. I've updated the main post, with the minimal example.

GNU Emacs 28.0.50 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-05-24
andras-simonyi commented 3 years ago

OK, now I understand. citeproc-el currently doesn't have built-in support for biblatex bibliographies, only for BibTeX proper, and ocl-csl uses the BibTeX processing functions to deal with bibliographies with bibtex extension. Concretely, the entry above uses a date field instead of year, which doesn't exist in BibTeX and gets ignored; changing the key to year fixes the rendering. I plan to add biblatex supporting functions soon (see issue #1), but currently this is not a citeproc-el bug -- maybe the documentation of oc-csl should make it explicit and emphasize that a bibtex bibliography means, well, a BibTeX bibliography in the narrow sense, at least for the time being?

bdarcus commented 3 years ago

Sigh ... yeah, you're right. I neglected to test json using the reinstalled minimal example with emacs -Q. THAT does work as expected on my end.

But when I first reported, I was pretty sure I was seeing it with both json and bibltatex.

I'll experiment some more with my main install and json. It's likely there was just some issue on my end. Edit: now works.

I'll close this now. Thanks for your patience.

Yes, #1, including possibly using the parsebib integrated biblatex/json support, would definitely be ideal.

Biblatex and csl-json are basically equivalent (they can both represent my data), but the former is the only option widely supported ATM.

bdarcus commented 3 years ago

Do you know, @andras-simonyi:

If I have the org global bibliography set, should not the local (to the document) bib override that?

andras-simonyi commented 3 years ago

Do you know, @andras-simonyi:

If I have the org global bibliography set, should not the local (to the document) bib override that?

What I'm experiencing (with the CSL exporter) is that the local bibliography items are added to the global ones, which is a bit surprising but not unreasonable IMO.

bdarcus commented 3 years ago

What does citeproc.el do if it has two global input files that are exactly the same, but one is bib, and the other json?

If it defaults to json, that could be a workaround for me until you have better biblatex support.

andras-simonyi commented 3 years ago

What does citeproc.el do if it has two global input files that are exactly the same, but one is bib, and the other json?

If it defaults to json, that could be a workaround for me until you have better biblatex support.

That is org-cite (and citeproc-org) territory -- citeproc-el abstracts away everything about files and deals only with "item-getters" which are basically functions that return item data when called with an identifier. Actually it provides some means to construct these functions from files but org-cite uses its own constructor.

wuqui commented 2 years ago

So biblatex bibliographies are still not supported, right? I also have "n.d." output and I guess that's because I use the date field instead of year in my .bib file.

I'm using org-refs export function for exporting org to html, odt etc.

andras-simonyi commented 2 years ago

biblatex bibliographies are now fully supported by citeproc-el, so date fields should be OK. Could you post the problematic bibliography entry?

wuqui commented 2 years ago

The problem was on my side of things, sorry. There were a couple of new moving parts for me (Zotero and the org-cite ecosystem) that weren't properly working together. In the end, I discovered that by bibliography got corrupted because of a couple of faulty date fields (e.g. forthc. for forthcoming).

Everything works find now and it's awesome! 👍