reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
187 stars 52 forks source link

Custom hyphenation rules not respected for a teletype font #573

Closed robertsawko closed 1 year ago

robertsawko commented 1 year ago

Hi,

I am writing a document where we use a lot of Python and C++ class names. We decided to use a teletype font so we tend to have a lot of \texttt{camelCaseClassName}. Unfortunately, some of them are quite long. I added some hyphenation rules for the ones which are causing trouble in the text. I did it using \hyphenation{a-b-c}. This seems to work without the teletype font and in italics (\textit), but when I force teletype I end up having long words sticking out into the margins.

Can you please advise whether there is a way to fix it or if it is intentional or something that needs to be fixed in the package. Thanks.

jspitz commented 1 year ago

That's a TeX design decision. \texttt is not hyphenated at all by default. The hyphenat package provides a way to escape this.