Inconsistent line numbering in OJS code chunks

Open
#12,395 2 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Mar 27, 2025.

Assessment

This issue has not been assessed yet.

Description

bug ojs-engine
Bug description

When using OJS code chunks in a Quarto presentation, the line numbering behaves inconsistently depending on the eval parameter.

Steps to reproduce
---
format: revealjs
execute: 
  echo: true
---

No line numbering.

```{ojs}
x = 1
```

Line numbering but according to position in `.qmd`.

```{ojs}
//| eval: false
y = 1
```

Normal line numbering with `R` chunck.

```{r}
z <- 1
```
Actual behavior
  • If eval: true, no line numbers are shown in the OJS chunk (whereas I expected them to appear by default, isn't it?).
  • If eval: false, line numbers appear, but they reflect the line numbers of the entire .qmd file rather than starting at the OJS chunk lines.
Image
Expected behavior

OJS chunks should always display line numbers that start at 1, regardless of the eval parameter—just like other code chunks in Quarto typically do.

Your environment

RStudio: Version 2024.12.1+563
OS: MacOS Sequoia 15.3.2
Quarto: 1.6.40 and 1.6.42

Quarto check output
Quarto 1.6.42
[✓] Checking environment information...
      Quarto cache location: /Users/antoinebichat/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.42
      Path: /Applications/quarto/bin

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

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Users/antoinebichat/.virtualenvs/r-reticulate/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.49
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK
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.