You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cjkChinese, Japanese, Korean typography.feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.
文章分析了多种排版软件(如 Word, InDesign, QuarkXPress)对标点悬挂的支持和设置,并指出其背后的算法逻辑。结论是,标点悬挂不应被盲目推崇或作为唯一解决方案。正确的排版需要一个系统性的设计逻辑,综合考虑标点挤压、避头尾、行长、字距调整等多个因素,其应用需要根据具体情境(如行长、文本类型、整体设计风格)进行判断,而不是一刀切地“挂”或“不挂”。文章最后提出了一些值得进一步探讨的中文排版需求问题。
LLM summary (English)
The article "The Greatest Misconception in Chinese Typesetting: Hanging Punctuation" examines the typographic technique known as "hanging punctuation." The author argues that while hanging punctuation is often seen as a hallmark of refined typesetting, it actually originates from the Western concept of "optical margin alignment," primarily aimed at addressing the visually uneven edges caused by the varied shapes of Latin letters.
The article emphasizes that directly applying Western logic to Chinese typesetting is inappropriate. The core of Chinese typesetting lies in "line-start/line-end prohibition rules" (avoiding certain punctuation at the beginning or end of lines) and "punctuation compression/adjustment." Hanging punctuation is presented merely as one optional method within the strategy for handling line-end punctuation, not a necessary condition. The author contends that priority should be given to adjusting punctuation spacing within the line (compression) to maintain the essence of Chinese "solid setting" and grid alignment, rather than simply hanging punctuation for edge alignment.
The article analyzes how various desktop publishing software (like Microsoft Word, Adobe InDesign, QuarkXPress) implement hanging punctuation and explains the underlying algorithms. The conclusion is that hanging punctuation should not be blindly championed or used as a universal solution. Correct typesetting requires a systematic design logic that considers multiple factors holistically, including punctuation adjustment, line-start/line-end rules, line length, character spacing, and overall design intent. The decision to use hanging punctuation should be based on specific contexts (e.g., line length, text type, design style) rather than being applied uniformly. The article concludes by posing further questions about Chinese typesetting requirements worthy of discussion.
For Chinese, set par(justify: true) kind of eliminates the need of set text(overhang: true).
changing text.overhang from bool (default: true) to bool | auto (default: auto, which resolves to true/false according to text.lang),
and adding back '\u{3001}' | '\u{3002}' => 1.0 to overhang()
Yeah, I know it's possible to fix this problem directly in the rust code, essentially reverting #1211. Though I wish more parts of the layout engine could be directly accessed in the Typst scripting language, since this is a stylistic choice, not a rule, e.g.
probably it should also have a global variable that encodes the default overhang table.
For Chinese, set par(justify: true) kind of eliminates the need of set text(overhang: true).
I don't really agree with this part. Overhang is only useful when paragraph justification is enabled, where the optical misalignment, i.e. jagged spaces, of the left and right edges are more prominent. To reference an image in the article you mentioned:
It's something extra to justification, and it's a stylistic choice to prefer outward protrusion over inward jagged spaces. Sometimes there won't be any flexible spaces within a line to move the punctuation elsewhere without creating more inter-character spacing.
I feel like the main confusion about this technique being not necessary is that the quality of typesetting in most Chinese publications are limited by the tools, with this feature not being widely available, so it's hard to find high quality examples of typesetting in Chinese, especially ones that use this feature with care. It can be helpful to think about how to do this with pen and paper without the constraints of existing typesetting tools, rather than looking for existing examples designed by other tools to decide what a tool should do. It can be a vicious cycle that never leads to any improvements.
Reacted by Lingkang and Serenade600
Reacted by Y.D.X., Serenade600, Joseph Alexander Wilson and Kirill Lukashev
cjkChinese, Japanese, Korean typography.feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.
Activity
Krasjet commentedon Jul 10, 2025
might be related #261
YDX-2147483647 commentedon Jul 26, 2025
A possible fix would be:
changing
text.overhangfrombool(default: true) tobool | auto(default: auto, which resolves to true/false according totext.lang),and adding back
'\u{3001}' | '\u{3002}' => 1.0tooverhang()typst/crates/typst-layout/src/inline/line.rs
Lines 632 to 651 in e9f1b58
An explanatory article: The Biggest Myth in Chinese Typesetting: Punctuation Overhang 中文排版的最大迷思:标点悬挂 (thetype.com) (Chinese only)
LLM summary (Chinese)
文章《中文排版的最大迷思:标点悬挂》探讨了“标点悬挂”这一排版技术。作者指出,虽然标点悬挂常被视为精致排版的标志,但它实际上源自西方的“视觉边距对齐”(Optical Margin Alignment),主要目的是为了处理西文字符形状不一导致的视觉边缘不齐。
文章强调,简单套用西文逻辑到中文排版并不合适。中文排版的核心在于“避头尾”规则和“标点挤压”,而标点悬挂只是处理避头尾的一种可选方式,而非必要条件。作者认为,相较于单纯追求行尾对齐的悬挂,更应优先考虑行内标点的挤压处理,以维持中文“密排”和网格的整齐感。
文章分析了多种排版软件(如 Word, InDesign, QuarkXPress)对标点悬挂的支持和设置,并指出其背后的算法逻辑。结论是,标点悬挂不应被盲目推崇或作为唯一解决方案。正确的排版需要一个系统性的设计逻辑,综合考虑标点挤压、避头尾、行长、字距调整等多个因素,其应用需要根据具体情境(如行长、文本类型、整体设计风格)进行判断,而不是一刀切地“挂”或“不挂”。文章最后提出了一些值得进一步探讨的中文排版需求问题。
LLM summary (English)
The article "The Greatest Misconception in Chinese Typesetting: Hanging Punctuation" examines the typographic technique known as "hanging punctuation." The author argues that while hanging punctuation is often seen as a hallmark of refined typesetting, it actually originates from the Western concept of "optical margin alignment," primarily aimed at addressing the visually uneven edges caused by the varied shapes of Latin letters.
The article emphasizes that directly applying Western logic to Chinese typesetting is inappropriate. The core of Chinese typesetting lies in "line-start/line-end prohibition rules" (avoiding certain punctuation at the beginning or end of lines) and "punctuation compression/adjustment." Hanging punctuation is presented merely as one optional method within the strategy for handling line-end punctuation, not a necessary condition. The author contends that priority should be given to adjusting punctuation spacing within the line (compression) to maintain the essence of Chinese "solid setting" and grid alignment, rather than simply hanging punctuation for edge alignment.
The article analyzes how various desktop publishing software (like Microsoft Word, Adobe InDesign, QuarkXPress) implement hanging punctuation and explains the underlying algorithms. The conclusion is that hanging punctuation should not be blindly championed or used as a universal solution. Correct typesetting requires a systematic design logic that considers multiple factors holistically, including punctuation adjustment, line-start/line-end rules, line length, character spacing, and overall design intent. The decision to use hanging punctuation should be based on specific contexts (e.g., line length, text type, design style) rather than being applied uniformly. The article concludes by posing further questions about Chinese typesetting requirements worthy of discussion.
For Chinese,
set par(justify: true)kind of eliminates the need ofset text(overhang: true).Krasjet commentedon Jul 28, 2025
Yeah, I know it's possible to fix this problem directly in the rust code, essentially reverting #1211. Though I wish more parts of the layout engine could be directly accessed in the Typst scripting language, since this is a stylistic choice, not a rule, e.g.
probably it should also have a global variable that encodes the default overhang table.
I don't really agree with this part. Overhang is only useful when paragraph justification is enabled, where the optical misalignment, i.e. jagged spaces, of the left and right edges are more prominent. To reference an image in the article you mentioned:
It's something extra to justification, and it's a stylistic choice to prefer outward protrusion over inward jagged spaces. Sometimes there won't be any flexible spaces within a line to move the punctuation elsewhere without creating more inter-character spacing.
I feel like the main confusion about this technique being not necessary is that the quality of typesetting in most Chinese publications are limited by the tools, with this feature not being widely available, so it's hard to find high quality examples of typesetting in Chinese, especially ones that use this feature with care. It can be helpful to think about how to do this with pen and paper without the constraints of existing typesetting tools, rather than looking for existing examples designed by other tools to decide what a tool should do. It can be a vicious cycle that never leads to any improvements.
docs: Add punctuation overhang
YDX-2147483647 commentedon Jan 31, 2026
If #7782 is merged, then the above is possible.
Add test for typst#6582
Add test for typst#6582