I’m writing a document in Swedish with Babel and feel that the hyphenation is rather strange. And I can’t seem to find any rules defined specifically for Swedish in either babel or polyglossia. Are there really no rules defined? (Or is it simply that I don’t know what I should be looking for.)
1 Answer
The hyphenation patterns for Swedish are in
/usr/local/texlive/2022/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyph-sv.tex
(or similar location depending on the flavor of TeX Live on one's system, or on MiKTeX).
They've been essentially unchanged since 1994.
The last changenote in the file reads
% - 1994-03-03: The hyphenated dictionary now contains about 118,000 words.
% The hyphenation now works much better for compound words.
% Patgen parameters 1 2 20, 2 1 8, 1 4 7, 3 2 1, 1 10000 4.
and the final annotation is
% These hyphenation patterns work quite well for simple words, but not
% quite as well for compound words. I'm working on improving the quality,
% by adding more words. If you know any Swedish words which are not
% correctly hyphenated using these patterns, or if you have questions or
% comments, please contact me:
I'm not sure the following email address is still valid.
My guess is that they work quite well, given that they've not been updated for almost 30 years.
Of course, some care is still needed for compound words, like for German, because some clusters at the join of two words might be mistaken for a hyphenatable pattern. Indeed babel-swedish
has shorthands similar to those for German right for this purpose
-
That looks very promising. And these are activated through
\usepackage[swedish]{babel}
? Jan 20 at 18:40 -
2@FredrikP Yes, though it is preferable to give
swedish
as an option to\documentclass
. That way, other packages that care about the language get it, too. Jan 20 at 18:45