|
54 | 54 | #' BibOptions(restore.defaults = TRUE) |
55 | 55 | sort.BibEntry <- function(x, decreasing = FALSE, sorting = BibOptions()$sorting, |
56 | 56 | .bibstyle = BibOptions()$bib.style, ...){ |
| 57 | + sort.fun.env <- GetFormatFunctions(DateFormatter = I) |
57 | 58 | if (is.null(sorting)) |
58 | 59 | sorting <- "nty" |
59 | 60 | if (sorting == 'debug' || .bibstyle == 'draft') |
60 | 61 | return(x[order(names(x))]) |
61 | 62 | if (sorting != "none" || .bibstyle == "alphabetic"){ |
62 | | - aut <- MakeBibLaTeX()$sortKeys(x) |
63 | | - yr <- MakeBibLaTeX()$sortKeysY(x) |
64 | | - ps <- MakeBibLaTeX()$sortKeysPS(x) |
65 | | - ttl <- MakeBibLaTeX()$sortKeysT(x) |
| 63 | + aut <- sort.fun.env$sortKeys(x) |
| 64 | + yr <- sort.fun.env$sortKeysY(x) |
| 65 | + ps <- sort.fun.env$sortKeysPS(x) |
| 66 | + ttl <- sort.fun.env$sortKeysT(x) |
66 | 67 | if (sorting %in% c('nyvt', 'anyvt')) |
67 | | - vol <- MakeBibLaTeX()$sortKeysV(x) |
| 68 | + vol <- sort.fun.env$sortKeysV(x) |
68 | 69 | } |
69 | 70 | if (.bibstyle == 'alphabetic' || sorting == 'anyt' || sorting == 'anyvt') |
70 | | - alabs <- MakeBibLaTeX()$sortKeysLA(x, yr) |
| 71 | + alabs <- sort.fun.env$sortKeysLA(x, yr) |
71 | 72 |
|
72 | 73 | if (sorting != "none"){ |
73 | 74 | ord <- switch(sorting, nyt = order(ps, aut, yr, ttl, decreasing = decreasing), |
@@ -95,14 +96,14 @@ sort.BibEntry <- function(x, decreasing = FALSE, sorting = BibOptions()$sorting, |
95 | 96 | if (hasArg(return.labs) && !length(unlist(x$.index))){ |
96 | 97 | if (.bibstyle %in% c("authoryear", "authortitle")){ |
97 | 98 | if (sorting == "none") |
98 | | - aut <- MakeBibLaTeX()$sortKeys(x) |
| 99 | + aut <- sort.fun.env$sortKeys(x) |
99 | 100 | suppressWarnings({ |
100 | 101 | ind <- nchar(aut) == 0L & !x$bibtype %in% c("XData", "Set") |
101 | 102 | aut[ind] <- x$title[ind] |
102 | 103 | x$.duplicated <- duplicated(aut) |
103 | 104 | }) |
104 | 105 | if (.bibstyle == "authoryear"){ |
105 | | - tmp <- MakeAuthorYear()$GetLastNames(x) |
| 106 | + tmp <- sort.fun.env$GetLastNames(x) |
106 | 107 |
|
107 | 108 | # sortyear could mess things up, so can't reuse yr |
108 | 109 | yr <- sapply(unclass(x), function(dat) |
|
0 commit comments