|(require scriblib/autobib)||package: scribble-lib|
This library provides support for bibliography management in a Scribble document. The define-cite form is used to bind procedures that create in-line citations and generate the bibilography in the document.
Individual bibliography entries are created with the make-bib function. See below for an example.
#lang scribble/base @(require scriblib/autobib) @(define-cite ~cite citet generate-bibliography) @(define plt-tr1 (make-bib #:title "Reference: Racket" #:author (authors "Matthew Flatt" "PLT") #:date "2010" #:location (techrpt-location #:institution "PLT Inc." #:number "PLT-TR-2010-1") #:url "http://racket-lang.org/tr1/")) Racket is fun@~cite[plt-tr1]. @(generate-bibliography)
For citations that reference a page number or section, the in-bib function can be used. For example, the following snippet:
Racket has a contract library.@~cite[(in-bib plt-tr1 ", §8")]
includes a citation to section 8 of the Racket reference.
(define-cite ~cite-id citet-id generate-bibliography-id option ...)
option = #:style style-expr | #:disambiguate disambiguator-expr | #:spaces spaces-expr | #:render-date-bib render-date-expr | #:render-date-cite render-date-expr | #:date<? date-compare-expr | #:date=? date-compare-expr
The function bound to ~cite-id produces a citation referring to one or more bibliography entries with a preceding non-breaking space, by default sorting the entries to match the bibliography order. It has the contract
The function bound to citet-id generates an element suitable
for use as a noun—
The function bound to generate-bibliography-id generates the section for the bibliography. It has the contract
The default value for the #:tag argument is "doc-bibliography" and for #:sec-title is "Bibliography".
The optional spaces-expr determines the number of blank lines that appear between citations. The default number of lines is 1.
The optional style-expr determines the way that citations and the bibliography are rendered.Programmer-defined styles may be supported in the future. Currently, two built-in style are provided, and author+date-style is the default.
For author+date-style, if two citations’ references would render the same (as judged by equal authors and dates that are considered the same) but are different, the optionally provided function from disambiguator-expr is used to add an extra element after the date; the default disambiguator adds a, b, etc. until z, and anything more ambiguous raises an exception. Date comparison is controlled by date-compare-exprs. Dates in citations and dates in the bibliography may be rendered differently, as specified by the optionally given render-date-expr functions.
title : any/c author : any/c = #f is-book? : any/c = #f location : any/c = #f date : (or/c #f date? exact-nonnegative-integer? string?) = #f url : string? = #f note : any/c = #f
Dates are internally represented as date values, so a date may be given, or a number or string that represent the year.
An element produced by a function like author-name tracks first, last names, and name suffixes separately, so that names can be ordered and rendered correctly. When a string is provided as an author name, the last non-empty sequence of alphabetic characters or - after a space is treated as the author name, and the rest is treated as the first name.
(book-location [ #:edition edition #:publisher publisher]) → element? edition : any/c = #f publisher : any/c = #f
(techrpt-location [ #:institution institution] #:number number) → element? institution : edition = any/c number : any/c
(dissertation-location [ #:institution institution #:degree degree]) → element? institution : edition = any/c degree : any/c = "PhD"
(abbreviate-given-names abbreviate?) → void? abbreviate? : any/c
Defaults to #f.
Added in version 1.5 of package scribble-lib.