I've used hyphenrules
to add custom hyphenation to the languages I write in. I once asked how to do this, and the accepted answer (MWE below) no longer compiles, but gives the error message Environment hyphenrules undefined
.
So the question is, how should one add language specific custom hyphenation rules with polyglossia
now? I'm using version 1.49 of polyglossia
.
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{nynorsk}
\begin{hyphenrules}{nynorsk}
\hyphenation{fram-halds-skulen}
\end{hyphenrules}
\begin{document}
\parbox{0pt}{\hspace{0pt}framhaldsskulen}
\end{document}
EDIT
Following Ulrike's comment, I've tried to follow section 5.1 in the polyglossia documentation, where it says we can use the command \xpghyphenation
. Doing so, however, only gives me the error message Undefined control sequence. l.6 \xpghyphenation
.
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{nynorsk}
\xpghyphenation{nynorsk}{fram-halds-skulen}
\begin{document}
\parbox{0pt}{\hspace{0pt}framhaldsskulen}
\end{document}
\xpghyphenation
. I've tried, but only get the errorUndefined control sequence. l.6 \xpghyphenation
.\xpghyphenation
is a typo, see github.com/reutenauer/polyglossia/issues/413. It has for some reason still not been corrected in the documentation.hyphenrules
was not to give hyphenation exceptions in the preamble, it is to use only the hyphenation patterns of the specified language)