[OS X TeX] One line is longer than the others

Chabot Denis chabotd at globetrotter.net
Mon May 21 21:53:48 EDT 2007


Hi all, in particular Frank, Bruno, David and Jean-Claude.

Le 07-05-21 à 20:00, TeX on Mac OS X Mailing List a écrit :

>
> Subject: Re: [OS X TeX] One line is longer than the others
> From: "Bruno Voisin" <bvoisin at mac.com>
> Date: Mon, 21 May 2007 07:49:13 +0200
>
> Le 21 mai 07 à 05:52, Chabot Denis a écrit :
>
>> I feel stupid! I copied and pasted from my browser, I don't know
>> why this happened. It should have been:
>>
>> 207.134.209.235:88/temp/Line_too_long.pdf
>> 207.134.209.235:88/temp/Line_too_long.tex
>>
>>> [...]
>>>
>>> On May 20, 2007, at 1:25 PM, Chabot Denis wrote:
>>>
>>>> I ran out of "sub" levels for sections in a long report so I
>>>> started using the "paragraph" level. This worked, except that one
>>>> of my paragraphs set to "paragraph level" has its first line
>>>> extending into the right margin. I did nothing differently with
>>>> this paragraph.
>>>>
>>>> [...]
>>>>
>>>> The offending "paragraph" starts with "Oursin plat" on p. 2 of the
>>>> pdf version.
>
> What you're seeing is simply a manifestation of the fact that TeX
> can't find any hyphenation point in the last word of this line (=
> "sables"); hence it reports an overfull \hbox and leaves this word
> protruding in the margin. From the console output:
>
>> Overfull \hbox (9.8887pt too wide) in paragraph at lines 120--121
>> \T1/txr/bx/n/12 Our-sin plat[][] \T1/txr/m/n/12 L'our-sin plat (\T1/
>> txr/m/it/1
>> 2 Echi-na-rach-nius parma\T1/txr/m/n/12 ), com-mu-nÈ-ment ap-pelÈ
>> dol-lar des s
>> ables,
>>
>> Overfull \hbox (3.08401pt too wide) in paragraph at lines 120--121
>> \T1/txr/m/n/12 est la seule es-pËce de l'ordre Cly-peas-te-roida
>> prÈ-sente dans
>> l'EMGSL. Sa dis-tri-bu-tion s'Ètend
>
> If you select the [draft] option to the {article} class, you'll see
> black boxes appearing where overfull \hbox'es are found.
>
> I don't understand why "sables" cannot be hyphenated as it should be,
> namely sa-bles. I checked in the log that French hyphenation is the
> one in effect at that point, and it is indeed. For good measure I
> also selected French hyphenation explicitly for this word, namely:
>
> \begin{hyphenrules}{french}sables\end{hyphenrules}
>
> and it doesn't change a thing. I can only see two explanations:
> either the "s" at the end of "sables" isn't recognized as a plural
> form, and makes "sables" unrecognized to the French hyphenation
> pattern; or the "," immediately following "sables" isn't recognized
> as a word delimiter. I don't know whether there's a switch to
> activate somewhere for the latter.
>
> What you can do in any case: set up the hyphenation point yourself,
> either entering "sables" as "sa\-bles", or adding it to a list of
> hyphenation exceptions in the preamble of your file, namely:
>
> \hyphenation{sa-bles}
>
> Hope this helps,
>
> Bruno Voisin


Thanks Bruno for a very helpful answer. I'm  a bit rusty on  
hyphenation rules (they were quite instinctive when I was a kid, I  
was never even taught the word for hyphenation (césure), we just did  
it). Yet the rules I used are very much like yours.

A quick search on internet (my daughter has brought my grammar to  
school :-[ ) shows that at least some "experts" suggest not  
hyphenating words shorter than 6 letters and/or not leave a part of a  
word that has only 2 letters at the end or beginning of a line.
"sables" has 6 letters but hyphenation would leave only 2 letters at  
the end of a line.

Except that I went through my report and found some instances of  
words longer than 6 characters but that were hyphenated leaving only  
2 letters at the end of a line. I also found another line that was  
too long, and that one ended with "(nombre" (i.e. a 6-letter word,  
but preceded by a bracket, if that matters). And yet another one that  
ended with "d'être".

I understand the fix you suggested, Bruno (issuing \hyphenation), but  
what if you did not want to cut a word? How do you fix a line that is  
too long then? Like the line that ends with "d'être"?
In fact, I'm surprised this happens at all: if a word cannot be  
hyphenated, shouldn't the TeX engine work around this, even if the  
result is not as appealing (cannot be worse than a line left too long!)?

Mind you, the package microtype, suggested by
>
> Subject: Re: [OS X TeX] One line is longer than the others
> From: "Frank STENGEL" <fstengel at mac.com>
> Date: Mon, 21 May 2007 08:12:48 +0200
>
>
> Le 21 mai 07 à 07:49, Bruno Voisin a écrit :
>
>>
>> I don't understand why "sables" cannot be hyphenated as it should
>> be, namely sa-bles. I checked in the log that French hyphenation is
>> the one in effect at that point, and it is indeed. For good measure
>> I also selected French hyphenation explicitly for this word, namely:
>>
>> \begin{hyphenrules}{french}sables\end{hyphenrules}
>
> \showhyphens{sables} (and \showhyphens{sable}) show that sables
> cannot be broken. Could be there is a bug in the current version of
> the french hyphenation rules?
>>
>> and it doesn't change a thing. I can only see two explanations:
>> either the "s" at the end of "sables" isn't recognized as a plural
>> form, and makes "sables" unrecognized to the French hyphenation
>> pattern; or the "," immediately following "sables" isn't recognized
>> as a word delimiter.
>
> According to the TeXbook (appendix H in my copy), a comma should be
> recognized as a ``word'' delimiter (its lccode is 0)
>
> -- 
> Frank STENGEL (fstengel<at>mac.com)

I'm using the hyphenation patterns that come with Babel, by the way.  
I don't know how the hyphenation rules were set.

> ----------------------------------------------------------------------
>
> Subject: Re: [OS X TeX] One line is longer than the others
> From: "Bruno Voisin" <bvoisin at mac.com>
> Date: Mon, 21 May 2007 09:01:10 +0200
>
> Le 21 mai 07 à 08:12, Frank STENGEL a écrit :
>
>> \showhyphens{sables} (and \showhyphens{sable}) show that sables
>> cannot be broken. Could be there is a bug in the current version of
>> the french hyphenation rules?
>
> There's been discussions on the XeTeX mailing list for launching a
> Unicode-friendly re-implementation of babel, separating and allowing
> selective activation of the 4 basic actions of babel for each  
> language:
>
> - Selecting a hyphenation pattern.
>
> - Translating hard-coded LaTeX strings (\chaptername, \sectionname,
> \contentsname, \figurename, etc.).
>
> - Enforcing assumed language-specific standard typographic
> conventions (for French, for example, making the space at the end of
> a sentence a normal space; inserting a space before ":", "!", "?",
> ";"; suppressing inter-item vertical space in lists; using an en-dash
> "--" to label all list items at any list level; etc.).
>
> - Selecting specific fonts (a Cyrillic font for Russian, a Greek font
> for Greek, etc.).
>
> See:
>
> <http://thread.gmane.org/gmane.comp.tex.xetex/4191>
> <http://thread.gmane.org/gmane.comp.tex.xetex/4197>
> <http://thread.gmane.org/gmane.comp.tex.xetex/4213>
> <http://thread.gmane.org/gmane.comp.tex.xetex/4225>
>
> I don't know whether this project will go anywhere, or transform into
> vaporware owing to the vastness of what's to be done.
>
> In any case, something that would be nice, but which probably will
> ever remain a dream, is that some standard format would emerge one
> day for hyphenation patterns (and dictionaries as well), and that TeX
> could use it. That would allow TeX to share its hyphenation patterns
> with OpenOffice and similar applications. That would avoid wasting
> time replicating the same work in different contexts, and allow TeX
> to benefit from the work of other people (i.e. to use the hyphenation
> patterns of OpenOffice for example).
>
> Bruno Voisin

I hope this sees the light of day!


> ----------------------------------------------------------------------
>
> Subject: Re: [OS X TeX] One line is longer than the others
> From: "Frank STENGEL" <fstengel at mac.com>
> Date: Mon, 21 May 2007 09:03:28 +0200
>
>
> Le 21 mai 07 à 07:49, Bruno Voisin a écrit :
>
>> and it doesn't change a thing. I can only see two explanations:
>> either the "s" at the end of "sables" isn't recognized as a plural
>> form, and makes "sables" unrecognized to the French hyphenation
>> pattern; or the "," immediately following "sables" isn't recognized
>> as a word delimiter. I don't know whether there's a switch to
>> activate somewhere for the latter.
>
> Actually there might be a third one: the current patterns do not see
> sable as being breakable. The suffix ble (pattern 4ble.) is weighted
> towards ``do not break'' (large even digit) By the way, where did you
> find the break sa-ble?
>
> -- 
> Frank STENGEL (fstengel<at>mac.com)
>

Maybe "tre" and "bre" endings are also weighted towards "do not  
break"? How (where) did you find this information for "sable", by the  
way, Frank?

> Subject: Re: [OS X TeX] One line is longer than the others
> From: "Jean-Claude DE SOZA" <jeanclaudedesoza at wanadoo.fr>
> Date: Mon, 21 May 2007 18:42:44 +0200
>
> I have added the microtype package and no more line longer than the
> others.
> Jean-Claude DE SOZA
> Le 21 mai 07 à 5:52, Chabot Denis a écrit :
>


But this microtype package solved my problems, so even though I'm  
still curious as to how one would fix the problem (without using  
microtype) if the last word of a line must not be hyphenated, at  
least my report looks nice right now!

Thanks again all,

Denis


------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list