Skip to content

Typst: margin.left doesn't control the left page margin for article layouts #14573

@cwickham

Description

@cwickham

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 format: typst, margin.left and margin.right are mapped asymmetrically:

-- Apply user overrides from margin options
-- margin.left -> inner.sep (separation between body and inner margin column)
-- margin.right -> outer.far (distance from outer page edge)
if marginOptions then
if marginOptions.left then
local parsed = parseCssLength(marginOptions.left)
if parsed then
innerSep = parsed
marginLeftSpecified = true
end
end
if marginOptions.right then
local parsed = parseCssLength(marginOptions.right)
if parsed then outerFar = parsed end
end
end

  • margin.rightouter.far (gap between the page edge and the outer column) ✅
  • margin.leftinner.sep (gap between the inner column and the body) ❌

Because inner.far keeps a value derived purely from paper width, margin.left has no effect on the left page-edge margin. Setting margin.left equal to margin.right does not produce symmetric margins, and a full-width .column-page block (which extends out to far on each side) ends up visibly off-centre.

I think the fix is to map margin.leftinner.far

Steps to reproduce

---
title: "Untitled"
format:
  typst:
    margin:
      left: 2in
      right: 2in
---


::: {.column-page}
{{< lipsum 1 >}}
:::

Actual behavior

margin.left and margin.right are both 2in, so the .column-page block should have equal gaps on both sides. It doesn't:

Screenshot of PDF page showing large right margin and small left margin

Expected behavior

Symmetric 2" margins

Your environment

  • IDE: Positron
  • OS: macOS 15 (Darwin 25.5.0), Apple Silicon

Quarto check output

Quarto 1.9.38
[✓] Checking environment information...
      Quarto cache location: /Users/charlottewickham/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.8.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.4.5: OK
      Typst version 0.14.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.9.38
      Path: /Applications/Positron.app/Contents/Resources/app/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2026.04
      VeraPDF: 1.28.2
      Chromium: (not installed)
      Chrome Headless Shell: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/charlottewickham/Library/TinyTeX/bin/universal-darwin
      Version: 2026

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........OK
      Version: 4.6.0
      Path: /Library/Frameworks/R.framework/Versions/4.6/Resources
      LibPaths:
        - /Users/charlottewickham/Documents/posit/quarto-tdg/renv/library/R-4.6/aarch64-apple-darwin23
        - /Users/charlottewickham/Library/Caches/org.R-project.R/R/renv/sandbox/R-4.6/aarch64-apple-darwin23/46003b10
      knitr: (None)
      rmarkdown: (None)

      The knitr package is not available in this R installation.
      Install with install.packages("knitr")
      The rmarkdown package is not available in this R installation.
      Install with install.packages("rmarkdown")

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /Users/charlottewickham/.pyenv/versions/3.12.2/bin/python3
      Jupyter: 5.9.1
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking Julia installation...

Metadata

Metadata

Labels

bugSomething isn't workingtriaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.typst

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions