quarto-dev / quarto-dev/quarto-cli
Figures generated from Julia computations do not embed into main manuscript document
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
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
Hi, I'm currently putting together a document in the manuscript project format, including various parts from other notebooks with Julia code cells used to generate figures for the manuscript. In doing so, I've noticed that figures generated in an extra notebook aren't correctly rendered in the manuscript, both in html and PDF formats.
Rendering to HTML doesn't give any warning outputs, but rendering to PDF will produce a message, e.g.:
WARNING (/programs/quarto-1.9.8/share/filters/main.lua:22354) FloatRefTarget with no content: fig-test-figure
This issue doesn't affect static figures, so a figure defined by the location of an image file within an extra notebook will embed correctly. ({#fig-test-figure} works as an embed source)
Steps to reproduce
- Create a blank Manuscript project.
Main file:
This contains an MWE for image embedding not working with Julia v1.11 & Quarto v1.8 and 1.9.8.
Let's embed an image from `second-file.qmd` here:
{{< embed second-file.qmd#fig-test-figure >}}
There should've been a figure here, but it doesn't show up. This makes me very sad.
{{< embed second-file.qmd#fig-test-figure2 >}}
Did you see the second figure which I ran `display()` on? Sadly neither did I.
Second file:
---
engine: julia
execute:
freeze: auto
julia:
exeflags: ["+1.11"]
---
# Second file
I will generate a random scatter plot here which I want to embed in the first file:
```{julia}
# | fig-cap: "This is a figure caption"
# | label: fig-test-figure
using CairoMakie
fig,ax,s = scatter(rand(1000), rand(1000))
fig
```
More text here
```{julia}
# | fig-cap: "Now I'll use `display()` to see if it makes a difference"
# | label: fig-test-figure2
using CairoMakie
fig,ax,s = scatter(rand(1000), rand(1000))
display(fig)
```
Actual behavior
The embedded figures are missing from the main manuscript file. (HTML example below)
However they are properly generated and visible within the second file where they originate from.
Expected behavior
The embedded figures should be rendered within the main file as if they had been generated there.
Your environment
- OS: Linux Mint 22.2
- Quarto versions tested: 1.8.21 (stable), 1.9.8 (pre-release tested as of date of this issue)
- Julia: v1.11 through
juliaup
Quarto check output
quarto check
Quarto 1.8.21
[✓] Checking environment information...
Quarto cache location: /fs/home/alex/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.21
Path: /fs/home/alex/programs/quarto-1.8.21/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2023
[✓] Checking Chrome Headless....................OK
Chrome: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.11
Path: /fs/home/alex/programs/pyenv/versions/quarto/bin/python
Jupyter: 5.8.1
Kernels: python3, julia-1.9, julia-1.11, julia-1.12
[✓] 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.
Research direction
Start by reproducing the blank Manuscript project with main-file.qmd and second-file.qmd, comparing Julia-generated figures with the static-image case in HTML and PDF. Read the manuscript embedding behavior alongside the reported share/filters/main.lua warning. Done means figures generated by Julia, including those displayed explicitly, appear in the main manuscript without the missing FloatRefTarget warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100