Skip to content

Julia example doesn't write the plot into the pdf file #12468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yurivict opened this issue Apr 6, 2025 · 9 comments
Open

Julia example doesn't write the plot into the pdf file #12468

yurivict opened this issue Apr 6, 2025 · 9 comments
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction

Comments

@yurivict
Copy link
Contributor

yurivict commented Apr 6, 2025

Bug description

The example from here:

```{julia}
#| label: fig-parametric
#| fig-cap: "Parametric Plots"

using Plots

plot(sin, 
     x->sin(2x), 
     0, 
     2π, 
     leg=false, 
     fill=(0,:lavender))
```

only writes the above code into the PDF document but doesn't write the plot.

No errors are printed:

$ quatro render example-julia-fig-parametric.qmd --to pdf
Starting python3 kernel...Done

Executing 'example-julia-fig-parametric.quarto_ipynb'

pandoc 
  to: latex
  output-file: example-julia-fig-parametric.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
  

Rendering PDF
running xelatex - 1
  This is XeTeX, Version 3.141592653-2.6-0.999997 (Web2C 2025) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  
running xelatex - 2
  This is XeTeX, Version 3.141592653-2.6-0.999997 (Web2C 2025) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  

Output created: example-julia-fig-parametric.pdf

Version: 1.7.21
deno-2.2.2
FreeBSD 14.2

Steps to reproduce

No response

Actual behavior

No response

Expected behavior

No response

Your environment

No response

Quarto check output

$ quarto check
Quarto 1.7.21
[✓] Checking environment information...
      Quarto cache location: /home/yuri/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      NOTE: Pandoc version 3.6.4 does not strictly match 3.6.3 and strict checking is enabled. Please use 3.6.3.
      NOTE: Dart Sass version 1.49.8 does not strictly match 1.85.1 and strict checking is enabled. Please use 1.85.1.
      NOTE: Deno version 2.2.2 does not strictly match 1.46.3 and strict checking is enabled. Please use 1.46.3.
      NOTE: Typst version 0.13.1 does not strictly match 0.13.0 and strict checking is enabled. Please use 0.13.0.
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.21
      Path: /usr/local/share/quarto/bin

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

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/local/bin
      Version: undefined

[✓] Checking Chrome Headless....................OK
      Chrome:  (not detected)

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.11
      Path: /usr/local/bin/python3.11
      Jupyter: 5.7.2
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.4.3
      Path: /usr/local/lib/R
      LibPaths:
        - /usr/home/yuri/R/amd64-portbld-freebsd14.1-library/4.4
        - /usr/local/lib/R/library
      knitr: 1.50
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK
@yurivict yurivict added the bug Something isn't working label Apr 6, 2025
@yurivict yurivict changed the title Julia example doesn't print the plot into the pdf file Julia example doesn't write the plot into the pdf file Apr 7, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented Apr 7, 2025

Could you properly format your post using code blocks for code and terminal outputs? Thanks.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.

@yurivict
Copy link
Contributor Author

yurivict commented Apr 7, 2025

I fixed the formatting.

@mcanouil
Copy link
Collaborator

mcanouil commented Apr 7, 2025

Thanks.

Could you make your example reproducible? Linking to a documentation page does it make it so.
For instance, you did not provide any information on the engine being used.

Accessibility: For better accessibility, please ensure link text is descriptive and meaningful rather than using generic terms such as "here". This helps all users understand the link's destination. See Writing meaningful link text (WCAG).

@mcanouil
Copy link
Collaborator

mcanouil commented Apr 7, 2025

Finally, you are not using an official build. The team cannot help with non standard build of Quarto CLI for obvious reasons.
Unless you are able to reproduce the issue using a proper build and the right dependencies, or you are unlikely to receive further help as the team doesn't have the resources to go on a wild goose chase because of unvalidated dependencies.

Checking versions of quarto binary dependencies...
      NOTE: Pandoc version 3.6.4 does not strictly match 3.6.3 and strict checking is enabled. Please use 3.6.3.
      NOTE: Dart Sass version 1.49.8 does not strictly match 1.85.1 and strict checking is enabled. Please use 1.85.1.
      NOTE: Deno version 2.2.2 does not strictly match 1.46.3 and strict checking is enabled. Please use 1.46.3.
      NOTE: Typst version 0.13.1 does not strictly match 0.13.0 and strict checking is enabled. Please use 0.13.0.

@mcanouil mcanouil added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Apr 7, 2025
@yurivict
Copy link
Contributor Author

yurivict commented Apr 7, 2025

For instance, you did not provide any information on the engine being used.

The pdf is being generated: "--to pdf" is specified.

@mcanouil
Copy link
Collaborator

mcanouil commented Apr 7, 2025

That's not the engine, that's the format.

As described in the issue template, the following is a fully reproducible example as it contains every piece of information needed to render:


You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).
See https://quarto.org/bug-reports.html#small-is-beautiful-aim-for-a-single-document-with-10-lines.

If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.

RPython
````qmd
---
title: "Reproducible Quarto Document"
format: html
engine: knitr
---

This is a reproducible Quarto document.

{{< lipsum 1 >}}

```{r}
x <- c(1, 2, 3, 4, 5)
y <- c(1, 4, 9, 16, 25)

plot(x, y)
```

![An image]({{< placeholder 600 400 >}}){#fig-placeholder}

{{< lipsum 1 >}}

The end after @fig-placeholder.
````
````qmd
---
title: "Reproducible Quarto Document"
format: html
engine: jupyter
---

This is a reproducible Quarto document.

{{< lipsum 1 >}}

```{python}
import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]

plt.plot(x, y)
plt.show()
```

![An image]({{< placeholder 600 400 >}}){#fig-placeholder}

{{< lipsum 1 >}}

The end after @fig-placeholder.
````

Additionally and if not already given, please share the output of quarto check within a code block (i.e., using three backticks ```txt), see https://quarto.org/bug-reports.html#check.

@cderv
Copy link
Collaborator

cderv commented Apr 7, 2025

@yurivict to be clear about us not having all the information needed, or at least mixed information, let me give us an example from what you shared with us:

$ quatro render example-julia-fig-parametric.qmd --to pdf
Starting python3 kernel...Done

You see in your console log that python3 kernel is used. This means that julia code cell won't be evaluated. To execute Julia code cell, you must use a Julia kernel for Jupyter, or the Quarto Julia engine.

  • Maybe you don't have a julia kernel available ?
  • Maybe you are mixing python cell with julia cell ?

I hope this will give you hint, to provide us with the proper reproducible example.

@yurivict
Copy link
Contributor Author

yurivict commented Apr 7, 2025

@cderv

Yes, the problem is that the Julia kernel wasn't installed.

Perhaps Quarto should print an error message instead of silently ignoring Julia cells in such case?

@mcanouil
Copy link
Collaborator

mcanouil commented Apr 7, 2025

It's not ignored by Quarto. It's ignored by the kernel used by default.
Note that you could have a Python module to call Julia, etc. Quarto has no means to know what you are going to compute and how you want it to happen.
If there is an R code cell engine: knitr else engine: jupyter.

Note that this is documented in the exact documentation you've linked in your original post: https://quarto.org/docs/computations/julia.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction
Projects
None yet
Development

No branches or pull requests

3 participants