[tex-eplain] Hyphenation patterns (again)

John Was john.was at ntlworld.com
Wed Oct 28 17:25:16 CET 2009


Hello

I've been using (in plain XeTeX) the code for invoking Latin hyphenation kindly supplied by Oleg (I think - apologies if it was someone else), viz.:

{\catcode`@=11

\gdef\eplainsetlanguage#1#2#3{%

% do not set the language if the name is undefined in the current TeX.

\expandafter\ifx\csname lang@#1\endcsname \relax

\message{no patterns for #1}%

\else

\global\language = \csname lang@#1\endcsname

\fi

% but there is no harm in adjusting the hyphenmin values regardless.

\global\lefthyphenmin = #2\relax

\global\righthyphenmin = #3\relax

}}%



To load Latin hyphenation patterns I use:



\def\latin{\eplainsetlanguage{latin}{2}{3}}



and then I can just say \latin when I need it.



However, although I've been using \latin within a group, I find that it imposes the patterns throughout after it has been invoked, and that it also obliterates any manual \hyphenation{....} exceptions that I have previously loaded.  The last issue might be quite complicated to sort out, I guess, but I would like at least to know how to get back to plain TeX's default hyphenation.  If the grouping doesn't work then I suppose what I need is something like:



\def\english{\eplainsetlanguage{english}{2}{3}}



so that I can then just give \english to get back to English hyphenation.  But using 'english' or 'UKenglish' or one of the other synonyms listed in the Babel documentation just results in a 'no patterns loaded' message.  What should I be doing to get back to the default hyphenation patterns?



I realize that in plain (Xe)TeX there isn't the full funcionality of Babel (let alone polyglossia) but the Latin hyphenations have proved basically reliable, the only nuisance being that I then get a division such as ho-spital or 'bin-ding' when I am back in English.  And as I say, the obliteration of previously invoked custom hyphenations is an additional problem which it would be good to have ironed out if that is possible.



Suggestions much appreciated!





John








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-eplain/attachments/20091028/082a69ca/attachment.html>


More information about the tex-eplain mailing list