quarto-dev / quarto-dev/quarto-cli
PDF has bad display of code-line-numbers combined with code-block-border-left
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
Description
When code-line-numbers is true and code-block-border-left is some color, the numbers overlay and overflow the border, resulting in something like this:
Steps to reproduce
File: mwe.qmd
---
title: "MWE"
format:
pdf:
code-line-numbers: true
code-block-bg: false
code-block-border-left: "#F0F0F0"
---
```{.python}
print("This is a MWE.")
while True:
print("code-line-numbers and code-block-border-left mwe.")
```
Then run:
quarto render mwe.qmd --to pdf
Expected behavior
The numbers should not overlay the left border. Instead, they should be completely on its left, with some margin (something like what happens with the epub output). Or, alternatively, the numbers could overlay the border, but not overflow it. That is, the border width must large enough to accommodate the numbers within its limits.
Actual behavior
The numbers overlay and overflow the left border.
Your environment
- OS: Debian 12.7
Quarto check output
Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.57
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2022
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.11.2
Path: /usr/bin/python3
Jupyter: 4.12.0
Kernels: python3
(-) Checking Jupyter engine render....[IPKernelApp] ERROR | No such comm target registered: quarto_kernel_setup
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.2.2
Path: /usr/lib/R
LibPaths:
- /home/lux/R/x86_64-pc-linux-gnu-library/4.2
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.48
rmarkdown: 2.28
[✓] Checking Knitr engine render......OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied mwe.qmd and render it using quarto render mwe.qmd --to pdf to reproduce the interaction between code-line-numbers and code-block-border-left. Trace the PDF rendering path responsible for code blocks and verify the result against the expected margin or contained-number behavior. Done means the reproduced PDF no longer has line numbers overflowing the left border.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100