8

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?

3
  • 1
    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. Commented Oct 26, 2012 at 21:09
  • 1
    For quotes, I advise the csquotes package. It should do anything automatically and is very powerful. Commented Oct 27, 2012 at 0:04
  • 2
    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
    Commented Oct 27, 2012 at 7:37

3 Answers 3

6

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.

4
  • You write, "You'll see that the spacing is the same." However, I get that the first « arrangement » has two spaces on the left-hand side and one space on the right-hand side, while the second one «arrangement» has one space on each side. Do you reproduce that? (Thanks)
    – PatrickT
    Commented Apr 27, 2016 at 18:25
  • @PatrickT I guess that things have changed in these three and a half years.
    – egreg
    Commented Apr 27, 2016 at 19:39
  • 1
    With an update TeX distribution in 2016, do \frenchbsetup{og=«,fb=»} instead of the \newunicodechar tricks.
    – egreg
    Commented Apr 27, 2016 at 19:43
  • That didn't work for me, as I'm on TeXlive 2015. But your other trick, \DeclareUnicodeCharacter{AB}{\og\ignorespaces} and \DeclareUnicodeCharacter{BB}{\unskip\fg} is working for now.
    – PatrickT
    Commented Apr 27, 2016 at 21:51
1

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}
5
  • 4
    francais is a synonym for the french option in babel, so there should be no difference between the two.
    – Alan Munn
    Commented Oct 27, 2012 at 3:12
  • I recommend reading perso.enstimac.fr/Gaborit~/latex/latex-in-french.html
    – rpapa
    Commented Oct 27, 2012 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). Commented Oct 27, 2012 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
    Commented Oct 27, 2012 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). Commented Oct 28, 2012 at 9:07
-1

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.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .