Is hyphenation disabled in words with apostrophes?

Note: what follows relates to Italian, but the same issue arises in French; I’m pretty sure I reproduced this behaviour in English, but it’s not that easy to distinguish between a bug and the complexity of English hyphenation…

Words preceded by an article and an apostrophe (such as l’impossibilità) are not hyphenated; this also applies to pronoun-apostrophe-word as in the example given.

This code does not hyphenate t’ispiri:

#set page(width: 45mm, height: 42mm)
#set text(lang: "it")
#set par(justify: true)

traggi un suono di crudo lamento,
o t'ispiri il Signore un concento

This does, with a soft hyphen, but it is only practical on very small documents, and pretty wysiwyg:

#set page(width: 45mm, height: 42mm)
#set text(lang: "it")
#set par(justify: true)

traggi un suono di crudo lamento,
o t'is#(sym.hyph.soft)piri il Signore un concento

Am I missing some parameter for the hyphenation algorithm or something?

Relates to this tracked issue: French words not hyphenated when containing apostrophes · Issue #7087 · typst/typst · GitHub

Edit: As a workaround for now, hyphenation works if you bypass the smartquotes by using the apostrophe symbol directly.

U+02BC : MODIFIER LETTER APOSTROPHE {apostrophe}

French
#set page(width: 5em, height: auto)
#set text(lang: "fr", hyphenate: true)

J'étais sûre qu'ils ne mʼaccepteraient pas.

Italian
#set page(width: 45mm, height: 42mm)
#set text(lang: "it")
#set par(justify: true)

traggi un suono di crudo lamento,
o tʼispiri il Signore un concento

Merci for the workaround and for pointing out the issue --I admit I didn’t check the typst repository.

I am quite weary at adopting the workaround with U+02BC for aesthetic reasons (document quality…), even though it would be a global solution with little effort.

De rien. I am sure this will be fixed in due time. If you find another way, please post it here ;)

For what it’s worth, to my understanding using sym.wj after the apostrophe should work, but it doesn’t:

traggi un suono di crudo lamento,
o t'#(sym.wj)ispiri il Signore un concento

In my mind, it should instruct typst that those are two distinct words and that it can’t break after the apostrophe; well, no, it still does no hyphenation.

Word joiner - Wikipedia is not perfectly clear to me. I was looking for a zero-width non-breakable space and I landed there.

Anyway, after reading the github issue, I also am confident that someone will fix this.

1 Like

Good idea about the zero width space. This is sym.zws. It also works:

#set page(width: 5em, height: auto)
#set text(lang: "fr", hyphenate: true)

//Broken
J'étais sûre qu'ils ne m'accepteraient pas.

J'étais sûre qu'ils ne m'"accepteraient" pas.

--

//Workaround with zws
J'étais sûre qu'ils ne m'#sym.zws\accepteraient pas.

J'étais sûre qu'ils ne m'"#sym.zws\accepteraient#sym.zws\" pas.

--

//Workaround with no smartquote
J'étais sûre qu'ils ne mʼaccepteraient pas.

J'étais sûre qu'ils ne m'« accepteraient » pas.

The sym.zws was in effect my solution for the document I was preparing; but then I realized that it inserts a point-of-linebreaking after the apostrophe; rightly so, I guess.

So I searched for a sym.zwnbs (which doesn’t exist), and that’s where I landed on sym.wj

Ok, it’s a galactic mess: Apostrophe - Wikipedia

–but why I never had to worry about all of this doing professional TeX and LaTeX in a phisics edition house striving for quality, during years? Mistery

I suspect because of smartquotes? I mean you could try turning that off for the whole document, but would have do deal with the guillemets by yourself, which is a pain…

Ok, I passed by your first mention of smartquoting, but I will not dodge the second.

I foresee I’ll be in for a session of source reading in a git clone of typst, but well…