# text encoding compatibility

Dear Berthold, Chris, and listeners

BKPH> True, but isn't it in fact awkward in LaTeX 2e to use
> more than one text font encoding in the same job?

CR> What we cannot support (since TeX cannot) is accurate
>  hyphenation [when] incompatible encodings are used
> in the same paragraph.

Chris defends LaTeX not TeX as a whole. This sounds much
worse for TeX itself than it really is. TeX has just one
nasty caprice in this area. Recall that, in the hyphenation,
process, TeX applies the lowercase 'function' before looking
up the possible hyphenation points in the words of a
paragraph. The caprice is that it is the particular value of
the lowercase function (\lccode values) in vigour when the
paragraph is closed that applies *throughout* the paragraph.
That is a wierd limitation when one recalls that any number
of different hyphenation tables can be successively called in
the same paragraph, through the \language primitive.
Clearly, this caprice is no constraint if the natural
lowercase functions for all text fonts involved in the
paragraph are one and the same. This sameness is the basic
TeX encoding compatibility condition.

The LaTeX text encoding compatibility conditions are far more
complex and constraining (ask Chris for details, not me).
LaTeX ultimately required three encodings to cover modern
cyrillic languages (T2A, T2B,T2C). Just one (T2X formerly T2)
suffices amply under Plain TeX and its close cousins.

Larry Siebenmann

---------------------------

PS.  There is a curious gambit I like that weakens even the
basic TeX encoding compatibility condition --- at moderate
cost. Gambit:

* make the \lccode function the identity
* on alphabetics and zero on non-alphabetics

(at least by the end of each paragraph!).  The basic
compatibility condition is then that the
alphabetic/non-alphabetic distinction be the same for all the
text fonts in the same paragraph. The moderate cost of having
this weaker compatibility condition is:
(i) \uchyph=0 then does not prevent hyphenation of words
beginning with an uppercase letter.  But if desired, this can
be done "by hand" (say with a kern).
(ii) normally, words containing capitals will never be
automatically hyphenated near the caps; but specific 'mixed'
patterns can be added to regulate this decently (via
\patterns and \hyphenation.)
(iii) one must obviously use the (rare!) \lowercase
primitive with care to momentarily have suitable
\lccode values.

In Plain TeX, the "impossible" is often within comfortable
reach!

---------------------------