-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(packages): Biblatex data inheritance and field mapping
Add (a part of) the BibLaTeX data inheritance rules for cross-references. Use BibLaTeX field names, but still support the legacy BibTeX file names. As part of these refactors, allow loading more than one bibliography file.
- Loading branch information
Showing
3 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-- Mappings for aliases and inheritance rules | ||
|
||
-- Partial implementation of the Biber/BibLaTeX data inheritance rules | ||
-- (derived from the biblatex package manual v3.20, appendix A) | ||
-- FIXME: This is not complete | ||
local crossrefmap = { | ||
book = { | ||
inbook = { | ||
author = "author", -- inbook inherits author from book author | ||
bookauthor = "author", -- inbook inherits bookauthor from book author | ||
indexsorttitle = false, -- inbook skips (=does not inherit) indexsorttitle from book | ||
indextitle = false, | ||
shorttitle = false, | ||
sorttitle = false, | ||
subtitle = "booksubtitle", | ||
title = "booktitle", | ||
titleaddon = "booktitleaddon", | ||
}, | ||
}, | ||
periodical = { | ||
article = { | ||
indexsorttitle = false, | ||
indextitle = false, | ||
shorttitle = false, | ||
sorttitle = false, | ||
subtitle = "journalsubtitle", | ||
title = "journaltitle", | ||
titleaddon = "journaltitleaddon", | ||
}, | ||
}, | ||
proceedings = { | ||
inproceedings = { | ||
indexsorttitle = false, | ||
indextitle = false, | ||
shorttitle = false, | ||
sorttitle = false, | ||
subtitle = "booksubtitle", | ||
title = "booktitle", | ||
titleaddon = "booktitleaddon", | ||
}, | ||
}, | ||
} | ||
|
||
-- biblatex field aliases | ||
-- From biblatex package manual v3.20, section 2.2.5 | ||
local fieldmap = { | ||
address = "location", | ||
annote = "annotation", | ||
archiveprefix = "eprinttype", | ||
key = "sortkey", | ||
pdf = "file", | ||
journal = "journaltitle", | ||
primaryclass = "eprintclass", | ||
school = "institution", | ||
} | ||
|
||
return { | ||
crossrefmap = crossrefmap, | ||
fieldmap = fieldmap, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters