5 Footnotes
| (require scriblib/footnote) | package: scribble-lib |
To produce a numbered note for HTML (which can useful if a CSS specialization changes how “margin notes” are rendered), use define-footnote with #:margin, instead.
The element generated by note uses the style "NoteBox" wrapped around an element using the style "NoteContent". CSS and Latex macros configure rendering for HTML and Latex/PDF to create a margin note or footnote, but those CSS classes or Latex macros can be redefined or overridden to produce a different result.
syntax
(define-footnote footnote-id footnote-part-id)
(define-footnote footnote-id #:margin)
If footnote-part-id is provided, it is bound to a function that generates a section to display the registered footnotes in HTML. The section generated by footnote-part-id will not show a title or appear in a table of contents; it will look like a footnote area. If #:margin is supplied instead, then each footnote is rendered as an immediate margin note, and no separate footnote section is needed.
Using footnote-id within the argument to a footnote-id will not always work, but it can work in #:margin mode for HTML output.
#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.
The elements and parts generated by footnote-id and footnote-part-id use the following style names, which can be redefined as CSS classes or Latex macros to adjust the result:
"Footnote": Style for the result of footnote-id, which is mapped to \footnote for Latex.
"FootnoteRef": Wrapped around the reference to a footnote that is rendered by footnote-part-id or as a margin note. For Latex, this name is mapped to a macro that returns nothing, leaving the reference managment to \footnote.
"FootnoteTarget": Wrapped around the footnote that is rendered by footnote-part-id or as a margin note. For Latex, this name is mapped to a macro that returns nothing, leaving the reference managment to \footnote.
"FootnoteContent": For Latex, wrapped around the content of a footnote as rendered by footnote-part-id.
"FootnoteMarginContent": Wrapped around the content of a footnote as rendered as a margin note. By default, CSS styling for this name floats the note into the right margin.
"FootnoteBlock": Wrapped around the output of footnote-part-id.
"FootnoteBlockContent": Also wrapped around the output of footnote-part-id, inside the "FootnoteBlock" wrapper.