"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
16 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:

1 Like

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;
}
14 Likes