quarto-dev / quarto-dev/quarto-cli
Contents Shortcode not working for pdf output (relates to Feature 10552)
Open
@cscheid is already working on this.
Since Sep 1, 2024.
bug
early-in-release
shortcodes
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
This relates to Feature 10552.
When I try and output, to pdf, the minimal example in the documentation. I get this a malformed document and an incorrect output:
quarto preview /workspaces/quarto-playpen-2/.devcontainer/content_test_qmd.qmd --to pdf --no-brow
ser --no-watch-inputs
Output:
Starting python3 kernel...Done
Executing 'content_test_qmd.quarto_ipynb'
Cell 1/1: 'a-cell'...Done
pandoc
to: latex
output-file: content_test_qmd.tex
standalone: true
pdf-engine: xelatex
variables:
graphics: true
tables: true
default-image-extension: pdf
metadata
documentclass: scrartcl
classoption:
- DIV=11
- numbers=noendperiod
papersize: letter
header-includes:
- '\KOMAoption{captions}{tableheading}'
block-headings: true
WARNING (/opt/quarto/share/filters/main.lua:15386) [Malformed document] Found `contents` shortcode without a corresponding div with id: a-cell.
This might happen because the shortcode is used in div context, while the id corresponds to a span.
Removing from document.
Rendering PDF
running xelatex - 1
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
running xelatex - 2
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
Output created: content_test_qmd.pdf
Steps to reproduce
## A section
Here we define a plot.
```{python}
#| echo: false
#| label: a-cell
import matplotlib.pyplot as plt
plt.plot([1,2,3])
```
## Another section
Here we use the plot, inside a callout:
::: callout-note
## Note the following plot
{{< contents a-cell >}}
:::
Expected behavior
A pdf that is consistent with the documentation.
Actual behavior
I get the error above, and a document that looks like this:
Your environment
- IDE: VS Code 1.92.2
- OS: 13.6.7 Ventura
Quarto check output
Quarto 1.6.9
[✓] 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.6.9
Path: /opt/quarto/bin
[✓] Checking tools....................OK
Chromium: 869685
TinyTeX: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2020
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.1
Path: /usr/local/bin/python
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
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.
Assessment
This issue has not been assessed yet.