[luatex] How to change hyphenation codes with the change of \language in LuaTeX?

Igor Liferenko igor.liferenko at gmail.com
Fri Oct 9 23:42:41 CEST 2015

In different languages, one and the same character may and may not be
used in hyphenation. For example: in English, quote (') can not be
part of word, whereas in French it is part of word.

Normally, one has to do \lccode`\'=`\' and \lccode`\'=0 manually each
time when changing language. By using \savinghyphcodes=1 this is done

By compiling the following examples, we show that the word *is*
hyphenated in the second case, in spite of the fact that \lccode`\' is
zero. This is because \savinghyphcodes=1 is used.

    $ cat `kpsewhich hyph-fr.tex` | iconv -f utf8 -t cp1252 > hyphfr.tex

Create myfmt.ini:

    \input plain
    \newcount\n \n=128 \loop\ifnum\n<255 \lccode\n=\n \advance\n by1\repeat
    \input hyphfr

Generate new format:

    $ etex -ini -etex myfmt.ini

Create test.tex:

    \the\lccode`\'\ l'installation
    \hbox to 10em {\hrulefill}
    \the\lccode`\'\ l'installation
    \hbox to 10em {\hrulefill}
    \the\lccode`\'\ l'installation

Compile test.tex with new format:

    $ etex -fmt myfmt test.tex

Show the output:

    $ xdvi test.dvi

How to achieve with LuaTeX the same functionality as was demonstrated
with e-TeX?

More information about the luatex mailing list