[tex-hyphen] multiple patterns files

Mojca Miklavec mojca.miklavec.lists at gmail.com
Sat Jul 27 09:47:43 CEST 2013


On Sat, Jul 27, 2013 at 12:33 AM, Karl Berry wrote:
> Hi Javier,
>
>     loading multiple patterns files for a single language (the request
>     is for Serbian in Unicode engines,
>
> Why?

The language can be written in either Latin and Cyrillic script. None
of them is default (which one to use is a totally personal choice) and
both scripts can often be mixed. There is no technical reason why one
should be forced switch the hyphenation patterns when mixing the
scripts in a document (unless in pdfTeX where both cannot be active at
the same time).

But if you look at the loader this is already what's happening:

>From the loader (pdfTeX/XeTeX):

\ifx\secondarg\empty
    % Unicode-aware engine (such as XeTeX or LuaTeX) only sees a
single (2-byte) argument
    \message{UTF-8 Serbian hyphenation patterns}
    % We load both scripts at the same time to simplify usage
    \input hyph-sh-latn.tex
    \input hyph-sh-cyrl.tex
\else
    % 8-bit engine (such as TeX or pdfTeX)
    \message{EC Serbian hyphenation patterns in Latin script}
    \input conv-utf8-ec.tex
    \input hyph-sh-latn.tex

>From language.dat.lua:

-- from hyphen-serbian:
['serbian'] = {
loader = 'loadhyph-sr-latn.tex',
lefthyphenmin = 2,
righthyphenmin = 2,
synonyms = {  },
patterns = 'hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt',
hyphenation = 'hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt',
},
['serbianc'] = {
loader = 'loadhyph-sr-cyrl.tex',
lefthyphenmin = 2,
righthyphenmin = 2,
synonyms = {  },
patterns = 'hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt',
hyphenation = 'hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt',
},

>     but it could be useful in other contexts).
>
> Where?

One example that comes to my mind would be Russian texts with lots of
latin words (loading English and Russian patterns). But that's mostly
for private use (users would add their own entries to language.dat)

Mojca


More information about the tex-hyphen mailing list