reutenauer / polyglossia

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

Mismatch between documentation and actual behavior of babelshorthand `"-` #623

Closed tlikonen closed 4 months ago

tlikonen commented 6 months ago

There is a mismatch between the documentation and actual behavior of babelshorthands character "-, at least in the Finnish language. The option babelshorthands and its character "- is documented like this:

"-  adds a hyphenation point that does still allow for hyphenation at the
    points preset in the hyphenation patterns (as opposed to \-).

The above quoted text seems to suggest that "- is like Tex \- (i.e. possible hyphenation point) except that "- permits hyphenation anywhere in the word. But the actual behavior of "- is like the next documented character "~ which is explained like this:

"~  for a hyphen sign without a breakpoint. Useful for cases where the
    hyphen should stick at the following syllable.

Both "- and "~ do the same: create an explicit hyphen character with no hyphenation point after the character. Hyphenation is allowed elsewhere in the word.

Babel package's documentation for Finnish (finnish.pdf) is a bit different but it has characters "- and "= which work seemingly identically as Polyglossia's "- and "~. See: https://ctan.org/pkg/babel-finnish

jspitz commented 6 months ago

Thanks, fixed for the next release. The irritation came from the fact that babel-finnish heavily derives from the shorthand definitions common in other languages, which we overlooked.

tlikonen commented 6 months ago

You added "= in the documentation but it seems to behave like plain -, i.e. there is a breakpoint after "=. In Babel "= does not break after it. It's like "-. I'm using Polyglossia version 1.59 (as packaged by Debian).

jspitz commented 6 months ago

No, "= does not allow a break after the hyphen, while plain - does.

jspitz commented 6 months ago

(that is, after 3b51ea8ac9e6)

jspitz commented 6 months ago

(that is, after 3b51ea8)

Before that, we used the definition as common e.g. in German: Add an explicit hyphen with a breakpoint, but as opposed to plain -, also allow for hyphenation at the other points defined in the hyphenation patterns. I changed it to have this shorthand behave as in babel-finnish, and since it was not yet documented, we could safely do it.