What would you like to do?
Report an issue on quarto.org
Description
Page: https://quarto.org/docs/output-formats/typst.html#grid-customization
The Typst Grid Customization section documents three grid options:
| Option |
Description (current docs) |
margin-width |
Width of the margin note column |
body-width |
Width of the main text column |
gutter-width |
Gap between body text and margin |
…and the example sets all three:
format:
typst:
grid:
margin-width: 2in
body-width: 4in
gutter-width: 0.25in
However, body-width is silently ignored. Quarto's geometry calculation reads it but never uses it.
For reference, the mapping lives in typstGeometryFromPaperWidth — margin-width/gutter-width are consumed but body-width is not:
|
-- Apply user overrides from grid options |
|
if gridOptions then |
|
if gridOptions["margin-width"] then |
|
local parsed = parseCssLength(gridOptions["margin-width"]) |
|
if parsed then outerWidth = parsed end |
|
end |
|
if gridOptions["gutter-width"] then |
|
local parsed = parseCssLength(gridOptions["gutter-width"]) |
|
if parsed then |
|
-- gutter-width sets outer.sep always |
|
outerSep = parsed |
|
-- gutter-width sets inner.sep only if margin.left wasn't specified |
|
if not marginLeftSpecified then |
|
innerSep = parsed |
|
end |
|
end |
|
end |
|
end |
If we view this as a docs issue, I think the solution is:
- Drop
body-width from the Typst grid table. Remove it from the example.
- Clarify the two that work:
margin-width — width of the margin note column.
gutter-width — gap between the body and the margin column.
- Note that the body width is whatever space is left over and point to
margin-geometry for full control.
However, we could potentially honor body-width if zero or one of margin-width and gutter-width is supplied, and warn if all three are supplied. @gordonwoodhull, if you think that's a better fix, feel free to relabel.
What would you like to do?
Report an issue on quarto.org
Description
Page: https://quarto.org/docs/output-formats/typst.html#grid-customization
The Typst Grid Customization section documents three grid options:
margin-widthbody-widthgutter-width…and the example sets all three:
However,
body-widthis silently ignored. Quarto's geometry calculation reads it but never uses it.For reference, the mapping lives in
typstGeometryFromPaperWidth—margin-width/gutter-widthare consumed butbody-widthis not:quarto-cli/src/resources/filters/layout/meta.lua
Lines 479 to 496 in e768e5c
If we view this as a docs issue, I think the solution is:
body-widthfrom the Typst grid table. Remove it from the example.margin-width— width of the margin note column.gutter-width— gap between the body and the margin column.margin-geometryfor full control.However, we could potentially honor
body-widthif zero or one ofmargin-widthandgutter-widthis supplied, and warn if all three are supplied. @gordonwoodhull, if you think that's a better fix, feel free to relabel.