[XeTeX] polyglossia, babel and French hyphenation
Jonathan Kew
jonathan_kew at sil.org
Mon Mar 17 09:29:32 CET 2008
On 17 Mar 2008, at 2:24 am, Cyril Niklaus wrote:
> Hello all,
>
> I'm a bit frustrated by the lack of hyphenation for French, or (more
> likely!) by my lack of ability to get it working.
> I've tried using babel to no avail (it gives me lots of Overfull box
> instead of simply hyphenating the word) so I got the svn version,
> compiled it fine thanks to the provided scripts and then tried
> polyglossia, since M. Charette is a Francophone.
> I've also tried a showhyphens test, but it worked, and the document
> from which this sentence is taken from compiles with only one
> overfullbox if I change the encoding to latin1 and use LaTeX,
I assume that also involves changing the font from Garamond Premier
Pro (to CM or LM or something), so the results are not directly
comparable.
> instead
> of a dozen with XeLaTeX.
>
> What wrong with this document that it will not hyphenate the "comme",
> both with babel and polyglossia?
Checking for relevant settings in frenchb.dtx, I find:
% As French uses the standard values of |\lefthyphenmin| (2)
% and |\righthyphenmin| (3), no special setting is required here.
With \righthyphenmin=3, you'll never get hyphenation that would give
a two-character fragment at the end of the word.
You can confirm that hyphenation is working if you change that
"Comme" to "Comment"; then xelatex will happily hyphenate it as "Com-
ment" (though even then, the line is still slightly overfull). But
with the exact font, size, layout, and text that you've got, it
simply can't find a good enough set of line breaks.
To avoid the overfull boxes, you need to relax the constraints in
some way; a \sloppy declaration is probably the easiest "quick fix",
if you don't want to fine-tune other factors.
JK
More information about the XeTeX
mailing list