[XeTeX] Hyphenation rules problem in my french document
enrico.gregorio at univr.it
enrico.gregorio at univr.it
Mon Nov 29 00:16:52 CET 2010
From: Maxim Cournoyer <maxim.cournoyer at gmail.com>
> Dear fellow Xe(La)TeXers,
>
> I would appreciate any clues on the following problem:
>
> I am writing a french document, using the \usepackage[francais]{babel} directive in my preamble.
> Some lines of text aren't hyphenated automatically, most of the time because there doesn't seem to be hyphenation rules
> in the hyphenation dictionary for words preceded by "l'" such as in my test document, "l'oscilloscope".
>
> I tried suggesting new rules using the \hyphenation{oscillo-scope} rule, but it does only affect the word "oscilloscope" when it is preceded
> and followed by a space. I can't seem to find a way to tell it to use \hyphenation{l'oscilloscope} without it issuing a warning such as:
>
> * Local config file frenchb.cfg used
> *
> (/usr/local/texlive/2010/texmf-dist/tex/generic/babel/frenchb.cfg)))
> (/usr/local/texlive/2010/texmf-dist/tex/latex/carlisle/scalefnt.sty)
> ! Not a letter.
> l.11 \hyphenation{l'
> oscillo-scope}
>
> Any ideas? I've included the test document below.
>
> Also, I guess I should test it with polyglossia, but I have never used it (and don't have much time to RTM for now). Is it hard to set up?
>
>
> % Test document
> \documentclass[12pt,letterpaper,oneside,draft]{memoir}
>
> \usepackage{fontspec}
> \usepackage{xunicode}
> \usepackage[francais]{babel}
>
> \hyphenation{l'oscillo-scope}
>
> \begin{document}
>
> l'oscilloscope l'oscilloscope l'oscilloscope l'oscilloscope
> l'oscilloscope l'oscilloscope l'oscilloscope l'oscilloscope
> l'oscilloscope l'oscilloscope l'oscilloscope l'oscilloscope
> l'oscilloscope l'oscilloscope l'oscilloscope l'oscilloscope
>
> \end{document}
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=`\' }
just after the call to babel. This is because the default font receives the option
Mapping=tex-text
and so an ASCII apostrophe is seen as a right quote, which doesn't appear in
the hyphenation patterns, while the ASCII apostrophe does.
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