[XeTeX] Hyphenation rules problem in my french document

enrico.gregorio at univr.it enrico.gregorio at univr.it
Sun Dec 5 16:01:08 CET 2010


Maxim Cournoyer <maxim.cournoyer at gmail.com> wrote:
> enrico.gregorio at univr.it enrico.gregorio at univr.it  Mon Nov 29 00:16:52 CET 2010
> 
> With this document set up, you should teach XeTeX that a right quote should
> 
> behave like an (ASCII) apostrophe, with respect to hyphenation. So, add
> 
>   \addto\extrasfrench{\lccode"2019=`\' }
> 
> Enrico, this indeed works too! I'm just wondering about the weird quotes needed here. 
> Seems like \lccode keeps an associative table of symbols, and 2019 would be the
> unicode character to be redefined. Are the first " (double quote) and last '\ characters
> always required when using the \lccode macro? (so " would indicate start of redefinition
> and \' indicates en of it?).

Sorry, but your conjectures are false. :)

(Xe)TeX maintains an array for conversions from upper case to lower case. You can
modify an entry in this array with \lccode, with the format \lccode<number>=<number>

In our case we are stating that the entry number "2019 (this is how we specify a number
to (Xe)TeX in hexadecimal form) is `\' (that is, in (Xe)TeX jargon, the number corresponding
to the slot containing the apostrophe in the ASCII code, for TeX, or Unicode, for XeTeX).

This instruction seems not to do anything, since the apostrophe will become a right quote
anyway, "Mapping=tex-text" is passed to fontspec when defining a font family. However,
it does something: it tells XeTeX to consider the right quote just as an (ASCII) apostrophe
as far as hyphenation is concerned, which is precisely what you needed.

If you use other languages, it's probably useful to add

\addto\noextrasfrench{\lccode"2019=0 }

and similar pairs of constructions for languages where the apostrophe must be taken
into account for hyphenation, such as Italian.

Ciao
Enrico

--
Enrico Gregorio          + Dipartimento di Informatica          + Tel: +39 045 8027937
Enrico.Gregorio at univr.it + Università degli Studi di Verona     +
(gregorio at math.unipd.it) + Strada le Grazie 15 / I-37134 Verona + Fax: +39 045 8027928




More information about the XeTeX mailing list