# Hyphenation doesn't work and lines overflow with French Babel (Lyx)

I'm using texlive-babel-french (on Fedora) with Lyx, and text overflows instead of having clear cuts because of hyphenation. When I change language from French to English in Document > Preferences > Language, hyphenation works correctly, but LaTeX generated text (like Abstract) is not in French anymore, so I can't use the english package.

Edit: a sort of minimal example. I kept all Lyx code, because I don't know if it's of any use.

%% LyX 2.1.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,french]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\makeatletter
\providecommand{\og}{\leavevmode\flqq~}%
\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%
}

\makeatother
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
{hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\makeatother

\begin{document}
Les \og visual guidelines \fg{} étaient complètes pour les usages
abordés, et la référence de l'API (qui explique chaque méthode) explicative
et claire. La documentation, quant à elle, laissait à désirer. Tout
comme d'autres documentations the rest is private information, sorry
:) but you can see how the text continues without any problem. But
I have long words like documentation documentation documentation documentation
documentationdocumentation documentation documentation documentation...
\end{document}

• you need to provide a mwe: meta.tex.stackexchange.com/questions/228/… I suspect that you do not use \usepackage[T1]{fontenc} which properly hyphenates accentuated words. – pluton Apr 16 '15 at 11:36
• I tried to use \usepackage[T1]{fontenc} in the Lyx preamble, but it didn't change anything. The word that overflows in my example isn't accentuated. How do I provide a minimal example with Lyx? Do I export to LaTeX ? – Hadrien01 Apr 16 '15 at 11:42
• Also, when I erase my entire Lyx preamble and just use \usepackage[T1]{fontenc}, it doesn't work either. – Hadrien01 Apr 16 '15 at 11:44
• I installed texlive-collection-langfrench, which didn't change a thing. I tried creating a new document in LaTeXila, and I didn't have a problem. The only difference is \usepackage[francais]{babel} (français is french for french). I used this in my Lyx preamble and it raised a "option clash for package babel" error, but it works. I'll try to specify that in Lyx. – Hadrien01 Apr 16 '15 at 13:51
• francais or french or frenchb doesn't matter: It all maps to the same internal file. Also the babel option doesn't add hyphenation patterns. If it works now in a new document it should also work in your original setup. – Ulrike Fischer Apr 16 '15 at 15:16

1. Turning the option Document / Settings / Language / Language package to None (to avoid the message "option clash for package babel").
2. Adding \usepackage[french]{babel} in Document / Settings / Latex preamble