From 60b0cd100cf2fb364ff5926215aa7dc2d7879b5e Mon Sep 17 00:00:00 2001 From: Benjamin Greenman Date: Fri, 3 Mar 2017 09:52:12 -0500 Subject: [PATCH] add 'unnumbered' style to footnote parts The function bound to `make-my-notes` by `define-footnote` (as in: ``` (define-footnote my-note make-my-notes) ``` ) now produces a part with the `unnumbered` style. This way, footnote sections can go between any two sections on a page without upsetting the section numbers. --- .../scriblib/scribblings/footnote.scrbl | 31 ++++++++++++++----- scribble-lib/scriblib/footnote.rkt | 2 +- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/scribble-doc/scriblib/scribblings/footnote.scrbl b/scribble-doc/scriblib/scribblings/footnote.scrbl index c8f3f57e..50c5c1b9 100644 --- a/scribble-doc/scriblib/scribblings/footnote.scrbl +++ b/scribble-doc/scriblib/scribblings/footnote.scrbl @@ -14,13 +14,12 @@ Creates a margin note for HTML and a footnote for Latex/PDF output.} @defform[(define-footnote footnote-id footnote-part-id)]{ -Binds @racket[footnote-id] to a form like @racket[note] that generates -a footnote in HTML output as well as Latex/PDF output. To trigger the -HTML output of the footnotes that are registered through -@racket[footnote-id], the function bound to @racket[footnote-part-id] -must be called at a position that corresponds the bottom of the HTML -page. (The generated section will not show a title or appear in a -table of contents; it will look like a footnote area.) +Binds @racket[footnote-id] to a form like @racket[note] that registers a +footnote. +Binds @racket[footnote-part-id] to a function that generates a section to +display the registered footnotes. +(The section generated by @racket[footnote-part-id] will not show a title or +appear in a table of contents; it will look like a footnote area.) Beware that any content passed to @racket[footnote-id] will occur twice in at least an intermediate form of the document, and perhaps @@ -28,6 +27,24 @@ also in the rendered form of the document. Consequently, the content passed to @racket[footnote-id] should not bind link targets or include other one-time declarations.} +Example: +@codeblock|{ + #lang scribble/manual + @require[scriblib/footnote] + @define-footnote[my-note make-my-note] + @title{Months of the Year} + @section{January} + January has 31 days. + + @section{February} + February has 28 days in common years.@my-note{In leap years, + February has 29 days.} + + @make-my-note[] + + @section{March} + March has 30 days. +}| diff --git a/scribble-lib/scriblib/footnote.rkt b/scribble-lib/scriblib/footnote.rkt index 81dda967..a86658b0 100644 --- a/scribble-lib/scriblib/footnote.rkt +++ b/scribble-lib/scriblib/footnote.rkt @@ -71,7 +71,7 @@ #f (list `(part ,(generated-tag))) #f - (make-style #f '(hidden toc-hidden)) + (make-style #f '(unnumbered hidden toc-hidden)) null (list (make-traverse-block