[tex-hyphen] Customizing patterns

Javier Bezos listas at tex-tipografia.com
Tue Feb 9 12:12:15 CET 2010


Hi,

Below is the first working attempt. Tested with latex and
eplain. (Can i attach files?, to send several files.)

Cheers
Javier

==========

\begingroup
% Test whether we received one or two arguments
\def\testengine#1#2!{\def\secondarg{#2}}
% That's Tau (as in Taco or ΤΕΧ, Tau-Epsilon-Chi), a 2-byte UTF-8 character
\testengine Τ!\relax
% Unicode-aware engine (such as XeTeX or LuaTeX) only sees a single 
(2-byte) argument
\ifx\secondarg\empty
     \message{UTF-8 Spanish Hyphenation Patterns}
\else
     \message{EC Spanish Hyphenation Patterns}
     \input conv-utf8-ec.tex
\fi

% Partial loading
\def\includepatterns#1{1\localhyphenignore#11}
\def\switchpatterns#1#2{\if#1#20\fi}
\def\gobble#1{}
\let\localhyphenignore\gobble
% Load
\input hyph-es.tex

\expandafter\ifx\csname addlanguage\endcsname\relax\else
   \openin0=localhyph-es.conf
   \ifeof0
   \else
     \input localhyph-es.conf
     \ifx\localhyphenignore\gobble\else
       \addlanguage\l at localspanish
       \global\let\l at localspanish\l at localspanish
       \language=\l at localspanish
       \input hyph-es.tex
     \fi
     \global\let\localhyphenspanish\localhyphenignore
   \fi
   \closein0
\fi

\endgroup


More information about the tex-hyphen mailing list