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
|
#lang at-exp racket/base
|
||||||
(require scribble/manual
|
(require scribble/manual
|
||||||
|
racket/list
|
||||||
scribble/core
|
scribble/core
|
||||||
scribble/decode
|
scribble/decode
|
||||||
scribble/html-properties
|
scribble/html-properties
|
||||||
|
@ -64,24 +65,25 @@
|
||||||
")")))
|
")")))
|
||||||
|
|
||||||
(define (add-cites group bib-entries)
|
(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
|
(make-element
|
||||||
#f
|
#f
|
||||||
(list 'nbsp
|
(append
|
||||||
"("
|
(list 'nbsp "(")
|
||||||
(let loop ([keys bib-entries])
|
(add-between
|
||||||
(if (null? (cdr keys))
|
(for/list ([(k v) groups])
|
||||||
(make-element
|
(make-element
|
||||||
#f
|
#f
|
||||||
(list
|
(list*
|
||||||
(add-cite group (car keys) 'autobib-author #f)
|
(add-cite group (car v) 'autobib-author #f)
|
||||||
" "
|
" "
|
||||||
(add-cite group (car keys) 'autobib-date #t)))
|
(add-between
|
||||||
(make-element
|
(for/list ([b v]) (add-cite group b 'autobib-date #t))
|
||||||
#f
|
", "))))
|
||||||
(list (loop (list (car keys)))
|
"; ")
|
||||||
"; "
|
(list ")"))))
|
||||||
(loop (cdr keys))))))
|
|
||||||
")")))
|
|
||||||
|
|
||||||
(define (extract-bib-key b)
|
(define (extract-bib-key b)
|
||||||
(author-element-names (auto-bib-author b)))
|
(author-element-names (auto-bib-author b)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user