whiskyechobravo / kerko

A web application component that provides a faceted search interface for bibliographies managed with Zotero.
https://whiskyechobravo.github.io/kerko/
GNU General Public License v3.0
302 stars 36 forks source link

citation-label not visible #15

Closed bwakkie closed 6 months ago

bwakkie commented 1 year ago

I was wondering if it would be possible to show all fields available in the overview. I have my own csl file taken from my localhost system but it seams to miss the citation-label part.

This part seams to be not working from my csl file: <text variable="citation-label" text-case="uppercase" strip-periods="true" font-variant="normal" text-decoration="none" vertical-align="baseline" display="indent" prefix="[" suffix="]"/>

I also noticed Kerko uses its own ID code, Is this ID generated by Zotero? If so I might use this in my csl file, I just need to know its propper name.

davidlesieur commented 1 year ago

It is Zotero that processes the CSL file, thus Kerko's citation formatting should be identical to Zotero's. Have you checked the result directly in Zotero? (Perhaps through right-clicking an item, selecting "Create Bibliography from Item", and then selecting your CSL style). If Kerko and Zotero both give the same output, then this is probably not a Kerko issue.

The ID gets generated by Zotero when an item is created. If I recall correctly it has no corresponding CSL variable and thus cannot be included in a CSL-formatted citation. If you are developing a custom CSL style, you might find the following resource useful, https://aurimasv.github.io/z2csl/typeMap.xml (Zotero field ↔ CSL field mappings), if you haven't found it already.

bwakkie commented 1 year ago

I see that the 'Better BibTex for Zotero' addon placed the Citation Key in the 'Extra' field like so: 'Extra Citation Key: MY23KEY' Zotero bibliography export does not place the correct Citation key in its output unfortunately, even with the same csl file I used within Zotero, texstudio or even pandoc. The latter two do it correctly but with the better BibTex json automatic export json file. I would prefer Kerko would take my Citation key as ID and not the standard internal unusable internal key.

davidlesieur commented 1 year ago

Zotero item keys are guaranteed to be unique, and Kerko needs unique keys to address records. Unfortunately, no other Zotero field can provide this guarantee of uniqueness. At best, citation keys could be used by Kerko as alternate ids (which perhaps could even be used in Kerko URLs, but would redirect to the matching item if one is unambiguously found).

Alas, that does not solve your citation issue.

bwakkie commented 1 year ago

Perhaps it does for me as I have set BBT to make the key unique in the whole repository and using them as key and url makes more sense than using an internal key to me. Where would I look for this code change?

davidlesieur commented 6 months ago

You could create custom views to use the citation key to identify items from URLs. But there would be lots of other things to deal with. For instance, you'd have to change all URLs that are generated by Kerko to link to those views and keys.

Using something else than the item key as primary key isn't something that will be supported in Kerko in the foreseeable future.