zotero / zotero-bits

CSL-related community feedback for Zotero
56 stars 8 forks source link

Citation Label #24

Open rmzelle opened 13 years ago

rmzelle commented 13 years ago

By adding a "Citation Label"/citationLabel field (mapped to citation-label in CSL) to all item types, we should be able to support most label styles. Users will have to add the labels themselves, although here Zotero's forthcoming read/write API might help out: it would be relatively easy to write a label generator.

rmzelle commented 13 years ago

See also

http://forums.zotero.org/discussion/8503/any-way-to-change-bibtex-keys/?Focus=39623#Comment_39623

and

https://www.zotero.org/trac/ticket/763

simonster commented 13 years ago

r+ generally. Maybe we want to automatically generate labels according to some user-specified schema to satisfy the BibTeX folks and everyone else who has been asking for an easy way to get an item identifier from the interface? Probably maps to BIBO as z:citationLabel on user item.

avram commented 13 years ago

Agreed that the generation of labels should be controlled by a hidden preference that provides sprintf format strings, like we have now within BibTeX.js and for file renaming.

Complex label styles will need a support utility or careful curation, but can we do initialisms using sprintf alone?

I'd also like to add the option of inserting the item key into the label, so that people can more easily pull that out of the data as well.

bdarcus commented 13 years ago

I'd also like to add the option of inserting the item key into the label, so that people can more easily pull that out of the data as well.

This sounds a little odd of a solution. We have an opaque database id for machines (which cannot change), and then a natural language key for machines and humans (but which can change) to achieve the same thing: uniquely identify an item within the scope of a library. And now we'd have one field which can represent either?

I'd prefer another method to expose the machine key if necessary.

On the configurable generation, I was recently playing with a function in ruby, with I think a clever way to generate a portion of a title as a disambiguator (is that a word?):

https://gist.github.com/886834

But to Avram's point, main thing is to be able to:

  1. downcase strings
  2. disambiguate same author/year items
simifilm commented 11 years ago

Any chance this gets implemented?

adam3smith commented 11 years ago

If I understand correctly, this is all tied up in the revamp of Zotero fields, which in turn is tied to rewriting syncing to ensure compatibility between clients etc. As per Simon above this is generally supported by devs and that was still the case when I talked to him a couple of months ago, but it may unfortunately take a bit of time still.

retorquere commented 9 years ago

Is any news available on a possible ETA for that revamp?

adam3smith commented 9 years ago

"later this year" has been what Dan is saying and recent activity on github suggests things are pretty far advanced.

bwiernik commented 4 years ago

Hmm, note that there are two things being described as a "citation label".

The original post referred to citation-label--a variable that should actually appear in text for label/trigraph styles (e.g., "SmJo1965"). There is a discussion for providing a syntax for automatically generating labels here.

In all of the replies, that variable is usually described as a "citation key" or "citekey". That is analogous to the id variable in CSL-JSON and indicates a placeholder used while writing in plain text systems like BibTeX or Markdown, which is eventually replaced with formatted citations.

dstillman commented 3 years ago

So do we want citationKey (for BibTeX/etc.) and citationLabel (for label styles) for all types, or can we just have a citationKey field that also gets used for label styles? (People are going to be confused by the difference.)

retorquere commented 3 years ago

I don't know what citation-label does in CSL, but if there's a strong overlap, I could switch to citationLabel with citationKey as an alias. Bibtex users will be more used to citation key though, and semantically, in bibtex, it is a key (it uniquely identifies an item) rather than a label (which describes one of potentially multiple characteristics of an item, and can be shared between items).

adam3smith commented 3 years ago

My view is the field should just be key. Label formats actually vary by citation style, so ideally would be configurable algorithmically, but they are also fairly rare.

retorquere commented 3 years ago

WRT algorithmic generation, would appreciate being part of the dialogue, I'd prefer to align BBTs pattern format as close as possible (even if only by adding a formatter function that will yield a style-bound key generated by the csl processor - people are going to want them)

bwiernik commented 3 years ago

CSL 1.1 will include style syntax for specifying a label. citation-label will be generated by the processor and should not have an item field in Zotero.

citation-key ala BibTeX should be specified as part of the item. This is mostly to facilitate use with BibTeX/pandoc systems to be a human-readable variable that can be called in lieu of the machine-readable id