Typst: `margin: y` is ignored when the document has margin content

Đang mở
#15,400 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
lua, yaml
Lĩnh vực
backend

Hướng nghiên cứu

Read src/resources/formats/typst/pandoc/quarto/page.typ around lines 29–30, where the issue says the marginalia setup reads margin.top and margin.bottom; compare that path with meta.lua, which maps margin.x. Reproduce using the provided Quarto document with a .column-margin block and inspect the generated .typ output. Done when margin: {x: 2cm, y: 2cm} produces top and bottom margins of 2cm with marginalia enabled.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug typst
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

In Typst output, margin: {x, y} is applied as is when the document has no margin content.
Once there is a .column-margin block (or any content that turns on the marginalia layout), y is dropped and the top and bottom margins go back to 1.25in.
Only margin.top and margin.bottom are read for the marginalia setup:

https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/formats/typst/pandoc/quarto/page.typ#L29-L30

margin.x takes a different path (meta.lua maps it to inner.sep and outer.far), covered by #14573.

Steps to reproduce
---
title: Margins
format:
  typst:
    keep-typ: true
    papersize: a4
    margin:
      x: 2cm
      y: 2cm
---

Text.

::: {.column-margin}
A note.
:::
Actual behavior

The .typ file has no margin: in set page, and:

#show: marginalia.setup.with(
  inner: (far: 0.634in, width: 0.792in, sep: 0.787in),
  outer: (far: 0.787in, width: 1.582in, sep: 0.316in),
  top: 1.25in,
  bottom: 1.25in,

Without the .column-margin block, the same document gets margin: (x: 2cm,y: 2cm,).

Expected behavior

top: 2cm and bottom: 2cm, the same as with margin: {top: 2cm, bottom: 2cm}.

Your environment
  • IDE: none (terminal)
  • OS: Windows 11
  • Same values with Quarto 1.11.9, 1.12.3 and current main (cda4102).
Quarto check output
Quarto 1.12.3
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.13.0: OK
      Dart Sass version 1.107.1: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.12.3
[>] Checking tools....................OK
      TinyTeX: v2026.11
      VeraPDF: 1.30.3
      Chrome Headless Shell: (not installed)
Ngôn ngữ chính
JavaScript
Star
6.2k
Fork
492
Merge trung bình
15 giờ 15 phút
Pull request đã merge (30 ngày)
94

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/quarto-cli

Tất cả issue của quarto-dev/quarto-cli

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.