13

In this MWE, Latex doesn't hyphen the word "développement" and prefer to create a HUGE hbox.

\documentclass[a4paper,12pt,dvipsnames]{report}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\usepackage[a4paper, showframe]{geometry}

% Title Page
\title{}
\author{}


\begin{document}
\section{Section} 
\subsection{Subsection}
\begin{description}
 \item [Marhalie Toucse : ]  ingénieure de la plate-forme SORTATZ. Elle réalise 
 le développement du projet des tex écrit pour lipsum lagae legarc sgsi text text text text text text text text text. 
\end{description}
\end{document} 

enter image description here

5
  • 1
    You can manually add a hyphen using \- where you need. // Tu peux ajouter un hyphen manuellement avec \- à l'endroit de ton choix.
    – Maxime
    Jun 8, 2014 at 14:06
  • I know that but it's strange that Latex doesn't do it.
    – Hunsu
    Jun 8, 2014 at 14:09
  • 1
    I had exactly the same issue with italian babel with the word "generatori", which is quite popular by the way. So, instead of manually hyphen (which is always good, locally), I used \hyphenation{ge-ne-ra-to-ri} and this solved my problem. Jun 8, 2014 at 14:13
  • With your code, I do not have this problem. There must be something else in your preamble that perturbates babel and/or french hyphenation. Other suggestion: if you write "ingénieur" without the final "e" (as should be, in my opinion), does it hyphenate?
    – Bernard
    Jun 8, 2014 at 14:30
  • The image I posted is the result of the compilation of the MWE I provided. Even if I write "ingénieur" it doesn't hyphenate. By the way ingénieure is the female form of "ingénieur".
    – Hunsu
    Jun 8, 2014 at 14:35

1 Answer 1

12

TeX does not allow automatic hyphenation at accents which are constructed from two parts: as set up you are using the OT1 encoding and this means that é is produced using a 'stand alone' acute accent and a normal e. Switching to the modern T1 encoding means that a 'real' é is available, and hyphenation is possible. Indeed, there is a warning in the log with your demo saying

Package frenchb.ldf Warning: OT1 encoding should not be used for French.
(frenchb.ldf)                Add \usepackage[T1]{fontenc} to the preamble
(frenchb.ldf)                of your document, on input line 14.

If you add the line suggested then hyphenation is possible (and occurs).

One way to check this is to

\showhyphens{développement}

which shows hyphenation positions in the log. Without fontenc you get

[] \OT1/lmr/m/n/12 d^^Seveloppement

where ^^ is the accent and notable there are no break points. In contrast, add fontenc with the T1 encoding and you see

[] \T1/lmr/m/n/12 d�-ve-lop-pe-ment

with valid break points (pdfTeX is still 8-bit so can't show the é properly in the log!).

For more on this, see for example Why words with accented characters can't be automatic hyphenated with the default OT1 enconding? and Why should I use \usepackage[T1]{fontenc}?.

3
  • I always see that warning but I never known what does it mean. Thanks for the explanation.
    – Hunsu
    Jun 8, 2014 at 15:08
  • @user230137 do you mean OT1 encoding should not be used for French? if so you're forgiven for not understanding it ... but it does give a solution to the problem on the next line: Add \usepackage[T1]{fontenc} to the preamble of your document ... do that and the warning will go away and hyphenation will be more nearly accurate. Jun 8, 2014 at 15:26
  • 1
    I use kile and I haven't seen Add \usepackage[T1]{fontenc} to the preamble of your document.
    – Hunsu
    Jun 8, 2014 at 15:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.