6

Context

~$ latex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1

with this *.tex file

\documentclass[12pt]{article}
%Gummi|065|=)
\title{\textbf{Test ULysse}}
\author{}
\date{}
\usepackage[utf8]{inputenc}
% \usepackage[frenchb]{babel}
\begin{document}

% \maketitle

\section{ \(26^e\) épisode Où Achille...}

\noindent
Il dit : << C'est Ulysse ! >> ...

Question : How to correct this result :

  • two characters << gives a reversed one : (dots are upside) and not «.
  • two characters >> gives a reversed one : (dots are upside) and not »
7
  • 8
    \usepackage[T1]{fontenc} Apr 6, 2016 at 17:19
  • Also consider the use of $\langle\langle$ and $\rangle\rangle$ (amsmath) instead of << and >> respectively. Apr 6, 2016 at 17:23
  • @UlrikeFischer Nice. I've marked my answer as solved
    – cl-r
    Apr 6, 2016 at 17:25
  • 1
    @StevenB.Segletes - Interesting, but « openn...close» are specific french " to report oral sentences in correct typo.
    – cl-r
    Apr 6, 2016 at 17:27
  • 3
    @cl-r Welcome. As you might know considering your reputation, we don't edit the question with the answer. Either Ulrike answers or you can answer providing the same information if she doesn't want to.
    – Alenanno
    Apr 6, 2016 at 17:30

3 Answers 3

8

Typing << for « and >> for » is provided only if you load the T1 encoding.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\begin{document}

\title{Test ULysse}
\author{}
\date{}

\maketitle

\section{26\ieme{} épisode Où Achille...}

Il dit : << C'est Ulysse ! >> ...

\end{document}

Note \ieme for the superscript e.

However, this doesn't really take care of the spaces around the guillemets and you risk having a line break after « or before ».

The right way is using \og and \fg or, even better « and » directly.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{newunicodechar}

\newunicodechar{«}{\og\ignorespaces}
\newunicodechar{»}{\unskip\fg}

\begin{document}

\title{Test ULysse}
\author{}
\date{}

\maketitle

\section{26\ieme{} épisode Où Achille...}

Il dit : \og C'est Ulysse ! \fg{} ...

Il dit : « C'est Ulysse ! » ...

Il dit : «C'est Ulysse!» ...

\end{document}

enter image description here

4

Some suggestions:

  • By all means, load the fontenc package with the option T1.

  • Consider loading the csquotes package with the option french=guillemets, in addition to loading the babel package with the option french. Then, write \enquote{C'est Ulysse!} and let LaTeX handle the exact positioning of the quote marks.

  • Don't write \(26^e\) épisode in the argument of a sectioning header. Instead, write 26\up{e} épisode -- note: no math mode needed. (\ieme{} works too.)

enter image description here

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage[french=guillemets]{csquotes}
\begin{document}

\section{ 26\up{e} épisode Où Achille \dots}

\noindent
Il dit: <<$\;$C'est Ulysse!$\;$>> % "\;" for "thickspace"

\noindent
Il dit: \enquote{C'est Ulysse!} 

\end{document}
8
  • \usepackage{fontspec} also results in guillemets. Apr 6, 2016 at 17:38
  • 1
    @Mico: frenchb has the shortcuts \up{e}, or, even simpler: \ieme, instead of the clumsy \textsuperscript{e}.
    – Bernard
    Apr 6, 2016 at 17:40
  • 1
    @Bernard - Thanks for pointing out these alternatives. I'll make the change.
    – Mico
    Apr 6, 2016 at 19:38
  • 1
    You're right: the so-called ‘high punctuation’ requires an unbreakable space before (which is not necessarily a thin space – it depends on the punctuation). Normally, you shouldn't have to use the \, spacings by yourself: frenchb does it for you automagically.
    – Bernard
    Apr 6, 2016 at 20:46
  • 2
    @cl-r - Using \enquote from the csquotes package frees the writer from having to remember how much space (thinspace?, medspace?, thickspace?) to insert between the quoted word(s) and the guillemets. :-)
    – Mico
    Apr 6, 2016 at 21:12
3

Indeed, use the fontenc package with the T1 option, and for more typographically correct results you can use the \og and \fg commands of the Frenchb extension (which provides the french option of babel). However, I think like egreg that the best way to enter French guillemets is to enter those guillemets directly, without having to enter \og or \fg nor << or >> (I'm assuming you use a French AZERTY keyboard: French guillemets, « and », are available on those). However I differ about the way to do this: Frenchb has an option for this, no need to use the newunicode package pointed par egreg.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\frenchbsetup{og = «, fg = »}
\begin{document}
Il dit : « c'est Ulysse ! »…
\end{document}

You must log in to answer this question.

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