Skip to content
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

Julia quarto documents render plots as svg, when both PDF and html formats specified in project file #722

Closed
jeremiahpslewis opened this issue Apr 24, 2022 · 6 comments

Comments

@jeremiahpslewis
Copy link
Contributor

jeremiahpslewis commented Apr 24, 2022

This causes the latex PDF build to fail as it doesn't support SVG.

Project file snippet:

format:
  html:
    theme: cosmo
  pdf:
    toc: true
    number-sections: true
    colorlinks: true

Workaround, with parameters and running things twice is here: https://github.com/jeremiahpslewis/quarto-reproducible-gh-actions/blob/89fe98a92cc36fbfbc68b632f17a71e4de8d767f/.github/workflows/quarto.yml#L29

@jjallaire
Copy link
Collaborator

I haven't been able to reproduce this (in my tests PDFs use pngs which is the expected behavior). Note that we did make a change to Julia figure handling a few weeks ago (c6e98a3). Is it possible you are running a slightly older version of Quarto?

@jjallaire
Copy link
Collaborator

I am able to repro on Ubuntu. More soon.

@jjallaire
Copy link
Collaborator

It looks like the problem is that we have a dependency on the Plots module (in order to set the default figure format). After I did Pkg.add("Plots") things worked as expected. I will update our examples to call using Plots so that the error message in this case is more clear.

@jeremiahpslewis
Copy link
Contributor Author

Can confirm that adding Plots.jl to the Project.toml fixed the issue. Thanks!

One note, due to the fact that the Julia plots are rendered as PNG's for the PDF, they look relatively pixellated in comparison to Python and R. Any thoughts about bumping up the default DPI a bit? (not sure that this would help)

Example PDF: https://jeremiahpslewis.github.io/quarto-reproducible-gh-actions/quarto-and-github-actions.pdf

Julia:
Screen Shot 2022-04-28 at 15 41 18

Python:
Screen Shot 2022-04-28 at 15 41 12

@jjallaire
Copy link
Collaborator

Unfortunately when you bump up the DPI the legend text gets proportionally smaller. Would love it if changes could be made to Plots.jl to mitigate this!

@jeremiahpslewis
Copy link
Contributor Author

Linking the IJulia PDF issue which would fix this here for future info: JuliaLang/IJulia.jl#1035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants