commit 546e790ff41ce12e6a2762342dd12bca3738de8e
parent af6cf8d1a6bda3db654fdc3a81542d7ff5e82c92
Author: William J. Bowman <wjb@williamjbowman.com>
Date: Wed, 21 Aug 2013 18:37:56 -0400
* Changed bibtex author parsing to handle missing author field.
* Changed cite in autobib to handle missing author field.
original commit: b30ed6ef03f250fda4abfd6332137b8a35c3e1b6
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pkgs/scribble-pkgs/scribble-lib/scriblib/autobib.rkt b/pkgs/scribble-pkgs/scribble-lib/scriblib/autobib.rkt
@@ -148,7 +148,7 @@
(append
(list 'nbsp (send style get-cite-open))
(add-between
- (for/list ([k (if sort? (sort keys string-ci<?) keys)])
+ (for/list ([k (if sort? (sort keys (lambda (x y) (if (not (and x y)) x (string-ci<? x y)))) keys)])
(let ([v (hash-ref groups k)])
(make-element
#f
diff --git a/pkgs/scribble-pkgs/scribble-lib/scriblib/bibtex.rkt b/pkgs/scribble-pkgs/scribble-lib/scriblib/bibtex.rkt
@@ -214,12 +214,13 @@
(define citet-id (make-citer autobib-citet))))
(define (parse-author as)
- (apply authors
+ (and as
+ (apply authors
(for/list ([a (in-list (regexp-split #rx" *and *" as))])
(match (regexp-split #rx" +" a)
[(list one) (org-author-name one)]
[(list one two) (author-name one two)]
- [(list-rest first rest) (author-name first (apply string-append (add-between rest " ")))]))))
+ [(list-rest first rest) (author-name first (apply string-append (add-between rest " ")))])))))
(define (parse-pages ps)
(match ps
[(regexp #rx"^([0-9]+)\\-+([0-9]+)$" (list _ f l))