If babel
doesn't know how to hyphenate a word, I can inform it of good line breaks with \babelhyphenation
:
\documentclass{article}
\usepackage[nynorsk]{babel}
\babelhyphenation[nynorsk]{fram-halds-skulen}
\begin{document}
framhaldsskulen
\end{document}
But how do I do this with polyglossia
? The documentation doesn't say anything about it. \babelhyphenation
obviously doesn't work:
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{nynorsk}
\babelhyphenation[nynorsk]{fram-halds-skulen}
\begin{document}
framhaldsskulen
\end{document}
! Undefined control sequence.
l.4 ^^I\babelhyphenation
[nynorsk]{fram-halds-skulen}
?
Best Answer
As usual, in the example the lines are overfull on purpose, so as to force hyphenation.
Use the same trick of
\begin{hyphenrules}
if you have different languages in your document and want to add some hyphenation rules for single words.A possibly better interface:
The
\sethyphenation
command accepts also an optional argument such asvariant=british
, but at the moment it wouldn't do much good, because the same option to\selectlanguage
doesn't seem to have any effect.