Skip to content

Header gets promoted to title on jupyter kernel, when code block appears first. #13944

@wklimowicz

Description

@wklimowicz

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

The typst format "promotes" the first subheading to a title, even when I specify no title in a document, but only if a code block comes first. If the code block comes second, it behaves as expected.

Steps to reproduce

---
format:
  typst:
    keep-typ: true
---

<!-- #### First Header here -->

```{python}
#| echo: false
#| output: false
print("Hello")
```

#### First Header

Text.

If #### First Header is placed after the python code block, it becomes a title. If it's placed before the code block, it remains a header. This is the diff of the typst:

331d330
<   title: [First Header],
336a336,337
> = First Header
> <first-header>

Actual behavior

The first subsection header becomes the title.

Expected behavior

There should be no title, the subsection header should remain a subsection header.

Your environment

  • IDE: Neovim
  • Fedora 42

Quarto check output

Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /home/wojtek/.cache/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: 99.9.9
      commit: a7d8b6a794780a80df3728c94b4aaaa8299adb85
      Path: /home/wojtek/bin/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/wojtek/.TinyTeX/bin/x86_64-linux
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /usr/bin/google-chrome
      Source: PATH

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

[✓] Checking R installation...........OK
      Version: 4.5.0
      Path: /opt/R/4.5.0/lib64/R
      LibPaths:
        - /home/wojtek/.local/share/R/x86_64-pc-linux-gnu-library/4.5
        - /opt/R/4.5.0/lib64/R/library
      knitr: 1.50
      rmarkdown: 2.30

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

[✓] Checking Python 3 installation....OK
      Version: 3.13.11
      Path: /usr/bin/python3
      Jupyter: 5.7.2
      Kernels: python3, julia-1.11

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

[✓] Checking Julia installation...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingengines-jupyterAnything related to Jupyter engine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions