@@ -34,41 +34,6 @@ MakeAuthorYear <- function(docstyle = "text"){
3434 sub(" ([^.?!])$" , " \\ dQuote{\\ 1.}" , string , useBytes = TRUE )
3535 }
3636
37- sortKeysLA <- function (bib , yrs ){
38- result <- character (length(bib ))
39- for (i in seq_along(bib )) {
40- res <- bib [[i ]]$ shorthand
41- if (! length(res )){
42- res <- bib [[i ]]$ label
43- if (! length(res ))
44- res <- ProcessNamesLA(bib [[i ]]$ shortauthor )
45- if (! length(res ))
46- res <- ProcessNamesLA(bib [[i ]]$ shorteditor )
47- if (! length(res ))
48- res <- ProcessNamesLA(bib [[i ]]$ author )
49- if (! length(res ))
50- res <- ProcessNamesLA(bib [[i ]]$ editor )
51- if (! length(res ))
52- res <- ProcessNamesLA(bib [[i ]]$ translator )
53- res <- paste0(res , substr(yrs [i ], 3 , 4 ))
54- }
55- result [i ] <- res
56- }
57- result
58- }
59-
60- ProcessNamesLA <- function (nam ){
61- if (length(nam )){
62- if (! inherits(nam , ' person' ))
63- nam <- ArrangeAuthors(nam )
64- nam <- nam $ family
65- res <- substr(nam , start = 1L , stop = 1L )
66- switch (as.character(length(res )), ' 0' = NULL , ' 1' = substr(nam , 1 , 3 ),
67- ' 2' = paste0(res [seq_len(2 )], collapse = ' ' ),
68- paste0(res [seq_len(3 )], collapse = ' ' ))
69- }
70- }
71-
7237 GetLastNames <- function (bib ){
7338 result <- character (length(bib ))
7439 for (i in seq_along(bib )) {
0 commit comments