From d97e7afde8bf797f4a88716c607c2798ccc98aa2 Mon Sep 17 00:00:00 2001 From: Zeping Lee Date: Sat, 27 Jul 2024 22:26:47 +0800 Subject: [PATCH] Bib2csl: map shorthand to citation-label --- CHANGELOG.md | 1 + citeproc/citeproc-bibtex-data.lua | 5 +++-- scripts/bib-csl-mapping.md | 2 +- scripts/citeproc-bibtex-data.json | 4 ++-- tests/bibtex/biblatex-examples.json | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41522f31..0b1f354e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix a bug in EDTF parsing. - Bib2csl: Fix a sentence case conversion bug that words after colons are not capitalized. - Bib2csl: The hyphens in `number` fields are correctly escaped when converted to CSL-JSON. +- Bib2csl: Map `shorthand` field to CSL `citation-label` variable. ## [0.5.1] - 2024-07-10 diff --git a/citeproc/citeproc-bibtex-data.lua b/citeproc/citeproc-bibtex-data.lua index 541baccb..3294e785 100644 --- a/citeproc/citeproc-bibtex-data.lua +++ b/citeproc/citeproc-bibtex-data.lua @@ -478,6 +478,7 @@ return { }, legmaterial = { csl = "legislation", + notes = "APA ยง11.6: Legislative materials include federal testimony, hearings, bills, resolutions, reports, and related documents.", source = "apa.dbx", }, letter = { @@ -3424,8 +3425,8 @@ return { type = "literal", }, shorthand = { - csl = nil, - notes = "Not supported.", + csl = "citation-label", + notes = "A special designation to be used by the citation style instead of the usual label.", source = "biblatex", type = "literal", }, diff --git a/scripts/bib-csl-mapping.md b/scripts/bib-csl-mapping.md index 127aaf18..a25c3c76 100644 --- a/scripts/bib-csl-mapping.md +++ b/scripts/bib-csl-mapping.md @@ -162,7 +162,7 @@ Bib(La)TeX | CSL | Notes `series` | `collection-title` | `shortauthor` | - | `shorteditor` | - | -`shorthand` | - | Not supported. +`shorthand` | `citation-label` | A special designation to be used by the citation style instead of the usual label. `shorthandintro` | - | Not supported. `shortjournal` | `container-title-short` | `shortseries` | - | diff --git a/scripts/citeproc-bibtex-data.json b/scripts/citeproc-bibtex-data.json index 3673d271..875a935b 100644 --- a/scripts/citeproc-bibtex-data.json +++ b/scripts/citeproc-bibtex-data.json @@ -2609,8 +2609,8 @@ "type": "literal" }, "shorthand": { - "csl": null, - "notes": "Not supported.", + "csl": "citation-label", + "notes": "A special designation to be used by the citation style instead of the usual label.", "source": "biblatex", "type": "literal" }, diff --git a/tests/bibtex/biblatex-examples.json b/tests/bibtex/biblatex-examples.json index 2cc6a0e0..00d0b8c7 100644 --- a/tests/bibtex/biblatex-examples.json +++ b/tests/bibtex/biblatex-examples.json @@ -1957,6 +1957,7 @@ "given": "Immanuel" } ], + "citation-label": "KpV", "container-author": [ { "family": "Kant", @@ -1990,6 +1991,7 @@ "given": "Immanuel" } ], + "citation-label": "KU", "container-author": [ { "family": "Kant",