added author+date-square-bracket-style
This commit is contained in:
parent
0931c3577a
commit
01b279d5ba
|
@ -144,10 +144,16 @@ optionally given @racket[render-date-expr] functions.
|
||||||
|
|
||||||
@deftogether[(
|
@deftogether[(
|
||||||
@defthing[author+date-style any/c]
|
@defthing[author+date-style any/c]
|
||||||
|
@defthing[author+date-square-bracket-style any/c]
|
||||||
@defthing[number-style any/c]
|
@defthing[number-style any/c]
|
||||||
)]{
|
)]{
|
||||||
|
|
||||||
Styles for use with @racket[define-cite].}
|
Styles for use with @racket[define-cite].
|
||||||
|
|
||||||
|
The @racket[author+date-square-bracket-style] definition is the same
|
||||||
|
as @racket[author+date-style], except that references to citations
|
||||||
|
are enclosed in @litchar["[]"] instead of @litchar["()"].
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(bib? [v any/c]) boolean?]{
|
@defproc[(bib? [v any/c]) boolean?]{
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
racket/contract)
|
racket/contract)
|
||||||
|
|
||||||
(provide define-cite
|
(provide define-cite
|
||||||
author+date-style number-style
|
author+date-style author+date-square-bracket-style number-style
|
||||||
make-bib in-bib (rename-out [auto-bib? bib?])
|
make-bib in-bib (rename-out [auto-bib? bib?])
|
||||||
author-name org-author-name
|
author-name org-author-name
|
||||||
(contract-out
|
(contract-out
|
||||||
|
@ -195,8 +195,7 @@
|
||||||
(error 'default-disambiguation "Citations too ambiguous for default disambiguation scheme."))
|
(error 'default-disambiguation "Citations too ambiguous for default disambiguation scheme."))
|
||||||
(make-element #f (list (format "~a" (integer->char (+ 97 n))))))
|
(make-element #f (list (format "~a" (integer->char (+ 97 n))))))
|
||||||
|
|
||||||
(define author+date-style
|
(define author+date-style%
|
||||||
(new
|
|
||||||
(class object%
|
(class object%
|
||||||
(define/public (bibliography-table-style) bib-single-style)
|
(define/public (bibliography-table-style) bib-single-style)
|
||||||
(define/public (entry-style) bibentry-style)
|
(define/public (entry-style) bibentry-style)
|
||||||
|
@ -209,6 +208,15 @@
|
||||||
(define/public (render-citation date-cite i) date-cite)
|
(define/public (render-citation date-cite i) date-cite)
|
||||||
(define/public (render-author+dates author dates) (list* author " " dates))
|
(define/public (render-author+dates author dates) (list* author " " dates))
|
||||||
(define/public (bibliography-line i e) (list e))
|
(define/public (bibliography-line i e) (list e))
|
||||||
|
(super-new)))
|
||||||
|
|
||||||
|
(define author+date-style (new author+date-style%))
|
||||||
|
|
||||||
|
(define author+date-square-bracket-style
|
||||||
|
(new
|
||||||
|
(class author+date-style%
|
||||||
|
(define/override (get-cite-open) "[")
|
||||||
|
(define/override (get-cite-close) "]")
|
||||||
(super-new))))
|
(super-new))))
|
||||||
|
|
||||||
(define number-style
|
(define number-style
|
||||||
|
|
Loading…
Reference in New Issue
Block a user