"What's in your Julia and Quarto?"

Some of us are using Quarto with Julia, so I thought it would be nice to have a permanent thread on this topic taking inspiration from What is in your startup.jl? by @oxinabox. It would be great to hear about everyone’s experiences. In my own experience things generally already work quite smoothly, but sometimes I’ve hit road blocks, while other times I’ve managed to do cool things. Sharing this with others seems helpful, so let’s try to use this thread to help each other.

I’ll start of with a couple of resources,

  • J.J Allaire’s talk at JuliaCon 2022
  • Quarto’s own guide

and some of my own experiences:

  • “A year of using Quarto with Julia” on my blog or on Forem
23 Likes

Check out registry.gitlab.b-data.ch/jupyterlab/julia/pubtools .
:point_right: pubtools = base + TinyTeX + Pandoc + Quarto

:information_source: Quarto is currently only available for amd64 architecture.


You may test it at https://demo.jupyter.b-data.ch/ .
→ Resources are limited to 2 cores and 8 GB RAM.

I am happy to receive feedback.


Cross references:

2 Likes

Yes, it is already working quite smoothly.

Handling of plot output formats could be improved, though. See

A few things I learned while taking Quarto for a test drive:

To get Luxor’s SVG output drawn on the page, use display(). (In Pluto.jl it will be displayed automatically.) If you don’t, you’ll get the odd error message: ERROR: TypeError: Cannot read properties of undefined (reading 'startsWith').

To have the code hidden in a collapsed ‘details’ block, use #| code-fold: true inside the code cell.


```{julia}
#| fig-cap: "Drawing of an epitrochoid marked with circles"
#| fig-alt: "An epitrochoid drawn with circles"
#| code-fold: true
#| code-summary: "Show the code"
using Luxor, Colors
d = Drawing(800, 500, :svg)
origin()
rotate(π/2)
p = epitrochoid(120, 12, 58, vertices=true)
L = 300
ps = polysample(p, L)
for (n, pt) in enumerate(ps)
    sethue(HSB(rescale(n, 1, L, 0, 360), 0.7, 0.6))
    circle(pt, 20sin(rescale(n, 1, L, 0, π)), :fillpreserve)
    sethue("black")
    strokepath()
end
finish()
display(d)

To choose fonts, it seems to work if you add them to the css style files and to the .yaml files.

yaml:

format:
  html:
    theme: 
         light: flatly
         dark: cyborg
    monofont: JuliaMono-Light
    mainfont: Merriweather
    css: styles.css
    toc: true

css:

@font-face {
    font-family: JuliaMono-Light;
    src:
        local('JuliaMono-Light'),
        url("https://cdn.jsdelivr.net/gh/cormullion/juliamono/webfonts/JuliaMono-Light.woff2");
}

@font-face {
    font-family: Merriweather;
    src:
        local('Merriweather'),
        url("https: //cdn.jsdelivr.net/npm/@fontsource/merriweather@4.5.14/files/merriweather-latin-700-normal.woff2");
}

*  {
    font-variant-numeric: oldstyle-nums;
}
18 Likes

The JupyterLab Julia pubtools image now also provides Quarto for arm64.

:point_right: See the Version Matrix for detailed information.

1 Like

That’s a great observation! I was looking for a way to render the Luxor turtles in Quarto and using the display function works with the turtles too when I display the drawing canvas :slight_smile:

Still no good solution for cross-references working across .qmd files? Without this Quarto seems of very little usage to document packages with function docs in their own files.

You can create cross references to sections in other files, just add the path to the reference. It’s documented here

1 Like

I have found that too, but it’s an extremely painful option when we have many .qmd files to cross-reference because at every-time we must need to know the file name containing whatever we want to reference. This is something that should be Quarto’s responsibility and not push it to the users.

I’m not sure how to would know where to make the link. If you want to look at an example look at ibis https://ibis-project.org on their GitHub repo.

Thanks. I think I learned how to do it but it doesn’t change the pain. Specially if one do the links from files in different directories as the the link must contain the relative path to file when the two files (the one where the link is made and the one with the target) are not in the same directory. And when has over an hundred of those …