Discussion:
Hyphenation question
j***@public.gmane.org
2006-10-13 15:13:07 UTC
Permalink
Why is it that words with an 'apostrophe' such as "l'utilisation" are not
hyphenated by xelatex unless I manually place the hyphenation point for all
instances of the word "l'utili-sation".
When I try to put once and for all "l'utili-sation" in an \hyphenation
list, I get an error message "Not a letter".

Thanks,

Jacques.
Yves Codet
2006-10-13 16:40:57 UTC
Permalink
Post by j***@public.gmane.org
Why is it that words with an 'apostrophe' such as "l'utilisation" are not
hyphenated by xelatex unless I manually place the hyphenation point for all
instances of the word "l'utili-sation".
No idea about this. I never had such an issue, if I remember well.
Post by j***@public.gmane.org
When I try to put once and for all "l'utili-sation" in an \hyphenation
list, I get an error message "Not a letter".
I suppose that it's the apostrophe which is "not a letter". You could
try:

\hyphenation{u-ti-li-sa-tion}

Regards,

Yves
Peter Dyballa
2006-10-13 22:14:04 UTC
Permalink
Post by j***@public.gmane.org
When I try to put once and for all "l'utili-sation" in an \hyphenation
list, I get an error message "Not a letter".
It's the ``-´´. You could try \showhyphens{utilisation l'utili-sation
l'utilisation}.

--
Greetings

Pete

When in doubt, use brute force.
-- Ken Thompson
Jonathan Kew
2006-10-13 22:37:38 UTC
Permalink
Post by Peter Dyballa
Post by j***@public.gmane.org
When I try to put once and for all "l'utili-sation" in an
\hyphenation
list, I get an error message "Not a letter".
It's the ``-´´.
No, sorry, it's not. Putting a hyphen in a \hyphenation{...}
exception is entirely correct. The error comes from the apostrophe,
which is indeed "not a letter" in TeX's view.

This is not specific to XeTeX; standard TeX or LaTeX will behave the
same, unless a package changes the \lccode of the apostrophe
character. Hyphenation patterns and exceptions can contain only
characters with non-zero \lccode. And TeX does not attempt to
hyphenate a "word" that contains embedded non-letters, such as
explicit hyphens or apostrophes.

If you say

\lccode`\'=`\'

then the apostrophe will be acceptable in a \hyphenation entry. Note,
however, that this will also change the limits of what TeX considers
a "word" that can be hyphenated, and this could lead to bad breaks
elsewhere, unless the patterns in use were designed with this in
mind. So be wary.

JK
Peter Dyballa
2006-10-13 23:19:45 UTC
Permalink
Post by Jonathan Kew
Post by Peter Dyballa
Post by j***@public.gmane.org
When I try to put once and for all "l'utili-sation" in an
\hyphenation
list, I get an error message "Not a letter".
It's the ``-´´.
No, sorry, it's not. Putting a hyphen in a \hyphenation{...}
exception is entirely correct. The error comes from the apostrophe,
which is indeed "not a letter" in TeX's view.
I got in pdfTeX (pdfeTeX 3.141592-1.30.4-2.2 (Web2C 7.5.5), kpathsea
version 3.5.5) and XeTeX (XeTeX 3.141592-0.995 (Web2C 7.5.5),
kpathsea version 3.5.5, from SVN some weeks ago – I don't know how to
determine the SVN version):

l'utili-sation for l'utili-sation
l'uti-li-sa-tion for l'utilisation

So I thought the above interpretation is right ... (LaTeX2e
<2005/12/01>, Babel <v3.8d>)

--
Greetings

Pete

The human brain operates at only 10% of its capacity. The rest is
overhead for the operating system.
jropers-3sKltW3hOZpWj0EZb7rXcA@public.gmane.org
2006-10-16 19:41:42 UTC
Permalink
Actually the problem seems to be somehow related to font selection. Indeed, 'bare' Xelatex with standard font (no fancy otf font selection) hyphenates correctly words with an apostrophe, whereas when using an otf font(/fontspec), the text is not automatically hyphenated, compilation yields overfull boxes unless hyphenation points are manually inserted.

The first example (standard latex) results runs ok (automatic hyphenations), not the second (no automatic hyphenations + overfull boxes):

*************************************************************
\documentclass[11pt,a4paper,francais]{article}
\usepackage{babel}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}
L'utilisation avec de pour de par l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation
\end{document}
**************************************************************


**************************************************************
\documentclass[11pt,a4paper,xdvipdfmx,francais]{article}
\usepackage{babel,fontspec}

\setromanfont[Mapping=tex-text, BoldItalicFeatures={Scale=1}, ItalicFont= {FrutigerNextLT-RegularItalic},BoldFont={FrutigerNextLT-Bold},BoldItalicFont={FrutigerNextLT-BoldItalic}]{FrutigerNextLT-Regular}

\begin{document}
L'utilisation avec de pour de par l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation de l'utilisation
\end{document}
**************************************************************


Any clue ?

Thanks,

Jacques
Jonathan Kew
2006-10-16 22:05:20 UTC
Permalink
Post by jropers-***@public.gmane.org
Actually the problem seems to be somehow related to font selection.
Indeed, 'bare' Xelatex with standard font (no fancy otf font
selection) hyphenates correctly words with an apostrophe, whereas
when using an otf font(/fontspec), the text is not automatically
hyphenated, compilation yields overfull boxes unless hyphenation
points are manually inserted.
A guess (untested): this is because the tex-text font mapping is
converting the ' in your text (apparently accepted for hyphenation
with babel/francais) into U+2019 (Unicode closing single quote mark)
which is not valid as a letter in a word to be hyphenated.

If so, it might be fixed by saying

\lccode"2019="2019

at the beginning of your document.

JK
j***@public.gmane.org
2006-10-17 09:39:42 UTC
Permalink
You are right indeed, that solves the issue.
Thanks a lot,
Jacques.
Post by Jonathan Kew
Post by jropers-***@public.gmane.org
Actually the problem seems to be somehow related to font selection.
Indeed, 'bare' Xelatex with standard font (no fancy otf font
selection) hyphenates correctly words with an apostrophe, whereas
when using an otf font(/fontspec), the text is not automatically
hyphenated, compilation yields overfull boxes unless hyphenation
points are manually inserted.
A guess (untested): this is because the tex-text font mapping is
converting the ' in your text (apparently accepted for hyphenation
with babel/francais) into U+2019 (Unicode closing single quote mark)
which is not valid as a letter in a word to be hyphenated.
If so, it might be fixed by saying
\lccode"2019="2019
at the beginning of your document.
JK
_______________________________________________
XeTeX mailing list
http://tug.org/mailman/listinfo/xetex
Continue reading on narkive:
Loading...