Open alecloudenback opened 1 month ago
First, if you want to change the engine, moving around the front matter is really not the way.
Set engine: jupyter
.
Second, I believe the issue (which does not require a book) is related if not the exact same issue as:
What’s the recommended place to set the engine to Julia? At the top of each qmd above all other content?
It's called YAML frontmatter. I don't believe there is anywhere in the documentation where it's not the first thing in a document.
Putting the block elsewhere means it's no longer the front matter but a simple metadata block.
I'm not sure that this is the same issue as #7817, is it? When using the engine: julia
, is the IJulia startup run at all?
Further, adding set_theme!()
as recommended in that issue after loading CairoMakie and the plotting call does not resolve the issue.
I think the issue could be resolved by manually setting the figure's size, but I'm not sure how to get the default figure sizes? It seems like these are defined outside of the normal code in the IJulia startup (referring to fig_width = {0}
, etc.). Any idea how to get the default figure size within the Julia engine?
I don't really use Julia and the native Julia engine is a community contribution.
@jkrumbiegel might be able to help here.
I'm just guessing here but it could be that the julia engine reports the pixel size of the image differently than ijulia, so the placed size in the pdf differs even though the actual figure size might be the same. Because at first glance it doesn't look like the figure size is huge (the text labels look reasonably sized compared to the plotting area). And zooming in, the picture seems pixelated, so that also points to the final size for the pdf being set incorrectly. I would maybe check the intermediate md with keep-md: true
to see if there is a weird size annotation there or something.
Thanks!
Additionally, to keep-md: true
to get the content sent to Pandoc, keep-tex: true
could also be used to investigate the actual content sent to LaTeX engine.
It looks like in the intermediate markdown files, the difference is:
First chapter which renders okay:
::: {.cell-output .cell-output-display execution_count=11}
![](index_files/figure-pdf/cell-2-output-2.png){fig-pos='H'}
:::
Second chapter which renders too big:
::: {.cell-output .cell-output-display execution_count=1}
![](index2_files/figure-pdf/cell-2-output-2.png){width=1650 height=1050 fig-pos='H'}
:::
Is there anyway to turn off the size annotation? I tried adding in the code settings like #| column: page
or #| width: "80%"
which did not change anything in the output.
Yeah this is exactly what I figured. Could be that ijulia doesn't send out the original size of the png at all? I remember that we did this explicitly for some reason, but it's just metadata and we don't force quarto to use it in this way. I don't remember what the precedence case was though, in general we tried to mirror the ijulia behavior where it was appropriate.
seems to be fixed in Quarto 1.6.6, provided you add
format:
pdf:
fig-dpi: 72
in the YAML frontmatter.
Bug description
When using the
engine: julia
the figures do not render as anticipated (they are very large and take up the whole page). In this MWE and attached PDF, see how the second chapter renders the figure as a whole page.Perhaps the
---
is interfering with the heading markdown syntax? Or should the---
section be recognized if it's below the heading?Example output with issue.pdf, and screenshot here:
Steps to reproduce
A clonable MWE repo is here: https://github.com/alecloudenback/engine-mwe
When
engine:julia
is below the title (as inindex.qmd
), it uses Jupyter pipeline. Whenengine: julia
is above the title (as inindex2.qmd
), the figures get overly large.Terminal output of rendering:
Expected behavior
The renderer should use the Julia engine, not Jupyter, and the figure should not be the wrong size.
Actual behavior
The figure gets enlarged when using the Julia engine.
Your environment
Mac 14.5, M3. VS Code
Quarto check output