Juliacon 2024

Jlyfish: Reproducible documents with Julia and Typst
07-12, 11:50–12:00 (Europe/Amsterdam), If (1.1)

Typst is a modern type setting system excelling at user experience and compilation speed. In this talk, I present the package Jlyfish for Typst and Julia that allows users to include Julia code directly in the Typst source, have it executed, and its output inserted into the document. Similar to PythonTeX for LaTeX, this enables a workflow where results of computations are not hardcoded in the document but dynamically inserted, making the latter reproducible and in sync with the rest of the code.


Jlyfish on GitHub
There are many software solutions that combine code, its output, and prose. Beginning with interactive notebooks such as Pluto or Jupyter, over code presentation focused systems like Weave.jl or Quarto, to extensions for general purpose typesetting software like PythonTeX for LaTeX or showman for Typst. Jlyfish can be found in the last catergory and aims at providing the best interaction between Typst and Julia. To this end, it consists of a package for Typst and one for Julia and makes use of Julia's powerful features. As Typst supports displaying text, PNG, JPG, and SVG, Jlyfish will use Julia's display system to display the result of a computation in the richest possible MIME type. It additionally supports the MIME "text/typst" that will then be interpreted as Typst source code on the Typst side, allowing emitting markup or more complex document features. Users can also configure whether the Julia code, the standard output, and/or logs should be shown in the document. Julia's support for metaprogramming facilitates parsing the user provided code and evaluating it in an encapsulated module and its own environment. The Julia package is used like a standalone program by calling a watch() function. It then watches the Typst source file for changes and automatically reruns evaluation, but only if the Julia code has actually changed.
In this talk, I will briefly introduce Typst and why one should consider preferring it over LaTeX. Then, I will present how to use Jlyfish and how it works behind the scenes, focussing on the Julia parts. After demonstrating what is possible with Jlyfish today, I will close with some ideas for its future development.

See also: presentation slides (359.7 KB)

My GitHub profile
Mastodon

Hi! I'm a PhD student at University Hospital Jena, Germany, conducting research on computational structural biology. We are interested in reconstructing the conformational movement of large biomolecules from cryo-EM images. Methodically, we employ Bayesian probabilistic inference. If that's up your alley, let's have a chat!

At JuliaCon, I will be talking about another passion of mine, how code and text fit together.

This speaker also appears in: