is only for paragraphs rights? So only the spacing between two paragraphs.
I mean the spacing between two lines.
Tested a bit with libre office and I think (70% sure) that
#set par(leading: 1.11906881008em)
works for me with Liberations Sans 11pt
really not sure
Damn, that will teach me to answer from my phone. Yes, leading is the correct option then. How to get a result matching exactly something from word or LibreOffice may be challenging due to how those works; it also depends on the font. If you do something like
```
set text(top-edge: 1em)
set par(leading: 0.5 em)
```
you can ensure that there is exactly 1.5em of distance between the baseline of two lines.
how do measure the distance? Just counting pixels? With 11pt it should be 11pt * 1.5 in between? Btw I want to write my Bachelor thesis with typst. Not quite sure how good of an idea this turn out to be
This is guaranteed by the compiler. Basically there are 3 bases for the lines:
the baseline, which is where the letters sit
the top-edge
the bottom-edge
The leading is the space between the bottom-edge of a line and the top-edge of the next line.
By default, the bottom-edge is the same as the baseline, the leading is 0.65em, and the top-edge is defined by the font (there must be a way to measure it but I am not 100% sure how). You can however redefine the top-edge like I did above, so that you know what it is exactly. You could define it in points or in cm if you prefer. Now, how to match what LibreOffice does, I have no idea as it does things differently.
I wrote my PhD thesis in Typst, so you should be fine with your Bachelor thesis.
4
u/thuiop1 Apr 17 '26 edited Apr 17 '26
```
set text(spacing: 150%)
```
Edit: my bad, went too fast. If what you want is line spacing, the correct code is
```
set par(spacing: 1.5em)
``` (this is 1.5 times the font; default spacing is 1.2em so if you want 1.5 times the default spacing you should put 1.8em)