Skip to content

Fix spurious blank page in Typst when using raw set page rule#14219

Merged
gordonwoodhull merged 1 commit intomainfrom
bugfix/14217
Mar 19, 2026
Merged

Fix spurious blank page in Typst when using raw set page rule#14219
gordonwoodhull merged 1 commit intomainfrom
bugfix/14217

Conversation

@gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented Mar 16, 2026

Unfortunately it means changing the indentation on most of the template yet again, but we have git diff -w

Summary

  • Skip the empty place(top, float: true, ...) title block in the Typst article() template when there is no title, authors, date, or abstract
  • The unconditional empty block counted as content, so a subsequent raw #set page(...) in the document body triggered a page break in Typst, producing a spurious blank first page

Fixes #14217

Test plan

  • New test tests/docs/smoke-all/typst/raw-set-page-no-extra-page.qmd asserts body content is on page 1
  • Verified test fails without the fix (body on page 2), passes with the fix (body on page 1)
  • Existing Typst tests pass (columns, callouts, title blocks)

@gordonwoodhull gordonwoodhull added this to the v1.10 milestone Mar 16, 2026
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Mar 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Mar 16, 2026

The individual if title != none, if authors != none, etc. guards inside the title block were always there and still are.

What changed is that the Pandoc merge (d100a046c) wrapped them all in an unconditional block(), and subsequent commits added place() around it.

That outer wrapper emits content even when all the inner guards are false, which is what triggers the page break.

Our fix just adds the missing guard on that outer wrapper.

@cderv
Copy link
Collaborator

cderv commented Mar 17, 2026

Fixed upstream in pandoc already: jgm/pandoc@dc4bcd2

When a document has no title, authors, date, or abstract, the article()
template unconditionally emitted a place(top, float: true, ...) with an
empty block. This counted as content, so a subsequent raw #set page(...)
in the document body triggered a page break in Typst, producing a blank
first page.

Guard the place() call so it is only emitted when there is actual title
block content.

Fixes #14217
@gordonwoodhull gordonwoodhull merged commit 22a1428 into main Mar 19, 2026
51 checks passed
@gordonwoodhull gordonwoodhull deleted the bugfix/14217 branch March 19, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quarto 1.9.35 adds empty blank page in Typst when using a set rule for the page() function

3 participants