It's been a month since I first tried out Typst, and I have quickly fallen in love. I first used it to write up the syllabi for my classes at the beginning of the semester. They were functional, and looked all right, though were a few things I wasn't able to figure out in the limited time I had. Then I found myself going back and fixing those things, adding new features, turning common features into a template to apply, and occasionally sometimes often using it as a way to procrastinate from other important work (like grading lab reports).
Last week I decided to try using it to write out the problems and solutions from my recitation session (for the calculus-based second year electricity and magnetism course PHYS 272). I'd been providing students with photos of my hand-written notes, but those are always terse and limited to what I need as I'm not overfond of writing. With Typst, I can not only recreate them, but trivially expand upon them and provide context for why I'm taking the steps I am towards the solution.
In practice there was a consideration which kept me from doing this sooner, and that's the presence of diagrams. Much of the problem-solving in E&M involves little pictures, diagrams of the simplified problems we're tackling. They aren't usually very complex, but they're a step beyond the pure text and math I was already getting used to writing in Typst.
Fortunately, Typst has a solution for this: the CetZ package, which allows drawing figures and diagrams within a document. \(\LaTeX\) has something similar in the form of the TikZ package (which inspired CetZ), but while I've been aware of TikZ's existence for quite a few years now I've never had enough motivation (or need) to get around to learning it. With how much fun I was having with Typst, I decided that maybe learning CetZ on top would be beneficial.
And while there have been some difficulties along the way, I've been having a lot of fun with it as well! CetZ is, by its own admission, not as mature as TikZ, but it's already plenty powerful for what I need. Within a few hours of reading its tutorial for the first time Wednesday morning I was making simple diagrams, and I've already improved quite a bit in the intervening time. With the addition of CetZ-Plot, a package that adds plotting capabilities to CetZ, I was even able to get the example shown below under “Electric field of a uniformly charged insulating sphere,” where I could plot the actual \(1/r^2\) fall-off of an inverse-square quantity by defining a function and plotting it.
I'm sure everything I've done with CetZ can be done with TikZ as well, but I was seriously impressed at how easy Typst makes things and how quickly I was able to pick it up. Typst's incremental compilation also means that changes to my diagrams are rendered instantly whenever I change anything, which makes it very easy to iterate and figure out why something isn't working like I think. Thankfully, I now have a reason to keep using it each week as I type up my notes! I even feel something of a desire to make a presentation on it to share with people, but we'll see if that goes anywhere*. A hui hou!
*I am teaching a writing intensive class, and it could be beneficial for students to be aware of…
















