Supress duplicate author lists.
original commit: 01c8c281f3894f8d559541442cf5e66654f4338e
This commit is contained in:
parent
98426520a8
commit
2af3c0c8b7
|
@ -1,5 +1,6 @@
|
|||
#lang at-exp racket/base
|
||||
(require scribble/manual
|
||||
racket/list
|
||||
scribble/core
|
||||
scribble/decode
|
||||
scribble/html-properties
|
||||
|
@ -64,24 +65,25 @@
|
|||
")")))
|
||||
|
||||
(define (add-cites group bib-entries)
|
||||
(define groups (for/fold ([h (hash)]) ([b (reverse bib-entries)])
|
||||
(hash-update h (author-element-names (auto-bib-author b))
|
||||
(lambda (cur) (cons b cur)) null)))
|
||||
(make-element
|
||||
#f
|
||||
(list 'nbsp
|
||||
"("
|
||||
(let loop ([keys bib-entries])
|
||||
(if (null? (cdr keys))
|
||||
(make-element
|
||||
#f
|
||||
(list
|
||||
(add-cite group (car keys) 'autobib-author #f)
|
||||
" "
|
||||
(add-cite group (car keys) 'autobib-date #t)))
|
||||
(make-element
|
||||
#f
|
||||
(list (loop (list (car keys)))
|
||||
"; "
|
||||
(loop (cdr keys))))))
|
||||
")")))
|
||||
(append
|
||||
(list 'nbsp "(")
|
||||
(add-between
|
||||
(for/list ([(k v) groups])
|
||||
(make-element
|
||||
#f
|
||||
(list*
|
||||
(add-cite group (car v) 'autobib-author #f)
|
||||
" "
|
||||
(add-between
|
||||
(for/list ([b v]) (add-cite group b 'autobib-date #t))
|
||||
", "))))
|
||||
"; ")
|
||||
(list ")"))))
|
||||
|
||||
(define (extract-bib-key b)
|
||||
(author-element-names (auto-bib-author b)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user