Spacing in french documents?

I am currently writing a letter in French. I know that in the French language there are some (for other european languages) unusual spacings near question marks, colons and french guillemets. I write in utf8, so I can use guillements directly. My question is if in my minimal example below all spacings are correct:

\documentclass{letter}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}

\signature{Bob le bricoleur}

\address{Je\\ne\\sais\\pas}

\begin{document}

\begin{letter}{Ton\\adresse\\je\\crois}

\opening{Bonjour Bobette,}

j'espère que tu rapelle notre « arrangement ». La morale: il ne faut jamais pleurer. Tu sais ça?

\closing{Amicalement,}

\end{letter}

\end{document}


I am not sure if it would be better to make the needed spaces myself. Any ideas?

-
i'm certainly no expert on this, but if you don't want the guillemets to be able to separate from the text at a line break, you should put in an unbreakable space; the tilde ~ will "tie" them to the associated text, but otherwise act as an ordinary word space. there should also be an unbreakable space before a question mark (or an exclamation mark, or a colon or semicolon). spacing after punctuation should be no different from ordinary word spacing -- use \frenchspacing to accomplish this. corrections from french-writing natives accepted. –  barbara beeton Oct 26 '12 at 21:09
For quotes, I advise the csquotes package. It should do anything automatically and is very powerful. –  Qrrbrbirlbel Oct 27 '12 at 0:04
I would direct you to Daniel Flippo's website. He maintains the updated version of the french language files for babel, and from what I understand, his file should work, whether or not you use a tie (~). –  ienissei Oct 27 '12 at 7:37

3 Answers

Unfortunately, the utf8 options only translates the guillemets to the commands \guillemotleft and \guillemotright. You can get automatically the space (even if you forget to write it) with newunicodechar. If you only use French, then

\usepackage{newunicodechar}
\newunicodechar{«}{\og}
\newunicodechar{»}{\fg}


is sufficient. If you use other languages, I recommend

\usepackage{newunicodechar}
\newunicodechar{«}{\iflanguage{francais}{\og}{\guillemotleft}}
\newunicodechar{»}{\iflanguage{francais}{\fg}{\guillemotright}}


Example

\documentclass{letter}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}

\usepackage{newunicodechar}
\newunicodechar{«}{\iflanguage{francais}{\og}{\guillemotleft}}
\newunicodechar{»}{\iflanguage{francais}{\fg}{\guillemotright}}

\signature{Bob le bricoleur}

\address{Je\\ne\\sais\\pas}

\begin{document}

\begin{letter}{Ton\\adresse\\je\\crois}

\opening{Bonjour Bobette,}

j'espère que tu rapelle notre « arrangement ». La morale: il ne faut jamais pleurer. Tu sais ça?

j'espère que tu rapelle notre «arrangement». La morale: il ne faut jamais pleurer. Tu sais ça?

\closing{Amicalement,}

\end{letter}

\end{document}


You'll see that the spacing is the same.

-

It's better use french option for babel and \og and \fg for guillemets:

\documentclass{letter}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}

\signature{Bob le bricoleur}

\address{Je\\ne\\sais\\pas}

\begin{document}

\begin{letter}{Ton\\adresse\\je\\crois}

\opening{Bonjour Bobette,}

j'espère que tu rappelles notre \og arrangement\fg. La morale: il ne faut jamais pleurer. Tu sais ça?

\closing{Amicalement,}

\end{letter}

\end{document}

-
francais is a synonym for the french option in babel, so there should be no difference between the two. –  Alan Munn Oct 27 '12 at 3:12
I recommend reading perso.enstimac.fr/Gaborit~/latex/latex-in-french.html –  rpapa Oct 27 '12 at 7:52
@rpapa: the correct link is perso.enstimac.fr/~Gaborit/latex/latex-in-french.html and unfortunately some of the informations in it are outdated (e.g. package aeguill is obsolete, one should use fontenc with T1). –  Philippe Goutet Oct 27 '12 at 10:59
I just read about the babel option frenchb which I am currently using. \usepackage[frenchb]{babel} with \frenchbsetup{og=«, fg=», GlobalLayoutFrench=true}. Is there any difference between french and frenchb? –  Wauzl Oct 27 '12 at 19:09
@Wauzl: on a recent distribution, the french, frenchb and francais options will all be equivalent (they were not at some point in the past, where the french option could call something else). –  Philippe Goutet Oct 28 '12 at 9:07

You might use the package microtype and set the kerning to english or set the kerning after special characters manually. Have a look at p. 18f., 133, 136 and 187-9 of microtype.pdf. (There is even a command \nonfrenchspacing, which I've never used.)

-