[tex-eplain] hyphenation patterns in plain TeX

Karl Berry karl at freefriends.org
Tue Aug 18 01:48:02 CEST 2009


Hi John and all,


    Sorry if this seems a silly question, but does anyone know how to
    access the hyphenation patterns for different languages within a
    plain TeX set up

If using xetex, pdftex, etex with eplain.tex (as opposed to eplain.fmt),
I think something like this will work (but didn't actually try it):

\eplainsetlanguage{portuguese}{2}{3}

{\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
}
}

(This is what we do for Texinfo, more or less.)  Hope that can get you
going.

If using eplain.fmt, since it loads babel -- which I'd actually never
realized before -- I think the "lang@" in the above needs to be replaced
with "l@".  Difference between using language.def and language.dat.

The above is certainly less than what Babel's \selectlanguage does, but
it might be all that's relevant to plain.  Maybe Babel doesn't really
work with plain and we should just abandon it in eplain.ini?

    dan> What goes in your file is hard to find out. It is claimed that

Indeed.  Oleg, we should write something about this in the manual.
Either explaining the plain Babel usage, or we could replace Babel with
using language.def, etc., as we do in Texinfo.  Probably the right
\eplainsetlanguage macro should be included, too.

I've never tried to use polyglossia with Eplain.  I'd be amazed if the
necessary LaTeX packages could all be loaded.  Another experiment for
Oleg's list :).

Thanks,
Karl


More information about the tex-eplain mailing list