Typst for Technical Documentation

Fri, Jun 16, 2023 tags: [ typst physics ]

In my second post on Typst – after the CV template which already ranks me fairly high in the search results for those terms :-) – I want to present a use case of Typst I found while working on my master’s thesis on integrated photonics devices for multiplexing at low temperatures.

That use case is short techical reports respectively “data sheets”, and I’m proud that this one too doesn’t fall under the apparently intended main application of Typst, which would be writing (academic) publications. In addition, I’ve also written various pieces of technical documentation with it, but those are rather conventional (and could have easily been written in LaTex or Word).

By “data sheet” I am referring to a document short on text, but instead rather filled with plots, tables, etc. Typst has multiple great properties making it suitable for this kind of document: It is text-bsaed with a rather terse syntax, which is a breeze to auto-generate from a template or similar, it supports SVG in addition to pixel-based standard formats, and it obviously is very customizable. These properties somewhat set it apart from the next best alternative LaTeX, which can be quite painful to coerce into doing what you want it to do. The only missing part is running the compilation process from within my own code instead of calling it externally; this is easily done by shelling out, though, so I can’t quite hold my own laziness against Typst here.

Below you can see the pages of a PDF data sheet I generated essentially directly from raw measurements after some processing in my custom data analysis code written in Julia.

For context, this shows the transmission spectrum of a colorless Arrayed Waveguide Grating I hope to use one day for wavelength-multiplexing optical high-speed data links into and out of cryogenic environments. The relevant figures are channel spacing, channel width, and most importantly cross talk; the sheet is focused on presenting these concisely. I have generated dozens of such sheets for different devices, making discussions and comparisons among them fairly simple.

Page 1 Page 2 Page 3 Page 4

The figures were generated using Plots.jl using the GR backend. By saving them to SVG files, typst can directly import and store the plots as vector graphics in the resulting PDF file. The Typst source code was generated trivially using Julia’s string interpolation.

While I thoroughly enjoy using Typst, my thesis will still be written in LaTeX. But maybe it will be my last document wrangling overfullnesses and missing references :-)