1

I'm currently finishing my PhD thesis. I use Lyx and the packages

\usepackage[french]{babel}
\frenchbsetup{FrenchFootnotes=false}

I use the french quotation marks (guillemets) without any problem inside the text, but the french guillemets are replaced by english ones in the titles (chapters, sections...) when the document becomes a .pdf.

I'm sure there is a simple answer to that, but I didn't find it online.

Thanks a lot for your help!

Here is a compilable code:

\documentclass[12pt,oneside,english,french,oldfontcommands]{memoir}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2.5cm,rmargin=2.5cm}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{5}
\setlength{\parindent}{1.15cm}
\setSpacing{1.3999999999999999}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\date{} 

\usepackage[french]{babel}
\usepackage{csquotes}
\frenchbsetup{FrenchFootnotes=false}
\setcounter{secnumdepth}{5}
\usepackage{chngcntr}
\counterwithout{paragraph}{subsubsection}
\renewcommand*{\theparagraph}{\arabic{paragraph}.}
\newcommand\p{\paragraph{}}

\newcommand\ap{\addtocontents{toc}{\protect\setcounter{tocdepth}{3}}}
\newcommand\av{\addtocontents{toc}{\protect\setcounter{tocdepth}{4}}}


\usepackage[bottom]{footmisc}

\renewcommand\@makefntext[1]{%
  \noindent
\mbox{\@thefnmark.~}{#1}}
\makeatother

\let\footnotesize\scriptsize

\addtolength{\skip\footins}{4mm}

\makeatother

\usepackage{babel}
\makeatletter
\addto\extrasfrench{%
   \providecommand{\og}{\leavevmode\flqq~}%
   \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%
}

\makeatother
\begin{document}
Text \og inside \fg{} the text.


\paragraph*{1° â Text \og inside \fg{} the paragraph title}

\selectlanguage{english}%
\p{}\foreignlanguage{french}{Text \og following \fg{} the paragraph
title.}\selectlanguage{french}%

\end{document}
  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Sep 19 '14 at 10:17
  • In addition, the package csquotes might be of use here – user31729 Sep 19 '14 at 10:18
  • If I say \section{\og A\fg{} est une lettre} or \section{\frquote{A} est une lettre} I get the expected result. – egreg Sep 19 '14 at 10:32
  • The problem seems to be that I begin the text with a number before the paragraph, which creates a "paragraph" and, somehow, the question mark in the section or title, or subsection before becomes an English one. – Simon Sep 19 '14 at 10:53
  • 1
    Neat problem. Your \selectlanguage{english} after the paragraphs backfires. Add a \leavevmode: \leavevmode \selectlanguage{english} or something else to start the paragraph so that the paragraph title is set in french. – Ulrike Fischer Sep 19 '14 at 11:36
1

In run-in titles like \paragraph LaTeX sets the text of title at the time when the following paragraph starts. So the \selectlanguage{english} "backfires" (a \color{red} at this place would color the title too). So you should start the paragraph before changing the language, e.g. with \leavevmode:

\documentclass[12pt,oneside,english,french]{memoir}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{babel}
\usepackage{csquotes}

\begin{document}
Text \og inside \fg{} the text.

\paragraph*{Text \og inside \fg{} title}

\selectlanguage{english} \og blb\fg{}

\selectlanguage{french}

\paragraph*{Text \og inside \fg{} title}

\leavevmode\selectlanguage{english} \og blb\fg{}
\end{document}

enter image description here

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.