💾 Archived View for tilde.club › ~crmsnbleyd › first-look-at-typst.gmi captured on 2024-08-31 at 12:34:11. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-03-21)
-=-=-=-=-=-=-
Title: Making a resume in typst on my first time using it
Date: 2024-01-18
I decided to update my resume today, just for fun. I originally wrote it in Overleaf, the online LaTeX compiler, but for a while, I've been meaning to rewrite it in Emacs' native org mode (which has native HTML and LaTeX export capabilities), or something like JSON resume, so that I could change the content with ease.
However, the creator of typst-ts-mode for emacs is on my Mastodon server, and a post from them inspired me to check it out.
Typst is a relatively new system for typesetting documents. It aims to be as powerful as LaTeX while being easier to learn. It also has scripting capabilities. I rewrote my whole resume in it on a whim.
Both the web application and the command-line version are fast, giving almost instant updates when you change the inputs, especially when compared to LaTeX offerings like Overleaf or python PDFLaTeX.
Typst definitely leans more towards markdown than something like troff, where you're likely to see more markup than actual content. When you write Typst, you can write more content, with unobstrusive markup while in LaTeX it's definitely more in the way.
In LaTeX, most things you would want to do require plugins.
Typst takes more of the Python approach, giving you many of the tools that you might need. The typst reference is really useful, and looks pretty to boot!
You can associate every instance of an item with some functions or rules that will be executed whenever they are used.
Given is an example of styling a link. We pass a function that is executed whenever we create a link, which wraps it in a box (the equivalent of `<span>` in typst), sets the text colour to blue in the box and underlines the link (which we can refer to by the name "item" anywhere we want in this function)
This, in my opinion, is a very elegent way of adding callbacks and the like. Also cool is that the `#set` command is only valid inside the box we create, sort of like block scope in C-like languages.
#show link: item => box[ #set text(blue) #underline(item) ]
If you call a function in regular text, you do it like so: `#function(parameter)`. Similarly you can set a variable and use it as `#variable`
If you want to call it inside a function, you do `function(parameter)` or `variable`
If you want to use a passed parameter in a function, you simply use it: `parameter`.
If you want to concatenate items in a function, you need to use semicolons: `parameter; line(length: 100%)`
If you want to use regular markup like _emphasis_ or **bold**, you need to wrap it in square brackets, but within square brackets you need to pass the parameter like a variable: `[*#parameter*]`
Functions also have a special way of calling it if you want them to transform text, like `function[body]`, where the body can have any regular text with inline markup.
I sort of get why they did this and understand it now, but your mileage may vary.
You can find the resume template using which I explored typst at this link. It is also available on the typst application as a project that you can copy. Let me know if you end up using this, or if you would like some clarification.
[image: Screenshot of the resume template given above]
**You can change any of the colours to your liking!**
I used the typst CV by Alex Chi Z. as a starting point, it is well annotated and has an example of almost every syntactical feature a beginner would want to use.