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

citation-label styles not rendering #106

Closed rishubn closed 2 years ago

rishubn commented 2 years ago

When using a CSL style which uses `citation-label, citeproc does not render it (blank output).

You can reproduce it with the CSL style: https://www.zotero.org/styles/din-1505-2-alphanumeric

#+cite_export: csl din1505.csl

Other styles like IEEE.csl also don't render when changing citation-number keys to citation-label

andras-simonyi commented 2 years ago

Hello, thanks for the report. Unfortunately, I cannot reproduce the problem -- in my experiments if the citation label is provided in the bibliographic data (variable citation-label in CSL-JSON or label in biblatex) then it is rendered. Could you provide a minimal working example of the problem with a concrete bibliography?

rishubn commented 2 years ago

Sure. Here is a MWE with org + org-cite using citeproc underneath:

ref.bib

@book{DBLP:books/daglib/0017272,
  author    = {Stefan Mangard and
               Elisabeth Oswald and
               Thomas Popp},
  title     = {Power analysis attacks - revealing the secrets of smart cards},
  publisher = {Springer},
  year      = {2007},
  isbn      = {978-0-387-30857-9},
  timestamp = {Mon, 21 Feb 2011 15:21:51 +0100},
  biburl    = {https://dblp.org/rec/books/daglib/0017272.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
#+title: Hello
#+bibliography: ref.bib
#+cite_export: csl din1505.csl

* Hello world
This is a great book [cite:@DBLP:books/daglib/0017272]

Export to HTML produces:

<div id="outline-container-org7eb8b94" class="outline-2">
<h2 id="org7eb8b94"><span class="section-number-2">1.</span> Hello world</h2>
<div class="outline-text-2" id="text-1">
<p>
This is a great book
</p>
</div>
</div>
</div>
andras-simonyi commented 2 years ago

The item should contain a citation label as the value of the label field, e.g.

label      = {MOP07}

As the CSL website says

While CSL has a “citation-label” variable for this purpose, CSL styles currently can’t define the rules to construct these labels. As a result, the labels have to be externally provided, outside of CSL.

so citeproc-el currently expects this as part of the supplied bibliographic information. I suspect there are tools that can produce the labels automatically, perhaps the "Better BibTeX" Zotero extension is one of them, but I'm not sure as I'm not a user.

rishubn commented 2 years ago

Ah ok, I see. I was missing that. Thanks!

andras-simonyi commented 2 years ago

To be fair, in theory citeproc-el could produce the labels on the fly according to a certain schema, so feel free to submit a feature request if you consider it important for your use case.

bdarcus commented 2 years ago

FWIW, we have tackled this in "1.1":

https://github.com/citation-style-language/schema/pull/331

Still an open question when or how we release that though. We're planning to convene a virtual meetup sometime in July to discuss, and other CSL stuff.