scriblib/autobib: fix `in-bib' to not generate a new bib entry
original commit: 50ca70703f1ea1944bce30ba4600ab13696b1cb0
This commit is contained in:
parent
7ebc1ae0e4
commit
6248efa610
|
@ -32,21 +32,23 @@
|
||||||
(define-struct (other-author-element author-element) ())
|
(define-struct (other-author-element author-element) ())
|
||||||
|
|
||||||
(define (add-cite group bib-entry which with-specific?)
|
(define (add-cite group bib-entry which with-specific?)
|
||||||
(hash-set! (bib-group-ht group) bib-entry #t)
|
(let ([key (auto-bib-key bib-entry)])
|
||||||
(make-delayed-element
|
(hash-set! (bib-group-ht group) key bib-entry)
|
||||||
(lambda (renderer part ri)
|
(make-delayed-element
|
||||||
(let ([s (resolve-get part ri `(,which ,(auto-bib-key bib-entry)))])
|
(lambda (renderer part ri)
|
||||||
(list (make-link-element #f
|
(let ([s (resolve-get part ri `(,which ,key))])
|
||||||
(list (or s "???")
|
(list (make-link-element #f
|
||||||
(if with-specific?
|
(list (or s "???")
|
||||||
(auto-bib-specific bib-entry)
|
(if with-specific?
|
||||||
""))
|
(auto-bib-specific bib-entry)
|
||||||
`(autobib ,(auto-bib-key bib-entry))))))
|
""))
|
||||||
(lambda () "(???)")
|
`(autobib ,(auto-bib-key bib-entry))))))
|
||||||
(lambda () "(???)")))
|
(lambda () "(???)")
|
||||||
|
(lambda () "(???)"))))
|
||||||
|
|
||||||
(define (add-inline-cite group bib-entries)
|
(define (add-inline-cite group bib-entries)
|
||||||
(for ([i bib-entries]) (hash-set! (bib-group-ht group) i #t))
|
(for ([i bib-entries])
|
||||||
|
(hash-set! (bib-group-ht group) (auto-bib-key i) i))
|
||||||
(when (and (pair? (cdr bib-entries))
|
(when (and (pair? (cdr bib-entries))
|
||||||
(not (apply equal? (map (compose author-element-names auto-bib-author) bib-entries))))
|
(not (apply equal? (map (compose author-element-names auto-bib-author) bib-entries))))
|
||||||
(error 'citet "citet must be used with identical authors, given ~a"
|
(error 'citet "citet must be used with identical authors, given ~a"
|
||||||
|
@ -103,7 +105,7 @@
|
||||||
(extract-bib-year a) (extract-bib-year b)
|
(extract-bib-year a) (extract-bib-year b)
|
||||||
(< (extract-bib-year a) (extract-bib-year b)))))]
|
(< (extract-bib-year a) (extract-bib-year b)))))]
|
||||||
[bibs (sort (hash-map (bib-group-ht group)
|
[bibs (sort (hash-map (bib-group-ht group)
|
||||||
(lambda (k v) k))
|
(lambda (k v) v))
|
||||||
author/date<?)])
|
author/date<?)])
|
||||||
(make-part
|
(make-part
|
||||||
#f
|
#f
|
||||||
|
|
Loading…
Reference in New Issue
Block a user