Pagebreak shortcode does not work in typst in multiple columns layout

Open
#11,819 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Start by reproducing the supplied .qmd with the Typst format configured for two columns. Read src/command/render/output-typst.ts, the stack-trace entry point, and trace how the pagebreak shortcode reaches Typst. Done means the example renders without the reported pagebreak compilation error.

Written by the indexing model from the issue text.

Description

enhancement shortcodes typst

Pagebreak shortcode does not work in typst when using multiple columns layout.

---
title: "Quarto Playground"
format: 
  typst:
    columns: 2
---

This is a playground for Quarto.

{{< lipsum 1 >}}

{{< pagebreak >}}

{{< lipsum 1 >}}

Leading to

pandoc 
  to: typst
  output-file: index.typ
  standalone: true
  shift-heading-level-by: -1
  default-image-extension: svg
  wrap: none
  citeproc: false
  toc: true
  
metadata
  columns: 2
  title: Quarto Playground
  
[typst]: Compiling index.typ to index.pdf...error: pagebreaks are not allowed inside of containers
    ┌─ index.typ:305:1
    │
305 │ #pagebreak()
    │  ^^^^^^^^^^^

ERROR: Error
    at Object.complete (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/output-typst.ts:79:13)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render.ts:300:23
    at async withTimingAsync (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/core/timing.ts:50:20)
    at async Object.complete (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render.ts:276:7)
    at async Object.onPostProcess (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:720:28)
    at async renderFileInternal (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:689:3)
    at async renderFiles (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:325:9)
    at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-shared.ts:102:18)
    at async renderForPreview (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:428:24)

Originally posted by @ironupiwada in https://github.com/quarto-dev/quarto-cli/discussions/11591#discussioncomment-11776123

Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.