From 17e3d78559a3391543a50ad5a31decd195044655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:04:15 +0100 Subject: [PATCH 1/4] fix: typst format's callouts show different text alignment with Prefix Fixes #12803 --- src/resources/formats/typst/pandoc/quarto/definitions.typ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/formats/typst/pandoc/quarto/definitions.typ b/src/resources/formats/typst/pandoc/quarto/definitions.typ index 5657c633b8..ba77a64c05 100644 --- a/src/resources/formats/typst/pandoc/quarto/definitions.typ +++ b/src/resources/formats/typst/pandoc/quarto/definitions.typ @@ -163,9 +163,9 @@ children.at(0) + new_title // with icon: preserve icon block + new title })) - block_with_new_content(old_callout, + align(left, block_with_new_content(old_callout, block(below: 0pt, new_title_block) + - old_callout.body.children.at(1)) + old_callout.body.children.at(1))) } // 2023-10-09: #fa-icon("fa-info") is not working, so we'll eval "#fa-info()" instead From 24cbef178156465de626618dae3eca82639bf311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:12:29 +0100 Subject: [PATCH 2/4] fix: warning from Typst --- src/resources/formats/typst/pandoc/quarto/definitions.typ | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/resources/formats/typst/pandoc/quarto/definitions.typ b/src/resources/formats/typst/pandoc/quarto/definitions.typ index ba77a64c05..504429199c 100644 --- a/src/resources/formats/typst/pandoc/quarto/definitions.typ +++ b/src/resources/formats/typst/pandoc/quarto/definitions.typ @@ -41,15 +41,14 @@ ) #let block_with_new_content(old_block, new_content) = { - let d = (:) let fields = old_block.fields() - fields.remove("body") + let _ = fields.remove("body") if fields.at("below", default: none) != none { // TODO: this is a hack because below is a "synthesized element" // according to the experts in the typst discord... fields.below = fields.below.abs } - return block.with(..fields)(new_content) + block.with(..fields)(new_content) } #let empty(v) = { From d4e00c137225277c546de2c24b96ab50dd054968 Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Fri, 27 Feb 2026 14:54:56 -0500 Subject: [PATCH 3/4] test: callout paragraph alignment with cross-ref ID --- .../typst/callout-paragraph-alignment.qmd | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/docs/smoke-all/typst/callout-paragraph-alignment.qmd diff --git a/tests/docs/smoke-all/typst/callout-paragraph-alignment.qmd b/tests/docs/smoke-all/typst/callout-paragraph-alignment.qmd new file mode 100644 index 0000000000..d66c683a02 --- /dev/null +++ b/tests/docs/smoke-all/typst/callout-paragraph-alignment.qmd @@ -0,0 +1,25 @@ +--- +title: "Callout Paragraph Alignment" +format: + typst: + keep-typ: true +_quarto: + tests: + typst: + ensurePdfTextPositions: + - # Paragraphs inside cross-referenced callout should be left-aligned + - subject: "ShortLine" + relation: leftAligned + object: "LongerParagraph with additional words" + tolerance: 2 + - [] + noErrors: default +--- + +::: {.callout-tip #tip-alignment} +## Alignment Test + +ShortLine + +LongerParagraph with additional words filling out this line. +::: From 2f35b1749f165f93808592b822119a39ce3a52dd Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Fri, 27 Feb 2026 14:56:42 -0500 Subject: [PATCH 4/4] changelog: add entry for #12803 callout alignment fix --- news/changelog-1.9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index 36d010ecdb..2f2edde113 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -57,6 +57,7 @@ All changes included in 1.9: ### `typst` +- ([#12803](https://github.com/quarto-dev/quarto-cli/issues/12803)): Fix callout text being centered instead of left-aligned when callout has a cross-reference ID prefix (e.g., `#tip-abc`). - ([#13249](https://github.com/quarto-dev/quarto-cli/pull/13249)): Update to Pandoc's Typst template following Pandoc 3.8.3 and Typst 0.14.2 support: - Code syntax highlighting now uses Skylighting by default. - New template variables `mathfont`, `codefont`, and `linestretch` for font and line spacing customization.