diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index ff9ffefd75..b10afe00db 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -56,6 +56,7 @@ All changes included in 1.9: - ([#13870](https://github.com/quarto-dev/quarto-cli/issues/13870)): Add support for `alt` attribute on cross-referenced equations for improved accessibility. (author: @mcanouil) - ([#13950](https://github.com/quarto-dev/quarto-cli/pull/13950)): Replace ctheorems with theorion package for theorem environments. Add `theorem-appearance` option to control styling: `simple` (default, classic LaTeX style), `fancy` (colored boxes with brand colors), `clouds` (rounded backgrounds), or `rainbow` (colored start border and colored title). - ([#13954](https://github.com/quarto-dev/quarto-cli/issues/13954)): Add support for Typst book projects via format extensions. Quarto now bundles the `orange-book` extension which provides a textbook-style format with chapter numbering, cross-references, and professional styling. Book projects with `format: typst` automatically use this extension. +- ([#13978])(https://github.com/quarto-dev/quarto-cli/pull/13978)): Keep term and description together in definition lists to avoid breaking across pages. (author: @mcanouil) ### `pdf` diff --git a/src/resources/formats/typst/pandoc/quarto/definitions.typ b/src/resources/formats/typst/pandoc/quarto/definitions.typ index 161469dac4..5657c633b8 100644 --- a/src/resources/formats/typst/pandoc/quarto/definitions.typ +++ b/src/resources/formats/typst/pandoc/quarto/definitions.typ @@ -28,6 +28,9 @@ it } +// Prevent breaking inside definition items, i.e., keep term and description together. +#show terms.item: set block(breakable: false) + // Some quarto-specific definitions. #show raw.where(block: true): set block( diff --git a/tests/docs/smoke-all/typst/definition-item-no-break.qmd b/tests/docs/smoke-all/typst/definition-item-no-break.qmd new file mode 100644 index 0000000000..9874a40fde --- /dev/null +++ b/tests/docs/smoke-all/typst/definition-item-no-break.qmd @@ -0,0 +1,24 @@ +--- +title: "Definition Item No Break Test" +format: typst +_quarto: + tests: + typst: + ensurePdfTextPositions: + - # Term and description must be on the same page (fails if on different pages) + - subject: "Generate HTML" + relation: below + object: "Multi-format" + - # Description should be indented (NOT left-aligned with term) + - subject: "Generate HTML" + relation: leftAligned + object: "Multi-format" + noErrors: default +--- + +## Introduction + +{{< lipsum 4 >}} + +Multi-format +: Generate HTML, PDF, Word, ePub, and more from one source.