I have a file mylanguage.tex
that contains hyphenation patterns for mylanguage
:
\newlanguage\mylanguage
\begingroup
\language\mylanguage
\patterns{
1b
}
\endgroup
And a test file foo.tex
:
\documentclass{article}
\language=\mylanguage
\usepackage{testhyphens}
\begin{document}
\begin{checkhyphens}{}
foobar
\end{checkhyphens}
\end{document}
I expect the word foobar
in foo.tex
to be tokenized as foo-bar
.
To compile everything, I do this:
xelatex -jobname=mylanguage -ini "&xelatex mylanguage\dump"
xelatex -fmt mylanguage foo
However, the first command outputs this error message:
Too late for \patterns.
The corresponding help message says:
All patterns must be given before typesetting begins.
I tried to ignore the error message and proceed, and indeed manage to output a PDF at the end, but my custom hyphenation pattern are ignored and I get foobar
without hyphens in the output.
What am I doing wrong?