Tufte helpers

When the tufte layout is enabled (tufte: true in #bookly.with, see Layout), several customizations adapt the appearance of figures, tables and equations to the Tufte style. Bookly also provides the following functions, based on the marginalia package, to place content in the margins.

Side notes

#note(..note-args)
Argument
<..note-args>arguments

Arguments of the note function of the marginalia package.

Note

Bookly customizes the marginalia note function as follows:

#let note = note.with(
  counter: states.sidenotecounter,
  numbering: (..i) => super(numbering("1", ..i)),
  keep-order: true,
)

Side figures

#notefigure(..notefigure-args)
Argument
<..notefigure-args>arguments

Arguments of the notefigure function of the marginalia package.

Note

Bookly slightly customizes the marginalia notefigure function as follows:

#let notefigure = notefigure.with(keep-order: true)

Side citations

#notecite cites a reference in the text and displays the full reference in the margin.

#notecite(
  key,
  supplement: none,
  dy: 0em,
  alignment: "baseline",
)
Argument
<key>label

Key of the reference to cite.

Argument
<supplement>: nonestring|content

Supplement of the citation (e.g., a page number).

Argument
<dy>: 0emlength

Vertical adjustment of the side citation.

Argument
<alignment>: "baseline"string

Alignment of the side citation. Possible values are:

  • "top": align the top of the note with the reference;
  • "caption-top": align the top of the note with the main text baseline;
  • "bottom": align the bottom of the note with the reference;
  • "baseline" (default): align the baseline of the note with the main text baseline.
Warning
#notecite requires a bibliography in the document. Otherwise, the compilation stops with an error.

Wide blocks

#wideblock extends a block over the margin.

#wideblock(side: auto)[...]
Argument
<side>: autoauto|string

Side over which the block is extended. Possible values are:

  • auto: same as "outer";
  • "outer": outer side of the page;
  • "inner": inner side of the page;
  • "left": left side of the page;
  • "right": right side of the page;
  • "both": both sides of the page.

Example: full-width figure

#wideblock[
  #figure(image("images/figure.png"), caption: [Full width figure])
]
Tip
If the same content must be compiled with and without the tufte layout, use #wide-if-tufte instead of #wideblock. It takes the same arguments, but only creates a wide block when the tufte layout is enabled. Otherwise, it simply returns its content.