typst / typst/hypher

Wrong hyphenation of German word "Staubeckenbegrenzungsmauer"

Open
#33 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TeX
Stars
142
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Description

Using justification can lead to wrong hyphenation

#set page(
  paper: "a4",
  margin: 2.7cm,
)


#set text(
  font: "New Computer Modern",
  size: 13pt,
  lang: "de",
)
 
#set par(
  justify: true,
  justification-limits: (spacing: (min: 66.67% + 0pt, max: 150% + 0pt), tracking: (min: -0.01em, max: 0.015em))
)

Staubecke Staubecke Staubecke Staub Staubecke Staubecke Staubecke Staubeckenbegrenzungsmauer

Leads to a hyphenation of the last word as "Staube-ckenbegrenzungsmauer". "Staubecken" is ambiguous it could either be "dusty corners" and then hyphenated as "Staub-ek-ken" or be "water retention basin" and then hyphenated as "Stau-bek-ken". While testing, what Typst would do, it did a third thing, that is wrong no matter what.

The wrong hyphenation vanishes when the justification-limits are removed, therefore it is a bit hard to trigger.

hyphenationtest.pdf

Operating system

Linux, Web app

Typst version
  • I am using the latest version of Typst

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Typst snippet in the issue and reproduce the split of “Staubeckenbegrenzungsmauer” while justification-limits are enabled. Compare the resulting hyphenation with the behavior when those limits are removed, then trace the hyphenation path responsible. Done means the word no longer receives the incorrect “Staube-ckenbegrenzungsmauer” split in the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
tex
Domain
internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.