5 Footnotes

▼ |  | Scriblib: Extra Scribble Libraries

1 | Examples Using the GUI Toolbox
2 | Figures
3 | Bibliographies
4 | Bib Te X Bibliographies
5 | Footnotes
6 | Conditional Content
7 | Book-Style Indexing

On this page:

note
define-footnote

9.2.0.5
Racket
top contents ← prev up next →

## 5 Footnotes🔗ℹ

(require scriblib/footnote) | package: scribble-lib

> procedure (note pre-content ...) → element?
> pre-content : pre-content?

Creates a margin note for HTML and a footnote for Latex/PDF output.

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)

Binds footnote-id to a form like note that registers a footnote. For Latex/PDF output, this is the same result as using note.

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.

Example:

> #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.

- "FootnoteRefNumber": Wrapped around the footnote number as a reference (inside of "FootnoteRef"), so that the default superscript style for a footnote reference can be changed for HTML output (or potentially for Latex, if "Footnote" is not mapped 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.

- "FootnoteTargetNumber": Wrapped around the footnote number rendered by footnote-part-id or as a margin note, so that the default superscript style within a footnote can be changed for HTML (or potentially for Latex, if "Footnote" is not mapped 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.

top contents ← prev up next →