Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

add citation-label style syntax #30

Closed
bwiernik opened this issue Apr 24, 2020 · 5 comments
Closed

add citation-label style syntax #30

bwiernik opened this issue Apr 24, 2020 · 5 comments
Labels

Comments

@bwiernik
Copy link
Member

bwiernik commented Apr 24, 2020

Currently, citation-label is either provided in item metadata or generated using a pattern specified by the citation processor. This makes it difficult for users to change label formats for different label CSL styles.

Here is some discussion between @cormacrelf and me on an interface for specifying citation-label formats: https://discourse.citationstyles.org/t/citation-label-formatting/1585/2

citeproc-js provides this format for automatically-generated labels: Aaaa00:AaAa00:AaAA00:AAAA00

@cormacrelf implemented that format into citeproc-rs, generalizing it to any number of authors.

I think this is a good format to build on. The one question is how to specify what variables to use/fallback to to produce the citation-label. Here is what I propose.

A new element cs:citation-label sibling to cs:citation with a required format attribute (we could also use value).

  1. format will look something like this format="Aaaa0:AaAa0:AaAA0:AAAA0"
    • format is a colon-delimited list with the format to use for an item with names input that is length 1, length 2, etc. The last value is for its position or more names (e.g., here for 4+ names).
    • format can be any length
    • A indicates first letter of creator’s family name
    • a indicates subsequent letters of that creator’s family name
    • 0 indicates the output of the date element
    • Other characters are treated literally, Literal A, a, 0 can be given by escaping with \ (e.g., \A)

cs:citation-label can have two children

  1. A <names> element used to provide the input for the Aa parts of the format
    • Can contain a substitute child. Other cs:names children are ignored.
  2. An optional <date> element to provide the input for the 0 parts of the format
    • Output is inserted into the label
    • Can take all of the normal children of cs:date
    • e.g., for two digits, specify <date-part name="year" form="short"/>

If the item data contains a citation-label value, this overrides the automatically-generated value from cs:citation-label.

This approach rests on existing cs:names and cs:date structures while still being flexible for users.

Thoughts?

@denismaier
Copy link
Member

So, what do we do with this one? I think it's beyond dispute that we need something like this. Could this be for 1.1?

@bwiernik
Copy link
Member Author

bwiernik commented Jun 9, 2020

Yes, that sounds good.

@denismaier denismaier added this to the CSL 1.1 milestone Jun 9, 2020
@denismaier denismaier added the 1.1 label Jun 9, 2020
@denismaier denismaier removed this from the CSL 1.1 milestone Jun 11, 2020
@bwiernik
Copy link
Member Author

See previous discussion here: citation-style-language/schema#41

@bwiernik
Copy link
Member Author

@bdarcus Can you give me triage privileges on this repo so I can transfer this to schema?

@bwiernik
Copy link
Member Author

Replaced by citation-style-language/schema#295

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants