Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
3 changes: 3 additions & 0 deletions src/resources/formats/typst/pandoc/quarto/definitions.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
24 changes: 24 additions & 0 deletions tests/docs/smoke-all/typst/definition-item-no-break.qmd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, is this ensurePdfTextPositions new?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added these to validate article layout in Typst PDF output.

It's currently just right-of, above, etc, and per-side alignment, so I tested that they are not left-aligned, but the predicates only work if the items are on the same page, so it worked out handy for this.

Come to think of it, I think I could have tested that the left edge is to the right of the other left edge as a positive test. 🤔

I'm still getting used to it and figuring out the complete API, please try it out and see if it's helpful. I'll add dev-docs soon.

Original file line number Diff line number Diff line change
@@ -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.
Loading