diff --git a/scribble-doc/scriblib/scribblings/autobib.scrbl b/scribble-doc/scriblib/scribblings/autobib.scrbl index d9f6f5c4..b63076cc 100644 --- a/scribble-doc/scriblib/scribblings/autobib.scrbl +++ b/scribble-doc/scriblib/scribblings/autobib.scrbl @@ -236,6 +236,17 @@ Combines elements to generate an element that is suitable for describing a dissertation.} +@defproc[(book-chapter-location [title any/c] + [#:pages pages (or (list/c any/c any/c) #f) #f] + [#:section section any/c #f] + [#:volume volume any/c #f] + [#:publisher publisher any/c #f]) + element?]{ + +Combines elements to generate an element that is suitable for +describing a paper's location within a chapter or part of a book.} + + @defproc[(author-name [first any/c] [last any/c] [#:suffix suffix any/c #f]) diff --git a/scribble-lib/scriblib/autobib.rkt b/scribble-lib/scriblib/autobib.rkt index dc812f3b..8fa4c44b 100644 --- a/scribble-lib/scriblib/autobib.rkt +++ b/scribble-lib/scriblib/autobib.rkt @@ -29,6 +29,8 @@ (-> #:institution any/c #:number any/c element?)] [dissertation-location (->* [#:institution any/c] [#:degree any/c] element?)]) + [book-chapter-location + (->* [any/c] [#:pages (or/c (list/c any/c any/c) #f) #:section any/c #:volume any/c #:publisher any/c] element?)] other-authors editor abbreviate-given-names) @@ -563,6 +565,27 @@ #:degree [degree "PhD"]) @elem{@to-string[degree] dissertation, @to-string[org]}) +(define (book-chapter-location + location + #:pages [pages #f] + #:series [series #f] + #:volume [volume #f] + #:publisher [publisher #f]) + (let* ([s @elem{In @italic{@elem{@|location|}}}] + [s (if series + @elem{@|s|, @(format "~a" series)} + s)] + [s (if volume + @elem{@|s| volume @(format "~a" volume)} + s)] + [s (if pages + @elem{@|s|, pp. @(to-string (car pages))--@(to-string (cadr pages))} + s)] + [s (if publisher + @elem{@|s| @(format "~a" publisher)} + s)]) + s)) + ;; ---------------------------------------- (define (author-name first last #:suffix [suffix #f])