How to make abbreviations containing period inseparable?

Currently when writing abbreviations such as “e.g.” and “i.e.”, typst treats them as separate sentences, and adds spaces and breaks them across lines as necessary, for example:

There is a feature request for this issue, to add something similar to \@ in Latex. Is there any workaround for this issue in 0.12? Thanks!

1 Like

Just wrapping them in a #box should prevent the abbreviation from being broken across lines, I think. You can automate this with show rules like show "e.g.": box

1 Like

Indeed that makes sure it doesn’t break across lines; however, they are still treated as essentially two sentences so the large spaces in between and after. Ideally, “e.g.” should be seen as a single word.

Hey @my4ng, welcome to the forum! I’ve updated your post title to better fit our guidelines for question posts: How to post in the Questions category

Make sure your post title is a question you’d ask to a friend about Typst. :wink:

1 Like

I cannot reproduce the wrong spacing and it would surprise me as Typst doesn’t really have a notion of sentence spacing as far as I know—even with justification enabled. "e. g." looks weird yes but that would be incorrect anyway.

Apologies. It appears the issue that I have used a show rule for period meant for maths mode. After I restricted it to maths, this doesn’t appear again.