How to Install Typst on Debian

Last year I had to typeset a book and decided to go down the Latex route. Despite having written my fair share of academic works I was actually new to Latex. While working on the book I came across people recommending a Typst. I had a quick look for reviews and literally no one seemed to have a bad word to day about it. I was knee deep in Latex by that point though so I decided to stick with it and come back to Typst when I had a chance. I must admit one of the things that put me off Typst at first was the pay for version. I’ve see too many pieces of software like this disappear behind a paywall and I want to be able to access my documents for years to come.

Installation

Download

Anyway, the time has come to give Typst a shot. The first stumbling block is installation as it’s not packaged for Debian yet. Just so that we’re clear I’m installing the free and open source CLI version of Typst. The app developers recommend paying for the Web version which, if I’m honest, isn’t a bad idea if you want to collaborate on documents.

Start by visiting the GitHub page for Typst here: https://github.com/typst/typst. There you should find a link to the releases page (currently here). At the top of the page you should find the latest release which at the time of writing is version 0.14. Download the Linux pre-compiled binary which will have a name like: typst-x86_64-unknown-linux-musl.tar.xz – I’m assuming you are working on an x86_64 based machine there are packages for other architectures as well.

Unpacking

Open a command prompt and move the download file to the root of your home directory and then unpack it. The following commands are at least close to what you’ll need, obviously change any paths if yours are different or you want the package somewhere else. Note that I changed the name of the package directory to just “typst” as this makes future management easier.

cd ~/
mv Downloads/typst-x86_64-unknown-linux-musl.tar.xz .
tar xf typst-x86_64-unknown-linux-musl.tar.xz
rm typst-x86_64-unknown-linux-musl.tar.xz
mv typst-x86_64-unknown-linux-musl/ typst

Enter the typst directory and check that the executable is in fact exectuable, a simple ls -la should suffice.

Update Your Path

Typst needs to be on your path in order to be easily executed. The path is simply where the system looks for executables when a name is entered. It’s possible to run a program that’s in a directory that’s not on the path but you need to specify the whole path every time which gets boring quickly. To change your path variable you need to make a small change to your shell configuration file.

cd ~/
nano ./bashrc

At the bottom of that file add the line shown below but with username changed to whatever your username is.

export PATH=$PATH:/home/username/typst

Close the console and reopen it, this will cause the .bashrc file to be read again. When you run echo $PATH now in the console you should find the typst directory at the end. Note that for your whole desktop environment to recognise this change you’ll need to log out and back in.

To quickly verify you’ve set your path correctly and Typst can be reached run the following test:

cd ~/
typst udpate

Switching to the home directory tests that the path is set correctly. The command checks that the Typst executable runs. It will almost certainly respond with “Already up-to-date”.

Setting up an IDE

Installing Plugins

Typst can be used with just a text editor and the command line but I much prefer to use an IDE with syntax highlighting and other quality of life features. The most popular IDE at the moment is (almost certainly) Visual Studio Code (aka VSCode). VSCode is a Microsoft product so you’ll be signing over your first born child if you use it. If you don’t like that idea you can use VSCodium which has all the telemetry stripped out but a few extensions can’t be installed.

Install the “VSCodium” package from Flatpak. Note that some additional settings are required to use the integrated console, this is mentioned on the Flathub page. Open the extensions library (left hand vertical menu) and enter “typst” in the search field so see a selection of extensions that are related. I’ll be installing “Tinymist Typst” and “vscode-pdf”.

Testing

Create a new Typst file (File > New File) call it “foo.typ” and save is to your desktop. You’ll notice at the top of the document some options: Profile, Preview, Export PDF and More. If you select Preview the window will split and a blank PDF will be displayed on the right.

Type “Hello World!” into the document, you should see it appear on the right in the PDF in almost real time. Change that to “= Hello World!” to make a title. Y ou’re well on your way to being an author. If you want to export a PDF of your work just click export.