From a4251726250a469402264d50373e5376c34b30ce Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau Date: Fri, 2 Jan 2026 20:55:33 -0500 Subject: [PATCH 1/2] autobib: allow bibliography without title. --- .../scriblib/scribblings/autobib.scrbl | 11 ++++++++--- scribble-lib/scriblib/autobib.rkt | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/scribble-doc/scriblib/scribblings/autobib.scrbl b/scribble-doc/scriblib/scribblings/autobib.scrbl index 3f472a53b0..797d9b1e78 100644 --- a/scribble-doc/scriblib/scribblings/autobib.scrbl +++ b/scribble-doc/scriblib/scribblings/autobib.scrbl @@ -11,7 +11,7 @@ This library provides support for bibliography management in a Scribble document. The @racket[define-cite] form is used to bind procedures -that create in-line citations and generate the bibilography in the +that create in-line citations and generate the bibliography in the document. Individual bibliography entries are created with the @racket[make-bib] @@ -91,10 +91,15 @@ or more bibliography entries which have the same authors. It has the contract ] The function bound to @racket[generate-bibliography-id] generates the -section for the bibliography. It has the contract +section for the bibliography, with a title as per the @racket[#:sec-title] argument +(defaults to @racket["Bibliography"]) and a tag as per the @racket[#:tag] argument +(defaults to @racket["doc-bibliography"]). +If the @racket[#:sec-title] argument is @racket[#f] instead a string, +only the content of the bibliography, a table of books, is created, +and not the enclosing section. @racketblock[ -(->* () (#:tag string? #:sec-title string?) part?) +(->* () (#:tag string? #:sec-title (or/c #f string?) part?) ] If provided, the function bound to @racket[cite-author-id] diff --git a/scribble-lib/scriblib/autobib.rkt b/scribble-lib/scriblib/autobib.rkt index 6a0fc6f8b6..8a45614966 100644 --- a/scribble-lib/scriblib/autobib.rkt +++ b/scribble-lib/scriblib/autobib.rkt @@ -366,17 +366,22 @@ (make-paragraph (make-style #f '()) '("")) (make-paragraph (make-style #f '()) '("")))) - (make-part #f - `((part ,tag)) - (list sec-title) - (make-style #f '(unnumbered)) - null - (list (make-table (send style bibliography-table-style) + (define table + (make-table (send style bibliography-table-style) (add-between #:splice? #t disambiguated (for/list ([i (in-range 1 spaces)]) (make-space))))) - null)) + + (if sec-title + (make-part #f + `((part ,tag)) + (list sec-title) + (make-style #f '(unnumbered)) + null + (list table) + null) + table)) (define (bib->entry bib style disambiguation render-date-bib i) (define-values (author date title location url note is-book? doi) From 2863a6ab051083558a6f10c1aa003aba0a602703 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 3 Jan 2026 06:30:04 -0700 Subject: [PATCH 2/2] adjust docs --- scribble-doc/scriblib/scribblings/autobib.scrbl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scribble-doc/scriblib/scribblings/autobib.scrbl b/scribble-doc/scriblib/scribblings/autobib.scrbl index 797d9b1e78..ea8def2425 100644 --- a/scribble-doc/scriblib/scribblings/autobib.scrbl +++ b/scribble-doc/scriblib/scribblings/autobib.scrbl @@ -95,11 +95,12 @@ section for the bibliography, with a title as per the @racket[#:sec-title] argum (defaults to @racket["Bibliography"]) and a tag as per the @racket[#:tag] argument (defaults to @racket["doc-bibliography"]). If the @racket[#:sec-title] argument is @racket[#f] instead a string, -only the content of the bibliography, a table of books, is created, -and not the enclosing section. +only the content of the bibliography is created, as a table, +and not the enclosing section as a part. @racketblock[ -(->* () (#:tag string? #:sec-title (or/c #f string?) part?) +(->* () (#:tag string? #:sec-title (or/c #f string?)) + (or/c part? block?)) ] If provided, the function bound to @racket[cite-author-id] @@ -127,15 +128,12 @@ The functions bound to @racket[cite-author-id] and library is pretty nifty. }| -The default value for the @racket[#:tag] argument is @racket["doc-bibliography"] -and for @racket[#:sec-title] is @racket["Bibliography"]. - The optional @racket[spaces-expr] determines the number of blank lines that appear between citations. The default number of lines is 1. The optional @racket[style-expr] determines the way that citations and the bibliography are rendered.@margin-note*{Programmer-defined styles -may be supported in the future.} Currently, two built-in style are +may be supported in the future.} Currently, two built-in styles are provided, and @racket[author+date-style] is the default. For @racket[author+date-style],