commit a13f1ea81d112b5d352aeccf4f6222b979af5f4e
parent f07b92ff0d14432ce03482dc4a339d0da691a624
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Tue, 20 Jul 2010 14:02:50 -0600
fix use of the second argument to in-bib
original commit: 6ffa068e1e5f03e9bb1cf7500a97294858f89a71
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/collects/scriblib/autobib.rkt b/collects/scriblib/autobib.rkt
@@ -30,13 +30,16 @@
(define-struct (author-element element) (names cite))
(define-struct (other-author-element author-element) ())
-(define (add-cite group bib-entry which)
+(define (add-cite group bib-entry which with-specific?)
(hash-set! (bib-group-ht group) bib-entry #t)
(make-delayed-element
(lambda (renderer part ri)
(let ([s (resolve-get part ri `(,which ,(auto-bib-key bib-entry)))])
(list (make-link-element #f
- (list (or s "???") (auto-bib-specific bib-entry))
+ (list (or s "???")
+ (if with-specific?
+ (auto-bib-specific bib-entry)
+ ""))
`(autobib ,(auto-bib-key bib-entry))))))
(lambda () "(???)")
(lambda () "(???)")))
@@ -47,12 +50,12 @@
(error 'citet "citet must be used with identical authors, given ~a" (map auto-bib-author bib-entries)))
(make-element
#f
- (list (add-cite group (car bib-entries) 'autobib-author)
+ (list (add-cite group (car bib-entries) 'autobib-author #f)
'nbsp
"("
(let loop ([keys bib-entries])
(if (null? (cdr keys))
- (add-cite group (car keys) 'autobib-date)
+ (add-cite group (car keys) 'autobib-date #t)
(make-element
#f
(list (loop (list (car keys)))
@@ -70,9 +73,9 @@
(make-element
#f
(list
- (add-cite group (car keys) 'autobib-author)
+ (add-cite group (car keys) 'autobib-author #f)
" "
- (add-cite group (car keys) 'autobib-date)))
+ (add-cite group (car keys) 'autobib-date #t)))
(make-element
#f
(list (loop (list (car keys)))