Reference
The classes, attributes, and wrapped: keys that control wrapping. Each name links to the page that gives its full rules.
Classes and attributes
These go on a figure, an image, or a table float. On a code cell, the class goes in #| classes:. A code cell figure’s width goes in #| out-width: and its gap in #| wrap-gap: (see Get started). A code cell table’s width goes in #| width: and its gap in #| wrap-gap: (see Get started). The extension’s tests use knitr cells for these options. “All four formats” means HTML, PDF through LaTeX, PDF through Typst, and Word. HTML includes revealjs slides and dashboards. A table float wraps in all four formats, except a table float that holds raw LaTeX in PDF through LaTeX, as R packages such as gt write it (see Get started).
| Name | Kind | Values | Default | Works in |
|---|---|---|---|---|
.wrap-right |
class | none | none | All four formats |
.wrap-left |
class | none | none | All four formats |
.wrap-clear |
class on an empty div | none | none | All four formats |
width |
attribute | A percent of the text column, or a length such as 3in, 250px, or 20em. Each format takes its own set of units. In HTML, also a calc(), min(), max(), or clamp() value. |
The document default, else 40% |
All four formats, each with its own units |
wrap-gap |
attribute | A length or a percent of the text column. In HTML, also a calc(), min(), max(), or clamp() value. |
The document default, else 1em |
All four formats, each with its own units |
wrap-lines |
attribute | A number of lines | Counted from the figure’s height | PDF through LaTeX only |
width and wrap-gap convert to each format’s units as the pages for LaTeX, Typst, and Word state.
Document keys
These go under the wrapped key in the YAML header of a document or a project. A figure’s own width or wrap-gap attribute comes first, and so does a code cell’s #| wrap-gap:, a figure cell’s #| out-width:, or a table cell’s #| width:.
The names follow one rule. An attribute that only this extension reads starts with wrap-, as wrap-gap and wrap-lines do. A key under wrapped: does not, because the map already names the extension, so the gap key is gap. width is the attribute Quarto already reads for an image, so it has no prefix. A key other than width, gap, and breakpoint is ignored, and the render prints a warning that names it.
| Name | Kind | Values | Default | Works in |
|---|---|---|---|---|
width |
wrapped: key |
As the width attribute |
40% |
All four formats |
gap |
wrapped: key |
As the wrap-gap attribute |
1em |
All four formats |
breakpoint |
wrapped: key |
A length, or a calc(), min(), max(), or clamp() value with no percent and no var() |
576px |
HTML only |
wrapped:
width: 25%
gap: 30px
breakpoint: 800px