25

In French, we put spaces before characters : ! ; ? when we type the text. For instance, we will type

Que fait-on ? On met un espace avant les deux points : comme cela.

If I do so and use microtype, the spacing in the generated pdf file is not the right one. See the following example:

\documentclass{article}

\usepackage[utf8x]{inputenc}
\usepackage[french]{babel}
\usepackage[babel=true, kerning=french]{microtype}

\begin{document}

  Voici ce qui se passe quand on met un signe \og{}deux~points\fg{} 
 avec le package \og{}microtype\fg{} : il semble que ça ne marche pas ! 
 Un autre essai : est-ce que cela marche ?
  \bigskip 

  \textbf{But what happens if I type my text following the 
 English typographic rules?}
  \bigskip 

  Voici ce qui se passe quand on met un signe \og{}deux~points\fg{} 
 avec le package \og{}microtype\fg{}: il semble que ça ne marche pas! 
 Un autre essai: est-ce que cela marche?

\end{document}

enter image description here

Hence:

  • How can I use microtype and type my text the French way?

Note: here is the result without microtype.

\documentclass{article}

\usepackage[utf8x]{inputenc}
\usepackage[french]{babel}
%\usepackage[babel=true, kerning=french]{microtype}

\begin{document}

  Voici ce qui se passe quand on met un signe \og{}deux~points\fg{} 
 avec le package \og{}microtype\fg{} : 
 il semble que ça ne marche pas ! Un autre essai : est-ce que cela marche ?

\end{document}

enter image description here

  • 4
    I personally think that this is a pain to read. Do you know why it is done like that in France? – Ingo Nov 5 '13 at 13:44
  • 11
    When you are French, you feel it is the way it should be for all languages!! – Colas Nov 5 '13 at 13:45
  • 3
    @Ingo A discussion on orthotypographie.fr suggests that it prevents changing the shape of the word, which helps reading. And then, there is use of habit. By the way, Colas, may I suggest using non-breaking spaces before “high” punctuation? It makes much more sense and, when writing email, you’ll need to do it anyway. Any text editor which can handle LaTeX should be able to insert the proper “~” when you type a non-breaking space when correctly set up. – Édouard Nov 5 '13 at 14:15
  • @Édouard Doesn't babel transform automatically theses spaces to non-breaking spaces? – Colas Nov 5 '13 at 14:49
  • 1
    It probably prevents line breaks before “:;?!”. But I just find it way easier to always type “non-breaking space; question mark; space“ whatever software I’m in rather than type “space; question mark; space” in LaTeX only. But, as I said, this is just a suggestion. – Édouard Nov 5 '13 at 15:28
26

If you want to use kerning=french, then you need to disable the punctuation settings made by babel and leave no space before punctuation symbols.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,french]{babel}
\frenchbsetup{AutoSpacePunctuation=false}
\usepackage[babel=true, kerning=french]{microtype}

\begin{document}

Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}
avec le package \og{}microtype\fg{}: il semble que ça ne marche pas!
Un autre essai: est-ce que cela marche?

\bigskip

\begin{otherlanguage*}{english}
But what happens if I type my text following the
English typographic rules?
\end{otherlanguage*}

\end{document}

enter image description here

Note that for disabling the humongous space before punctuation used in French typography when using another language you have to tell LaTeX you want to temporarily change the rules.

Alternatively, don't use kerning=french; you can type a space before punctuation or not.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,french]{babel}
\usepackage[babel=true]{microtype}

\begin{document}

Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}
avec le package \og{}microtype\fg{}: il semble que ça ne marche pas!
Un autre essai: est-ce que cela marche?

\bigskip

Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}
avec le package \og{}microtype\fg{} : il semble que ça ne marche pas !
Un autre essai : est-ce que cela marche ?

\end{document}

enter image description here

My eyes will never get used to see such monstrosities perpetrated by the French. ;-)

  • Thanks! I want to type a space before : ? ! ;. So, I will not use kerning=french. Will I loose a lot doing so? – Colas Nov 5 '13 at 13:48
  • 2
    @Colas I don't think so; the kerning feature seemed promising, but it isn't really working. – egreg Nov 5 '13 at 14:07
  • Great to put some complete code in your answer. – Colas Nov 5 '13 at 17:29
  • 2
    @Fran Say \usepackage{newunicodechar}; then \newunicodechar{«}{\og} and \newunicodechar{»}{\fg} should do. – egreg Nov 6 '13 at 7:30
  • 2
    @Mico Of course! “Mathematicians are like Frenchmen: whatever you say to them they translate into their own language, and forthwith it is something entirely different.” – egreg Dec 5 '13 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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