How to allow linebreaks without showing hyphens?

I have a long string without whitespace (like a DNA sequence). I would like this to automatically be broken over multiple lines when the page edge is reached, but without hyphens:

The sequence is ABCDEFG
HIJ and it does stuff.

rather than

The sequence is ABCDEFG-
HIJ and it does stuff.

Is this possible in Typst?

Hello!

Typst doesn’t currently have a proper way to do this, see #674.

The best you can do right now is to use a regex show rule, to insert zero width spaces (\u{200B}/#sym.zws) between the characters of your long strings. This has the very bad side effect, that search does not work in most pdf viewer.

1 Like