7

I have a problem with the \og and \fg characters for opening and closing "guillemet". The closing guillemet is always too close to whatever follows, in other words, there is missing space between \fg and the next word that follows. I'm using TeXmaker, and a typical piece of code where the problem occurs is

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\begin{document}
Lalala \og blabla \fg lalala.
\end{document}
3

2 Answers 2

10

If you want to get the correct spacing between \fg and a word following it, you have to add an empty statement {} after it.

This because the definition of \fg in frenchb.ldf resorts to the definition of \FB@fg which is

\DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
                           \FBguill@spacing\guillemotright\xspace}

As you can see, this command takes no arguments, so it inserts no space after it, if you don't break the command explicitly with {} (or \ which is not advisable).

The behavior is the same as if you define a new command with no arguments

\newcommand{\qqq}{qqq}

and use it as

\qqq word

MWE

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\begin{document}
Lalala \og blabla \fg{} lalala.
\end{document} 

enter image description here

You can also notice that the definition of \FB@fg contains an \xspace at its end. This means that, if you don't want to insert {} each time you use \fg, you can simply load the package xspace.

The following MWE gives the same result as in the above picture:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{xspace}
\begin{document}
Lalala \og blabla \fg lalala.
\end{document} 
4

For some reason beyond my understanding, using the keyboard guillemets « and » together with the following option in the babel package

\frenchbsetup{og=«,fg=»}  

solves the problem (and elegantly too). Of course, one needs access to utf8 characters. Here is a full example.

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\frenchbsetup{og=«,fg=»}

\begin{document}

Ceci est du «texte» entre guillemets.

\end{document}  

typeset text with guillemets
(source: univ-mlv.fr)

2
  • Does this not also require some input encoding to be specified? Could you post a full example please and elaborate on your post?
    – user31729
    Dec 3, 2014 at 17:31
  • Good point. I edited the post and added a full example. Thanks. Dec 3, 2014 at 18:47

You must log in to answer this question.

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