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