Skip to content

Commit a4e7370

Browse files
authored
Merge pull request #13978 from mcanouil/fix/keep-term-definition-together
fix(typst): prevent breaking inside definition items
1 parent 67cdc52 commit a4e7370

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ All changes included in 1.9:
5656
- ([#13870](https://github.com/quarto-dev/quarto-cli/issues/13870)): Add support for `alt` attribute on cross-referenced equations for improved accessibility. (author: @mcanouil)
5757
- ([#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).
5858
- ([#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.
59+
- ([#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)
5960

6061
### `pdf`
6162

src/resources/formats/typst/pandoc/quarto/definitions.typ

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
it
2929
}
3030

31+
// Prevent breaking inside definition items, i.e., keep term and description together.
32+
#show terms.item: set block(breakable: false)
33+
3134
// Some quarto-specific definitions.
3235

3336
#show raw.where(block: true): set block(
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: "Definition Item No Break Test"
3+
format: typst
4+
_quarto:
5+
tests:
6+
typst:
7+
ensurePdfTextPositions:
8+
- # Term and description must be on the same page (fails if on different pages)
9+
- subject: "Generate HTML"
10+
relation: below
11+
object: "Multi-format"
12+
- # Description should be indented (NOT left-aligned with term)
13+
- subject: "Generate HTML"
14+
relation: leftAligned
15+
object: "Multi-format"
16+
noErrors: default
17+
---
18+
19+
## Introduction
20+
21+
{{< lipsum 4 >}}
22+
23+
Multi-format
24+
: Generate HTML, PDF, Word, ePub, and more from one source.

0 commit comments

Comments
 (0)