Created
August 24, 2017 14:26
-
-
Save nsommer/8cda705b48c7ba64eada106bcc74bef3 to your computer and use it in GitHub Desktop.
Addition to alphadin.bst that enables overriding of labels by the key attribute of BibTeX entries.
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
FUNCTION {key.label} | |
{ key #20 text.prefix$ } %% Length of 20 chars should be sufficient | |
FUNCTION {calc.label} | |
{ type$ "book" = | |
type$ "booklet" = | |
type$ "inbook" = | |
or or | |
'author.editor.key.label | |
{ type$ "proceedings" = | |
'editor.key.organization.label | |
{ type$ "manual" = | |
'author.key.organization.label | |
'author.key.label | |
if$ | |
} | |
if$ | |
} | |
if$ | |
duplicate$ | |
year field.or.null purify$ #-1 #2 substring$ | |
* | |
'label := | |
key empty$ 'label 'key.label if$ 'label := %% Override automatically generated label with key, if it exists | |
year field.or.null purify$ #-1 #4 substring$ | |
* | |
sortify 'sort.label := | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment