#Disallow line breaks in the middle of units

4 messages · Page 1 of 1 (latest)

tame basin
#

In some texts, physical units of ratio like 'mg/l' should not break across lines. By default, Typst does this due to the "/" symbol.

Here is an example of this happening:

aaaaaaaaaaaaaaaaaaaaaaaa aaaaahhfahfah sfuahsfuahsfuahsfuhas ufhaushfuahsfhusffsfsfsfsfsfaa mg/cl aaa

Has anyone found a nice way of keeping this fraction together? Automatic or manual is both fine. I found that using inline math can help (e.g. $"mg" slash "cl"$) though this will use math font so it's a tiny bit more annoying to work around. If there's an easier way, I'd love to hear it. 🙂

analog gull
#

easiest way to make sure text doesnt break is to just wrap it in box

tame basin
#

Wow I can't believe I didn't try that. Thanks it helped!

silk zealot
#

You can also use the rule show "mg/cl": box
This way every occurrence of these letters can't break across lines