# Why does the non-breaking space produce a double space with babel and \og and how to use both \og and non-breaking space?

I am wondering if this is a normal situation or a bug!

\documentclass{article}
\usepackage[french]{babel}
\begin{document}

Ceci est \og entre guillemets \fg.

Ceci est aussi \og~entre guillemets~\fg, mais avec des espaces insécables.

\end{document}


which gives

Is there a way to use both a non-breaking space and the symbol \og?

PS :

Ceci est aussi \og{}~entre guillemets~\fg{}, mais avec des espaces insécables.


gives the same.

-
\og already contains some spacing commands: \penalty \@M \hskip .8\fontdimen 2\font plus.3\fontdimen 3\font minus.8\fontdimen 4\font –  Jubobs Dec 10 '13 at 13:55
You can also use csquotes, a package for intelligent quoting. –  Johannes_B Dec 10 '13 at 14:02

It seems to be very logical: \og and \fg do add unbreakable spaces. So if you specify them explicitly, it considers you want to have two of them on each side. I think you also can use directly « and » in your code, provided you don't forget to add \usepackage[T1]{fontenc} (and an 8-bit font, not cm fonts). See §9 of the doc for frenchb.

-

This is a question of how tex interprets its input. In \og , \og followed by space, the final space is swallowed as a terminator for the command and no space is printed. In \og~ the ~ inserts a space into the output. This is similar to \og{} , \og{} followed by space, which also inserts a space:

\documentclass{article}
\usepackage[french]{babel}
\begin{document}

Ceci est \og{} entre guillemets\fg.

\end{document}


Now do you need to instert a non-breakable space after \og? No. \og inserts penalties disallowing a line break immediately after.

-