Typst currently support breaking a paragraph into several consecutive lines in source code, without introduce a newline in result PDF. The single newline in source code will just become a space. However, when working with scripts that do not using spaces between words, like Chinese and Japanese, we often not want to have the newline, nor the space.
In a paragraph like this:
In Chinese context, the most sensible result is 中文测试, without any spaces and newlines.
I propose implementing the following features in typst:
- Eliminate spaces between CJK characters in source code.
- Let trailing comment consume a linebreak in source code.
This is because sometimes we have a inline frame and CJK detect will not work, so we need an opt-in method. I think the changed behavior can be minimal, comments will consume new line only if it has no space before it.
For example, this code
becomes abc def
and
becomes abcdef.
Latin users often use the former one so they will not be affected.
Typst currently support breaking a paragraph into several consecutive lines in source code, without introduce a newline in result PDF. The single newline in source code will just become a space. However, when working with scripts that do not using spaces between words, like Chinese and Japanese, we often not want to have the newline, nor the space.
In a paragraph like this:
In Chinese context, the most sensible result is
中文测试, without any spaces and newlines.I propose implementing the following features in typst:
This is because sometimes we have a inline frame and CJK detect will not work, so we need an opt-in method. I think the changed behavior can be minimal, comments will consume new line only if it has no space before it.
For example, this code
abc defand
abcdef.Latin users often use the former one so they will not be affected.