diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/babel-contrib/french |
Initial commit
Diffstat (limited to 'macros/latex/contrib/babel-contrib/french')
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/README | 49 | ||||
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf | bin | 0 -> 164871 bytes | |||
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/frenchb-doc.tex | 2020 | ||||
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/frenchb.dtx | 5899 | ||||
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/frenchb.ins | 98 | ||||
-rw-r--r-- | macros/latex/contrib/babel-contrib/french/frenchb.pdf | bin | 0 -> 243396 bytes |
6 files changed, 8066 insertions, 0 deletions
diff --git a/macros/latex/contrib/babel-contrib/french/README b/macros/latex/contrib/babel-contrib/french/README new file mode 100644 index 0000000000..168ac33d58 --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/README @@ -0,0 +1,49 @@ +========================================================================= +The babel-french bundle (formerly known as `frenchb') + +French language support for the babel multilingual package + +Copyright 1996--2019 Daniel Flipo +E-mail: daniel (dot) flipo (at) free (dot) fr + +Released under the LaTeX Project Public License v1.3 or later +See http://www.latex-project.org/lppl.txt +========================================================================= + +== PURPOSE == + +This bundle is an extension to the babel package for multilingual +typesetting. It provides all necessary macros, definitions and settings +to typeset French documents. It is designed to work with the following +engines: pdfTeX, XeTeX and LuaTeX. + +== CONTENTS == + +The bundle consists of the following files: + +* frenchb.ins: installation file to unpack the language definition files, +* frenchb.dtx: packed language definition files and documentation, +* frenchb.pdf: unpacked documentation for babel-french, +* frenchb-doc.pdf: comprehensive documentation in French, +* frenchb-doc.tex: source file of frenchb-doc.pdf, +* README (this file). + +== INSTALLATION == + +If the latest version of this package is not included in your LaTeX +distribution, do the following: + +* issue "luatex frenchb.ins" to unpack the language definition files; +* copy the files frenchb.lua, french.ldf, frenchb.ldf, francais.ldf, + acadian.ldf and canadien.ldf to a location where TeX can find them + (default location: $TEXMF/tex/generic/babel-french/); +* rebuild the database (mktexlsr or so). + +== DOCUMENTATION == + +See the included manuals for usage instructions: frenchb.pdf in English or +the French documentation frenchb-doc.pdf. + +== CHANGES == + +See the included manual frenchb.pdf, section "Change History". diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf Binary files differnew file mode 100644 index 0000000000..12b0e7a8fb --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex new file mode 100644 index 0000000000..c370a86786 --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex @@ -0,0 +1,2020 @@ +\documentclass[a4paper,12pt,german,english,french]{article} + +\usepackage{xspace} +\usepackage{array,longtable} +\usepackage{varioref} +\renewcommand{\reftextpagerange}[2]{\pageref{#1}--\pageref{#2}} +\usepackage{url,alltt,shortvrb} +\usepackage{graphics} +\usepackage[dvipsnames]{xcolor} +\usepackage{luatexbase} %%% Provisoire : pour microtype + +%%% Fontes OpenType avec moteur LuaTeX : Erewhon/Cabin/Inconsolata +\usepackage[upright]{fourier} % Pour les maths seulement +\usepackage[no-math]{fontspec} +\usepackage{realscripts} +\setmainfont{Erewhon}% + [BoldFeatures = {SmallCapsFont={Erewhon-Bold}}, + ItalicFeatures={SmallCapsFont={Erewhon-RegularSlanted}}, + BoldItalicFeatures={SmallCapsFont={Erewhon-BoldSlanted}}, + ] +\setsansfont{Cabin}[Scale=MatchLowercase] +\setmonofont{Inconsolatazi4}% voir inconsolata-doc.pdf + [Scale=MatchLowercase,HyphenChar=None,StylisticSet={2,3}, + AutoFakeSlant=0.2 % XeTeX only, sans effet avec LuaTeX + ] + +%%% *** APRÈS fontspec *** +\usepackage{babel} +\frenchbsetup{og=«, fg=», AutoSpacePunctuation=false} +\frenchbsetup{ListItemsAsPar} + +\usepackage[babel=true,expansion=true,protrusion=true]{microtype} + +% Mise en page +\usepackage[textwidth=160mm,textheight=247mm,hmarginratio=1:1 + ]{geometry} +% +%\setlength{\parindentFFN}{0em} +\setlength{\parindent}{0mm} +\setlength{\parskip}{.5\baselineskip plus .2\baselineskip + minus .1\baselineskip} +\ifFBListItemsAsPar +\else + \setlength{\listindentFB}{0mm} % sans effet si ListItemsAsPar=true +\fi + +\MakeShortVerb{\|} + +% Couleurs +% \emph +\let\emphORI\emph +\renewcommand{\emph}[1]{\textcolor{BrickRed}{\emphORI{#1}}} +% verbatim : modifier \verbatim@font +\def\ColorVerb{\color{MidnightBlue}} +\makeatletter +\let\verbatim@fontORI\verbatim@font +\def\verbatim@font{\ColorVerb\verbatim@fontORI} +\makeatother +% options de frenchb : + \def\ColorArg{\color{Sepia}} +% N.B. URL color = ForestGreen +% +\newcommand*{\file}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\cls}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\ext}[1]{\texttt{\ColorVerb #1}} +\let\pkg\ext +\newcommand*{\exe}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\opt}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\bibsty}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\env}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\lang}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\code}[1]{\texttt{\ColorVerb #1}} +\newcommand*{\argum}[1]{\textit{#1}} +\newcommand*{\meta}[1]{\textit{\ColorArg #1}} + +\providecommand\marg[1]{% % from ltxdoc.cls + {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} +\providecommand\oarg[1]{% + {\ttfamily[}\meta{#1}{\ttfamily]}} + +\DeclareRobustCommand\cs[1]{\texttt{\ColorVerb \char`\\#1}}% from ltxdoc.cls +\newcommand*\fbo[1]{\texttt{\ColorArg #1}} +\newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}} + +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont\ttfamily\bfseries {\MyColor #1}} +\let\MyColor\relax + +\providecommand*{\BibTeX}{% + B\textsc{i}\kern-.025em \textsc{b}\kern-.08em \TeX}% +\providecommand*{\biber}{Biber} +\providecommand*{\biblatex}{Biblatex} + +% URL de mon site perso : +\begingroup +\catcode`~=12 +\xdef\urlperso{http://daniel.flipo.free.fr} +\endgroup + +% Adaptation des \subsubsection{} (thèmes des options de \frenchsetup{}) +\makeatletter +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-1ex\@minus -.5ex}% + {1ex\@minus .5ex}% + {\normalfont\normalsize\bfseries}} +\makeatother + +\usepackage{hyperref} +\hypersetup{pdftitle={Documentation de babel-french}, + pdfcreator={LuaTeX}, + pdfauthor={Daniel FLIPO}, + unicode, + bookmarksopen, + colorlinks, + urlcolor=ForestGreen, + linkcolor=black, % appel note bas de page en noir + } +\newcommand*{\hlabel}[1]{\phantomsection\label{#1}} +% notes bas de page consécutives avec le même numéro +\newcommand*{\samefntmk}{% + \addtocounter{Hfootnote}{-1}\addtocounter{footnote}{-1}\footnotemark} + +\usepackage[open]{bookmark} +% +\title{Documentation sur le module \ext{babel-french}} +\author{\href{mailto:daniel.flipo@free.fr}{Daniel \textsc{Flipo}}} +\newcommand*{\latestversion}{3.5e} +\date{Version {\latestversion} -- \today} + +\begin{document} +\def\today{30 avril 2019} + +\maketitle +\thispagestyle{empty} + +\begin{abstract} + La première version de frenchb (\textbf{french} pour \textbf{b}abel) est + sortie en 1996. La version~2, profondément remaniée, date de mai~2007. + La liste détaillée des changements intervenus depuis la version~2.6 se + trouve à la section~\ref{sec:changes-3.0} p.~\pageref{sec:changes-3.0}. + + La version actuelle de frenchb (\latestversion), dont le nom officiel est + \ext{babel-french}, est prévue pour fonctionner aussi bien avec les anciens + formats TeX comme pdf(La)TeX qu’avec les nouveaux Lua(La)TeX et Xe(La)TeX. + + Les mises à jour de \ext{babel-french} sont désormais affichées très + rapidement sur CTAN et immédiatement intégrées aux distributions TeXLive, + MikTeX, MacTeX, etc. + La présente documentation en français est également disponible sur CTAN, + il n’y a plus besoin de la récupérer sur mon site + personnel {\expandafter\expandafter\expandafter\url{\urlperso/babel-french}}. + +\end{abstract} + +\bgroup +\renewcommand{\abstractname}% + {Historique des mises à jour de cette documentation} +\newlength\mybox +\settowidth{\mybox}{5 décembre 2012} +\renewcommand{\descriptionlabel}[1]{\makebox[\mybox][l]{\textbf{#1 :}}} +\vspace{\baselineskip}\noindent +\begin{abstract} + \vspace{-\baselineskip}\noindent + \descindentFB=0pt + \begin{description} + \item[8 juillet 2014] Ajout des sections~\ref{ssec:captions} + p.~\pageref{ssec:captions} (\textit{caption names}) et \ref{ssec:biblatex} + p.~\pageref{ssec:biblatex} (\biblatex). + \item[28 juillet 2014] Présentation des listes, + configuration d’\ext{enumitem} (section~\ref{ssec:lists}). + \item[16 sept. 2014] Ajout de l’option \fbo{SmallCapsFigTabCaptions}, + voir p.~\pageref{scfigtab}. + \item[9 avril 2015] Charger \ext{listings} après \ext{babel} + (section~\ref{sec:Incomp}). + \item[14 février 2016] Adaptation à la version 3.2a, voir + section~\ref{ssec:changes-3.2}. + \item[30 mars 2016] Charger \ext{subcaption} après \ext{babel} + (section~\ref{sec:Incomp}). + \item[14 mai 2016] Mise à jour pour TeXLive~2016, + voir section~\ref{ssec:changes-3.2}. L’historique des changements + antérieurs à la version~3.0 a été supprimé. + \item[3 juillet 2016] Ajout dans la version~3.2d, du paramètre + |\descindentFB| pour les listes \env{description}, voir + section~\ref{ssec:lists}. + \item[15 janvier 2017] La version~3.2f est compatible avec l’extension + \ext{icomma}. + \item[30 janvier 2017] Le comportement par défaut de la commande + |\frquote{}| sous LuaTeX est modifié, voir p.~\pageref{frquote}. + \item[30 avril 2017] Utiliser |\frenchsetup{}| de préférence à + |\frenchbsetup{}|, voir p.~\pageref{sec:Perso}. + Personnalisation de la commande |\part{}|, voir p.~\pageref{ssec:captions}. + \item[31 août 2017] Ajout de l’option \fbo{UnicodeNoBreakSpaces}, + voir p.~\pageref{ucs-nbsp}. + \item[30 janvier 2018] Adaptation à la version 3.4a, voir + section~\ref{ssec:changes-3.4}. + \item[24 février 2018] Regroupement par thèmes des options de \fbsetup{}. + \item[6 juillet 2018] Nouvelle option \fbo{ListItemsAsPar}, + voir p.~\pageref{ListAsPar}. + \item[24 janvier 2019] L’option \fbo{StandardListSpacing=true} est à utiliser + de préférence à \fbo{ReduceListSpacing=false}, voir p.~\pageref{ListAsPar}. + \item[14 mars 2019] Nouvelle commande |\NoEveryParQuote|, voir + p.~\pageref{frquote}. +\end{description} +\end{abstract} +\egroup + +\newpage +\renewcommand{\contentsname}{Sommaire} +\tableofcontents{}% +\label{ch-doc8} + +\newpage +\section{Appel de l’extension Babel} + +Babel est installé en standard dans toutes distributions \LaTeXe, +pour disposer des langues française et anglaise% +\footnote{En fait américaine (US-english), il existe une variante + \opt{british} pour l’anglais « britannique ».}, +il suffit d’ajouter +|\usepackage[english,french]{babel}|% +\footnote{Les options \opt{frenchb} et + \opt{francais} (équivalentes à \opt{french} + depuis 2004), sont conservées pour des raisons de compatibilité, mais elles + \emph{ne devraient plus être utilisées}.} +dans le préambule du document (entre |\documentclass| +et |\begin{document}|). + +Il est recommandé de déclarer les options de langues comme arguments +de |\documentclass|, elles peuvent alors être utilisées également par +d’autres extensions :\\ +|\documentclass[12pt,english,french]{article}|\\ +|\usepackage{varioref}|\\ +|\usepackage{babel}|\\ +a le même effet que\\ +|\documentclass[12pt]{article}|\\ +|\usepackage[french]{varioref}|\\ +|\usepackage[english,french]{babel}| + +La \emph{dernière} langue chargée en option de Babel ou de |\documentclass| +(le français dans les exemples ci-dessus) est la \emph{langue principale} +du document, c’est elle qui est active au début du document et +qui régit la présentation générale (listes, notes de bas de page, +retrait des premiers paragraphes) quelle que soit la langue courante. + +Pour changer de langue en cours de document on utilise la commande standard +de \mbox{Babel} |\selectlanguage{|\argum{lang}|}|, +par exemple |\selectlanguage{english}| et pour revenir en français +|\selectlanguage{french}|\footnote{Là encore, le nom de la langue + française est \opt{french}, pas \opt{frenchb} ou \opt{français}.}. + +Pour passer \emph{localement} dans une autre langue on peut utiliser +l’environnement \\ +|\begin{otherlanguage}{|\argum{langue}|}|\\ +\hspace*{1em}\argum{texte\dots}\\ +|\end{otherlanguage}|\\ +ou pour une courte citation dans un paragraphe\\ +|\foreignlanguage{|\argum{langue}% +|}{|\argum{texte\dots}|}|. + +Depuis la version~3.10 de Babel, une syntaxe allégée est proposée pour les +changements de langue : en ajoutant par exemple dans le préambule +|\babeltags{fr = french}|% +\footnote{Rien n’empêche de remplacer \texttt{\ColorVerb fr} par + \texttt{\ColorVerb french}, on retrouve ainsi la syntaxe de + \ext{polyglossia}.}, on peut remplacer +|\foreignlanguage{french}{texte}| par |\textfr{texte}| et\\ +|\begin{otherlanguage*}{french} \end{otherlanguage*}| par\hlabel{textfr} +|\begin{fr} \end{fr}|. +|\babeltags| peut s’appliquer à plusieurs langues : +|\babeltags{fr=french, de=german}|. + +\emph{Remarque importante sur les fontes.} +Le recours à \ext{babel-french} ne suffit pas pour obtenir des césures +correctes des mots accentués, il faut en outre utiliser des fontes contenant +tous les caractères spéciaux du français (â, é, ï, ù, ç, etc.) ; la façon de +le faire dépend du format utilisé : +\begin{itemize} +\item avec pdfLaTeX il convient d’ajouter dans le préambule les deux + commandes\\ + |\usepackage[T1]{fontenc}|\\ + |\usepackage{lmodern}|\\ + et de déclarer le codage d’entrée (celui qui est utilisé par l’éditeur choisi), + par exemple |utf8| (recommandé) ou |latin9| ou |latin1| ou |applemac|, etc.\\ + |\usepackage[utf8]{inputenc}| +\item avec LuaLaTeX ou XeLaTeX on peut ajouter |\usepackage{fontspec}| mais + ceci est devenu facultatif avec les formats LaTeX récents (2017). +\end{itemize} +Dans les deux cas, le document sera composé avec les fontes LM ou +\textit{Latin Modern} qui sont la version moderne des fontes CM ou +\textit{Computer Modern}, fontes historiques de TeX. +Les fontes LM conviennent pour toutes les langues de l’Europe de l’ouest +(latines, anglo-saxonnes et scandinaves).\\ +Rappelons qu’avec LuaLaTeX ou XeLaTeX aucun appel à +|\usepackage[...]{inputenc}| n’est à faire puisque que le texte source +\emph{doit être codé} en |utf8|. + +\goodbreak +L’utilisation de fontes de la famille CM/LM n’est pas du tout indispensable, +\begin{itemize} +\item pour pdfLaTeX toute fonte PostScript en codage~T1 convient, ainsi on + pourra remplacer |lmodern|, au choix par |kpfonts|, |fourier| (Utopia), + |mathptmx| ou |txfonts| (Times), |mathpazo| ou |pxfonts| (Palatino), etc. +\item pour LuaLaTeX ou XeLaTeX, il convient de faire appel aux fontes + OpenType, l’exemple suivant sélectionne une police pour chaque famille + (romain, sans-serif, chasse fixe) et uniformise la hauteur des minuscules :\\ +|\usepackage{fontspec}|\\ +|\setmainfont{Erewhon}|\\ +|\setsansfont[Scale=MatchLowercase]{Cabin}|\\ +|\setmonofont[Scale=MatchLowercase,HyphenChar=None]{Inconsolatazi4}| + + Il est recommandé d’ajouter également |\usepackage{realscript}| afin de + profiter de vraies lettres supérieures lorsqu’elles sont disponibles. + + Il est également possible d’utiliser des fontes PostScript, pour plus de + détails consulter par exemple le chapitre~15 du livre + \textit{\LaTeX, l’essentiel} de \bsc{D.~Bitouzé} et \bsc{J.-C.~Charpentier}. +\end{itemize} + +\section{Description de la francisation par babel-french} +\label{sec:description} + +Dans un document multilingue, il y a des conventions typographiques qui +changent avec la langue, comme la présence ou non d’espaces avant +la ponctuation haute et d’autres, la présentation des listes, des notes +de bas de page ou le retrait des premiers paragraphes des sections qui +devraient s’appliquer globalement à tout le document. + +Depuis la version~2.2, \ext{babel-french} utilise la notion de \emph{langue + principale} qui est la \emph{dernière option} (éventuellement la seule) de +la commande |\usepackage[...]{babel}| ; c’est elle qui impose la présentation +globale du document (listes, notes de bas de page, retrait des premiers +paragraphes), les autres conventions typographiques restent locales (elles +varient selon la langue utilisée). Lorsque le français n’est pas la langue +principale, \ext{babel-french} ne modifie en rien la présentation globale du +document : celle-ci est imposée uniquement par la classe et les autres +extensions chargées. + +Lorsque le français est la langue principale, la présentation globale du +document (ou maquette) est modifiée de la façon suivante% +\footnote{Il est possible, pour chacun des points suivants, de revenir aux + réglages standard de LaTeX, voir section~\ref{sec:Perso}.} : + +\begin{itemize} + +\item Le premier paragraphe de chaque section est mis en retrait + comme les suivants. + +\pagebreak[3] +\item Listes « \env{itemize} » : + \begin{itemize} + \item les marqueurs traditionnels du type «\textbullet» sont remplacés + par défaut par des tirets~longs «---», ou par un autre marqueur + choisi par l’utilisateur (voir section~\ref{sec:Perso}) ; + + \item les espaces verticaux ajoutés par LaTeX entre les différents + éléments d’une liste (\textit{items}) sont supprimés. + + \item la largeur des marges gauches dans les listes \env{itemize} est + ajustée en fonction du marqueur utilisé. Depuis la version~2.6a, le même + réglage s’applique aussi aux listes \env{enumerate} et trois paramètres + (|\listindentFB|, |\descindentFB| et |\labelwidthFB|) ont été + ajoutés pour permettre d’affiner la présentation des listes \env{itemize}, + \env{enumerate} et \env{description} (voir section~\ref{ssec:lists}). + \end{itemize} + +\item Par défaut les espacements verticaux de \emph{toutes} les listes + (\env{enumerate}, \env{description} mais aussi + \env{abstract}, \env{quote}, \env{quotation}, \env{verse}) + sont réduits. + +{\sloppy +\item Les notes de bas de page sont présentées « à la française » + comme ceci\footnote{Une note de bas de page « à la française ».} + {\FBFrenchFootnotesfalse\makeatletter\let\@footnotemark\@footnotemarkORI + au lieu de ceci\footnote{Une note de bas de page standard (classe + \cls{article}), ça jure avec la précédente, non ?}\makeatother}. + Noter, outre la présentation différente du numéro dans la note elle-même, + l’ajout de l’espace fine avant l’appel de la première note. + Le retrait des notes par rapport à la marge gauche est par défaut fixé + au maximum de |\parindent| et de 1.5em, il peut être modifié en + donnant la valeur voulue à |\parindentFFN| dans le préambule : + |\setlength{\parindentFFN}{0mm}| par exemple. + De même, le point qui suit par défaut le numéro de note, ainsi que l’espace + insécable qui sépare ce point du texte de la note peuvent être redéfinis : + ajouter dans le préambule |\renewcommand{\dotFFN}{}|, + |\renewcommand{\kernFFN}{--}| (pas de point, un tiret double sans espace + après le numéro de note).\hlabel{FFN} +\par} + +\item Les légendes des figures et des tables utilisent un tiret double + à la place du «\string:», on obtient + «Figure~1~--~Légende» au lieu de «Figure~1\string:~Légende». + Il est possible de choisir un autre séparateur : + pour remplacer le tiret double «--» par un tiret triple «---», + ajouter dans le préambule + |\renewcommand*{\CaptionSeparator}{\space\textemdash\space}|.% + \hlabel{captionseparator} + + Lorsque la langue principale n’est pas le français, le séparateur «\string:» + est utilisé pour toutes les langues mais une espace insécable est en principe + ajoutée en français ; lorsque l’ajout échoue, un message est affiché dans le + fichier \file{.log}. + + Certaines classes ou extensions modifient la présentation des légendes; + parmi elles, les classes (\cls{memoir}, koma-script et AMS et les + extensions(\ext{caption} et \ext{floatrow} sont compatibles avec + \ext{babel-french}. + + Un avertissement est inséré dans le fichier \file{.log} lorsqu’il y a risque + de conflit avec une autre extension ou classe qui modifie la définition de + la commande |\@makecaption| ou lorsque le chargement d’une extension + intervient trop tôt ou trop tard. +\end{itemize} + +En ce qui concerne les conventions typographiques locales (variables avec la +langue) la commande |\selectlanguage{french}| +produit les effets suivants : +\enlargethispage*{\baselineskip} +\begin{itemize} + +\item Les motifs de césures françaises sont activés. + +\item Des espaces insécables et de taille adéquate sont ajoutés + automatiquement devant la ponctuation haute (|; : ! ?|)% + \footnote{Voir section~\ref{sec:Perso} p.~\pageref{sec:Perso} comment + éviter les ajouts abusifs d’espace avant ces caractères + et section~\ref{sec:active-char} p.~\pageref{sec:active-char} en cas de + problème dû aux caractères actifs.}. + Ceci impose que ces caractères soient rendus actifs (en fait dans tout le + document), \emph{sauf} avec les versions récentes de Xe(La)TeX ou Lua(La)TeX + qui disposent d’un mécanisme permettant d’accéder aux mêmes fonctionnalités + sans recours aux caractères actifs. + +\item la définition de |\dots| est modifiée pour + supprimer l’espace qui suit (cet espace est gênant devant une + parenthèse par exemple\dots)% + \footnote{Certains auteurs préfèrent en français «...» (codé \code{...} + sans espace) à «\dots» (codé \cs{dots}).}. + +\item La commande |\today| retourne la date en français. + +\item Les titres («caption names» en anglais) sont traduits en + français, ainsi la commande |\chapter| imprimera + « Chapitre » au lieu de « Chapter ». Voir section~\ref{ssec:captions} + p.~\pageref{ssec:captions} comment modifier ces intitulés. + +\end{itemize} + +La commande |\selectlanguage{english}| ramène +au comportement standard de LaTeX (typographie américaine). + +Des commandes ont été prévues pour faciliter la saisie : +\begin{itemize} + +\item Les guillemets peuvent être saisis grâce aux commandes |\og| et |\fg|% + \footnote{Si les caractères « et » sont accessibles au clavier, + ils peuvent être utilisés pour saisir les guillemets, voir + la fin de la section~\ref{sec:Perso}, p.~\pageref{og-fg}.}, + ce qui donne selon la langue de travail « guillemets français » ou + \begin{otherlanguage}{english}``english quotes’’\end{otherlanguage}. + + Notez que les guillemets français ne devraient \emph{jamais} être saisis + avec |<<| et |>>| contrairement à ce qui se fait avec + {e-French} (voir section~\ref{sec:CompatFP}). + + Depuis la version~3.1, une alternative, |\frquote{|\textit{texte}|}|, est + proposée pour la saisie des guillemets français avec l’espace adéquat, + le résultat est \frquote{\textit{texte}}. + + L’usage de |\frquote{}| est recommandé pour les citations longues + (c.-à-d. s’étendant sur plus d’un paragraphe) et pour les citations + imbriquées.\hlabel{frquote} + + Pour les premières, |\frquote{}| insère automatiquement un guillemet ouvrant + au début de chaque paragraphe, sauf si \fbo{EveryParGuill=close} (guillemet + fermant dans ce cas) ou si \fbo{EveryParGuill=none} (aucun ajout). + + Pour les citations imbriquées, plusieurs présentations sont proposées selon + les options choisies : + \begin{itemize} + \item Les citations internes sont balisées par des guillemets anglais + ``comme ceci’’ (recommandation de Aurel Ramat) sauf si + \fbo{InnerGuillSingle=true}, dans ce cas les guillemets anglais sont + remplacés par guillemets français simples \guilsinglleft\FBguillspace + comme ceci \FBguillspace\guilsinglright{} (suggestion de Jean Méron). + \item Avec les formats basés sur LuaTeX, il est possible d’insérer en début + de chaque ligne de la citation interne un guillemet dit « de suite », + ouvrant --~comme le recommande l’Imprimerie nationale~-- avec l’option + \fbo{EveryLineGuill=open}, ou fermant (préconisé par + Jean-Pierre Lacroux) avec l’option \fbo{EveryLineGuill=close}. + Dans les deux cas l’option \fbo{InnerGuillSingle} est sans effet, la + citation interne est toujours balisée par des guillemets chevrons « et ». + \end{itemize} + + Lorsque les citations internes et externes se terminent en même temps, il + est d’usage de supprimer le guillemet fermant de la citation interne. Pour + ce faire, il suffit de coder la citation interne avec |\frquote*{}| au lieu + de |\frquote{}|. + +Exemple de citation imbriquée : + +\vspace{0.5\baselineskip} +\begin{minipage}[t]{.47\textwidth} +\hspace*{\fill}% +\fbox{\begin{minipage}[t]{.95\textwidth} + \FBInnerGuillSingletrue + \parindent=1em + Xavier raconte ainsi sa mésaventure : + \frquote{Au moment d’enregistrer mes bagages, l’hôtesse + m’a dit tout bonnement : + \frquote*{Je suis désolée, il n’y a plus de place. + Vous allez devoir attendre le prochain vol.\par + C’est un effet de ce qu’on appelle la surréservation, + ou \textit{surbooking} en anglais.}% + }% + \end{minipage}% +}\\[.2\baselineskip] +\hspace*{\fill}\fbo{InnerGuillSingle}\hspace*{\fill} +\end{minipage} +\hspace{\fill} +\begin{minipage}[t]{.47\textwidth} +\fbox{\begin{minipage}[t]{.95\textwidth} + \let\FBeverylineguill\FBguillopen + \parindent=1em + Xavier raconte ainsi sa mésaventure : + \frquote{Au moment d’enregistrer mes bagages, l’hôtesse + m’a dit tout bonnement : + \frquote*{Je suis désolée, il n’y a plus de place. + Vous allez devoir attendre le prochain vol.\par + C’est un effet de ce qu’on appelle la surréservation, + ou \textit{surbooking} en anglais.}% + }% + \end{minipage}% +}\\[.2\baselineskip] +\hspace*{\fill}LuaLaTeX + \fbo{EveryLineGuill=open}\hspace*{\fill}% +\end{minipage} + +\vspace{0.5\baselineskip} +Le codage est le suivant : +{\ttfamily\ColorVerb Xavier raconte… |\frquote{|Au moment… l’hôtesse m’a + dit tout bonnement : |\frquote*{|Je suis désolée, … en anglais.|}}|} + + Une commande |\NoEveryParQuote| permet de supprimer localement des guillemets + de début de paragraphe ajoutés inconsidérément par la commande |\frquote{}| + notamment dans les listes (après les labels) ; elle doit être utilisée dans + un environnement ou un groupe pour en limiter la portée. + +\item La commande |\up| facilite la saisie des exposants en mode texte : + |M\up{me}| imprime M\up{me}, + |1\up{er}| donne 1\up{er} ; % 1\ier ; + on dispose aussi de + |\ier| |\iere| |\iers| |\ieres| |\ieme| |\iemes| + pour 1\ier, 1\iere, 1\iers, 1\ieres, 2\ieme, 2\iemes. + La commande |\up| utilise les lettres supérieures de la police lorsqu’elles + sont disponibles et les simule sinon. + On obtient de vraies lettres supérieures + \begin{itemize} + \item avec les moteurs LuaTeX et XeTeX, à condition de charger les extensions + \ext{fontspec} et \ext{realscripts} et d’utiliser une police de type + OpenType qui connaisse la directive «\code{VerticalPosition=Superior}» + (polices Linux Libertine O, Iwona, par exemple) ; + \item sous (pdf)LaTeX avec certaines polices type~1 expertes + (Fourier-Utopia). + \end{itemize} +De plus |\up| empêche le passage en capitales des lettres supérieures dans +les hauts de page par exemple.\hlabel{lettres-sup} + +Une variante étoilée |\up*| est prévue pour les polices qui disposent d’un jeu +incomplet de lettres supérieures : la police OpenType Jenson Pro ou la police +type~1 Utopia-expert par exemple, n’ont pas de «g supérieur» ; en codant +|M\up{gr}| on obtient Mg\up{r} (Jenson) ou M\up{r} (Utopia-expert) tandis que +|M\up*{gr}| force l’utilisation de supérieures simulées ce qui pallie l’absence +du «g supérieur», le résultat est M\up*{gr}. + +Pour les perfectionnistes, il est facile d’ajuster la taille et le placement +vertical des lettres supérieures simulées par |\fup| +(voir dans le code de \file{frenchb.dtx} les commandes |\FBsupS| et +|\FBsupR|). + +\item L’usage français veut que les noms propres soient imprimés en + petites capitales et ne soient pas coupés en bout de ligne, la commande + |\bsc| (\textit{boxed small caps}) en facilite la saisie : + on saisira par exemple |Leslie~\bsc{Lamport}| pour + obtenir Leslie~\bsc{Lamport} sans risque de coupure \textsc{Lam-port} + en bout de ligne. + +\item les commandes |\primo|, |\secundo|, + |\tertio| et |\quarto| peuvent + être utilisées dans les énumérations ; elles donnent + \primo, \secundo, \tertio, \quarto. + Ensuite, |\FrenchEnumerate{6}| donne \FrenchEnumerate{6}. + +\item Les abréviations de «numéro», \No, \Nos, \no{} et \nos, sont obtenues + en tapant |\No|, |\Nos|, |\no| et |\nos| ; + l’espace qui suit est insécable : coder |\no1| ou |\no 1|. + +\item Le caractère \degre{} (à ne pas confondre avec le petit «o» de \No) + est saisi |\degre|, mais comme les espaces avant + et après ce caractère dépendent fortement de la police utilisée + (PostScript ou non), on emploiera |\degres| pour saisir + les températures « 20~\textdegree C » (codé |20~\degres C| + avec espace insécable) ou les titres alcooliques « 45\degres{} » + (codé |45\degres| sans espace). + Lorsque l’extension \ext{textcomp} est chargée (elle donne accès + aux « \TeX{} Companion fonts » qui contiennent un vrai symbole degré), + |\degres| utilise celui-ci (|\textdegree|). + +\item \hlabel{frenchdate} La commande + |\frenchdate|\marg{année}\marg{mois}\marg{jour}, qui prend trois arguments + numériques obligatoires, affiche les dates en français : + |\frenchdate{2001}{01}{01}| donne \frenchdate{2001}{01}{01}, le résultat + est inclus par défaut dans une boîte (|\hbox|) afin de ne jamais subir de + coupure de ligne (cf.~Gouriou, Ramat). En cas de difficulté + il est possible de redéfinir, localement par exemple, les commandes + |\FBdatebox| (|\hbox| par défaut) et |\FBdatespace| (|\space| par défaut) : + |\renewcommand*{\FBdatebox}{\relax}| supprime la |\hbox| tandis que + |\renewcommand*{\FBdatespace}{~}| rend les deux espaces insécables. + L’effet de ces deux commandes appliquées simultanément est d’interdire la + coupure sur les espaces mais d’autoriser éventuellement celle du mois + (jan-vier, dé-cembre, …) qui est interdite par défaut. + +\enlargethispage{\baselineskip} +\item En mode mathématique, la virgule est toujours suivie d’une espace + car elle est traitée comme un signe de ponctuation et non comme + une virgule décimale. La commande |\DecimalMathComma| supprime cette + espace (mais uniquement en français), on revient au comportement par + défaut avec |\StandardMathComma|. Remarquer qu’après une + commande |\DecimalMathComma|, il est nécessaire de saisir un espace + explicite dans les listes et les intervalles par exemple |$(x,\ y)$| + et |$[0,\ 1]$|. + Ces deux commandes sont utilisables n’importe où dans le document. + Une solution alternative consiste à utiliser l’extension \ext{icomma}. + +\item La commande |\nombre|, destinée à formater + automatiquement les nombres entiers ou décimaux par tranches de + trois chiffres séparées par des espaces en français et par des + virgules (usage anglo-saxon), fait désormais appel à la commande + |\numprint| de l’extension du même nom. + Lors du premier appel à la commande |\nombre|, + un message est affiché dans le fichier \file{.log} indiquant comment + charger \ext{numprint}. Le chargement de \ext{numprint} n’est pas fait + par \ext{babel-french} à cause du risque de conflit d’options. + Les utilisateurs devraient s’habituer progressivement à utiliser + |\numprint| (ou son raccourci |\np|) à la place de |\nombre|. + +\end{itemize} + +En ajoutant |\usepackage{xspace}| dans le préambule, les espaces suivant +les commandes +|\ier|,\dots, |\ieres|, +|\ieme|, |\iemes|, +|\fg| et |\dots| sont +respectés sans avoir à les forcer par des |{}| ou des~\verb*+\ +. + +\section{Personnalisation} +\label{sec:Perso} + +La commande \fbsetup{}, appelée précédemment |\frenchbsetup{}|% +\footnote{Ce dernier nom sera gardé comme alias par souci de compatibilité, + le nouveau devrait être préféré depuis l’abandon du nom \ext{frenchb} + au profit de \ext{babel-french} pour désigner l’option \opt{french} + de babel.}, +est à placer dans le préambule de chaque document après +le chargement de Babel ; elle permet de personnaliser le comportement de +\ext{babel-french} grâce au large choix parmi des options disponibles. +La syntaxe est celle de l’extension \ext{keyval}, largement +utilisée par d’autres extensions comme \ext{geometry} ou \ext{hyperref}. + +Le recours à un fichier de configuration \file{frenchb.cfg} a été supprimé en +version~3.0. + +\subsection[\textbackslash frenchsetup{}] + {\fbsetup{\textsl{$\langle$options$\rangle$}}} +\label{ssec:frenchbsetup} + +La commande \fbsetup{ShowOptions} affiche dans le fichier \file{.log} la liste +des options disponibles, nous allons parcourir cette liste et expliquer +l’effet de chacune d’elles. +Dans le cas d’une option booléenne, la mention \fbo{=true} peut être omise : +\fbsetup{ShowOptions} est équivalent à \fbsetup{ShowOptions=true}. + +Dans la liste ci-dessous, l’option activée par défaut est indiquée entre +parenthèses, éventuellement suivie d’un étoile. L’étoile indique que la valeur +par défaut correspond au cas où le français \emph{est la langue principale} +(voir section~\ref{sec:description}, page~\pageref{sec:description}), et que +cette valeur est inversée sinon. + +La liste étant longue, les options sont regroupées par thèmes. +\bgroup +\let\MyColor\ColorArg + +\subsubsection*{Inventaire des options} + +\begin{description} +\item [ShowOptions=true (false)] + affiche dans le fichier \file{.log} toutes les options + disponibles, ce qui permet de retrouver leurs noms facilement. +\end{description} + +\subsubsection*{Maquette générale} + +\begin{description} + +\item [StandardLayout=true (false*)] supprime toute action de + \ext{babel-french} sur la maquette dans le cas où le français est la + langue principale : retour aux listes standard, pas de + retrait des 1\iers{} paragraphes des sections, notes de bas de page + standard, séparateur «\string:» dans les légendes de figures et tableaux. + Lorsque le français n’est pas la langue principale, elle est sans effet. + +\item [GlobalLayoutFrench=false (true*)] ne devrait plus être utilisée sauf, + lorsque le français est la langue principale, pour retrouver le comportement + des versions de \ext{babel-french} antérieures à~v2.2 : dans les parties + rédigées dans des langues autres que le français, la présentation des listes + redevient standard et la mise en retrait des 1\iers{} paragraphes des + sections est supprimée. La présentation des notes de bas de page est + toujours indépendante de la langue de travail (à la française ou standard + pour tout le document selon la langue principale). + +\item [IndentFirst=false (true*)] ; par défaut, \ext{babel-french} applique un + retrait identique pour tous les paragraphes (de largeur |\parindent|), + y compris le premier de chaque section, ce qui est conforme à l’usage + français. Avec \fbo{IndentFirst=false} le retrait du premier paragraphe de + chaque section est supprimé, comme c’est l’usage en anglais, soit dans tout + le document si le français est la langue principale, soit seulement en + français. + +\item [PartNameFull=false (true)] ; par défaut \ext{babel-french} numérote les + parties créées par la commande |\part| en « Première partie », « Deuxième + partie », etc. Ceci fonctionne bien pour la plupart des classes (classes + standard, classes koma-script, memoir) mais pas pour les classes AMS qui + redéfinissent la commande |\part|. L’option \fbo{PartNameFull=false} permet + de revenir à une numérotation des parties plus standard -- « Partie~I », + « Partie~II », etc. --, ce qui supprime les risques de mauvais affichage du + genre « Première partie~1 » notamment dans la table des matières. + +\end{description} + +\subsubsection*{Présentation des listes} + +\begin{description} +\item [ListItemsAsPar=true (false)] ; mettre cette option à \fbo{true} + est recommandé à ceux qui souhaitent une présentation des listes + conforme aux usages en vigueur à l’Imprimerie nationale, voir + p.~\pageref{ListAsPar} pour une comparaison avec la disposition par défaut. + +\item [StandardListSpacing=true (false*)] ; par défaut \ext{babel-french} + modifie (en général en les réduisant, sauf pour les classes SMF) + les espaces verticaux% + \footnote{Il s’agit de \cs{itemsep}, \cs{parsep}, \cs{topsep} + et \cs{partopsep}.} + dans \emph{toutes les listes} produites à partir de l’environnement + \env{list}, en particulier les listes \env{enumerate}, \env{itemize} et + \env{description} mais aussi \env{abstract}, \env{quote}, \env{quotation}, + \env{verse}… \fbo{StandardListSpacing=true} permet de revenir + aux réglages standard (ceux de la classe utilisée), elle remplace l’ancienne + option \fbo{ReduceListSpacing} en l’inversant : + \fbo{StandardListSpacing=true} équivaut à \fbo{ReduceListSpacing=false} qui + pouvait être trompeuse dans le cas des classes SMF mais qui fonctionne + toujours pour ne pas compromettre la compilation d’anciens documents. + +\item [StandardItemizeEnv=true (false*)] ; par défaut l’environnement + \env{itemize} est redéfini pour qu’aucun espace vertical ne soit ajouté + à l’interligne standard entre les éléments d’une liste \env{itemize} et + pour adapter |\labelwidth| au marqueur utilisé. + + L’option |StandardItemizeEnv=true| empêche cette redéfinition, ce qui est + nécessaire en cas de conflit avec une classe ou une extension qui redéfinit + aussi l’environnement \env{itemize} (\ext{enumitem} ou \ext{paralist} + par exemple% + \footnote{\ext{babel-french} met automatiquement le drapeau + \fbo{StandardItemizeEnv} à \fbo{true} lorsque l’une des extensions + \ext{enumitem} ou \ext{paralist} est chargée.}). + L’interligne entre les éléments des listes \env{itemize} est alors + légèrement augmenté si \fbo{StandardListSpacing=false} ou l’est + nettement plus (on revient au réglage de base de la classe utilisée) si + \fbo{StandardListSpacing=true}. + + Les utilisateurs d’\ext{enumitem} qui souhaitent obtenir pour leurs listes + une présentation à la française, trouveront comment faire + page~\pageref{enumitem-cfg}.\hlabel{ch-enumitem} + +\item [StandardEnumerateEnv=true (false*)] ; depuis la version~2.6, + \ext{babel-french} redéfinit également les environnements \env{enumerate} et + \env{description} pour que leurs marges soient les mêmes que celles des + listes \env{itemize}. + + \fbo{StandardEnumerateEnv=true} empêche cette redéfinition, ce qui est + nécessaire en cas de conflit avec une classe ou une extension qui redéfinit + aussi l’environnement \env{enumerate} (\ext{enumerate}, \ext{enumitem} ou + \ext{paralist} par exemple% + \footnote{\ext{babel-french} met automatiquement le drapeau + \fbo{StandardEnumerateEnv} à \fbo{true} lorsque l’une des extensions + \ext{enumerate}, \ext{enumitem} ou \ext{paralist} est chargée.}). + +\item [StandardItemLabels=true (false*)] restitue aux + marqueurs des listes \env{itemize} les valeurs standard attribuées par + la classe de document ou les extensions utilisées. + +{\sloppy +\item [ItemLabels=\boi{}textbullet, \boi{}textendash, + \boi{}ding{43},... (\boi{}textemdash*)] ; + option qui permet de choisir le marqueur + utilisé dans les listes \env{itemize} en français (\emph{sauf} bien sûr + si \fbo{StandardItemLabels=true}). + Noter que |\ding{43}| suppose que l’extension \ext{pifont} soit + chargée. Cette option affecte tous les niveaux de la liste. + Les quatre options suivantes fonctionnent de même mais n’affectent elles + qu’un niveau chacune : +\par} + +\item [ItemLabeli=\boi{}textbullet, \boi{}textendash, + \boi{}ding\{43\},... (\boi{}textemdash*)] + +\item [ItemLabelii=\boi{}textbullet, \boi{}textendash, + \boi{}ding\{43\},... (\boi{}textemdash*)] + +\item [ItemLabeliii=\boi{}textbullet, \boi{}textendash, + \boi{}ding\{43\},... (\boi{}textemdash*)] + +\item [ItemLabeliv=\boi{}textbullet, \boi{}textendash, + \boi{}ding\{43\},... (\boi{}textemdash*)] + +{\sloppy +\item [StandardLists=true (false*)] ; supprime toute action de + \ext{babel-french} sur les listes, elle équivaut aux quatre options + \fbo{StandardItemLabels=true}, \fbo{StandardItemizeEnv=true}, + \fbo{StandardEnumerateEnv=true} et \fbo{StandardListSpacing=true}. + Lors de l’utilisation d’une classe ou d’une extension qui modifie la + présentation des listes, il peut y avoir conflit avec \ext{babel-french} ; + dans ce cas l’option \fbo{StandardLists} (ou éventuellement l’une ou l’autre + des quatre sous-options plus ciblées qu’elle regroupe) devrait régler le + problème% + \footnote{L’option \fbo{StandardLists} est automatiquement activée avec la + classe \cls{beamer}.}. +\par} + +\item [ListOldLayout=true (false*)] ne devrait être utilisée que pour + recomposer d’anciens documents à l’identique, c’est-à-dire pour retrouver + la présentation des listes qui prévalait avant la version~2.6a. + +\end{description} + +\subsubsection*{Présentation des notes de bas de page} + +\begin{description} + +\item [FrenchFootnotes=false (true*)] fait revenir à la + présentation standard des notes de page, telle que définie par la classe ou + les extensions utilisées. Cette option affecte la totalité du document. + La commande |\StandardFootnotes| peut encore être utilisée + \emph{localement}, par exemple dans les environnements \env{minipage} si la + présentation «à la française» ne convient pas (notes numérotées `a’, `b’, + etc.). + +\item [AutoSpaceFootnotes=false (true*)] supprime l’espace fine + insécable ajoutée par défaut avant l’appel de chaque note dans le texte + courant. Cette option affecte la totalité du document. + +\end{description} + +\subsubsection*{Ponctuation haute} + +\begin{description} + +\item [AutoSpacePunctuation=false (true)] ; par défaut, \ext{babel-french} + corrige la faute de saisie qui consiste à omettre l’espace devant la + ponctuation haute (\string: \string; \string? \string!) en ajoutant + automatiquement une espace insécable de taille adaptée. + Toutefois, l’ajout d’espace n’a pas lieu lorsque la police courante est + à espacement fixe% + \footnote{Ceci évite en particulier les problèmes en verbatim.} : + |\texttt{http://truc}| produit \texttt{http://truc}. + + Le moteur LuaTeX permet un contrôle fin de l’ajout d’espace devant le + deux-points : si ce caractère n’est pas précédé d’un espace et que celui qui + le suit est de type \textit{glyphe} (lettre, chiffre, /, \textbackslash, etc.) + aucune espace n’est ajoutée en sortie, ce qui évite les espaces parasites + dans les URLs (ftp://monsite), les chemins MSDOS (C:\textbackslash) et les + horaires (10:55). Avec XeTeX ou pdfTeX |\textsf{http://truc}| donne + \textsf{http~://truc} (espace parasite avant le «:»). + + Il y a une autre exception avec les moteurs LuaTeX et XeTeX : + si l’utilisateur code une espace insécable U+00A0 (\emph{pas} + \raisebox{-1ex}{\huge\code{\tild}}) ou une fine insécable + U+202F, ces caractères sont recopiés tels quels en sortie, + sans ajout d’espace par \ext{babel-french}. + + Ceux qui sont sûrs de leur saisie peuvent mettre cette option à + \fbo{false} pour contrôler complètement l’ajout d’espace devant la + ponctuation haute : l’espace adéquate (toujours insécable) est ajoutée + si et seulement si un espace précède le signe de ponctuation dans le + fichier source. Ils éviteront ainsi, quel que soit le moteur utilisé, + de voir des espaces ajoutées à tort. + + Autre solution pour les autres : laisser le mode par défaut et éviter, + le cas échéant, l’insertion d’espaces parasites en utilisant la commande + |\NoAutoSpacing| dans un groupe, par exemple |{\NoAutoSpacing 10:55}| + (XeTeX et pdfTeX, inutile avec LuaTeX). + +\item [ThinColonSpace=true (false)] ; par défaut l’espace placée + avant le `\string:’ est une espace-mot insécable, cette option la remplace + par une espace fine insécable. Certains auteurs font ce choix pour que les + espaces précédant les quatre signes de ponctuation haute soient identiques. + Le choix par défaut correspond à la maquette de l’Imprimerie nationale, + le Guide du typographe (ex-roman) préconise lui l’espace fine devant le + `\string:’. + + Il est possible de redéfinir complètement la taille des espaces précédant + la ponctuation haute (ou les guillemets français) en utilisant dans le + préambule la commande |\FBsetspaces| qui admet un argument optionnel + (pour le dialecte \lang{french} ou \lang{acadian}, son absence équivaut + à \lang{french}) et quatre arguments obligatoires : le premier précise le + type d’espace à redéfinir, il doit être |colon| (pour le~`:’), |thin| + (pour~`;’ `!’ et `?’) ou |guill| pour les guillemets chevrons), + les trois suivants sont des nombres décimaux qui définissent la largeur + (\textit{width}), l’extensibilité (\textit{stretch}) et la compressibilité + (\textit{shrink}) de l’espace exprimées en \textit{fontdimen}. + \hlabel{FBsetspaces} + Le dialecte \lang{acadian} utilise les valeurs définies pour \lang{french} + sauf présence dans le préambule de commandes spécifiques + |\FBsetspaces[acadian]|. + + Exemples : les valeurs |{1}{1}{1}| correspondent à l’espace-mot justifiante + (utilisée par défaut devant le deux-points), |{0.5}{0}{0}| + à l’espace fine (utilisée par défaut devant `;’ `!’ et `?’, noter son + absence d’élasticité) et |{0.8}{0.3}{0.8}| à l’espace utilisée par défaut + à l’intérieur des guillemets. + + |\FBsetspaces{colon}{0.5}{0}{0}| est équivalent + à l’option~\fbo{ThinColonSpace} (vaut pour le français et le canadien). + + |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| redéfinit l’espace précédant + le~`:’ en espace fine seulement pour le canadien. + + |\FBsetspaces{colon}{1}{0}{0}| met une espace-mot sans élasticité devant + les~`:’. + +\item [OriginalTypewriter=true (false)] ; par défaut, lorsqu’une police + à espacement fixe est utilisée (|\texttt{}|, mode verbatim, listings, etc.) + \ext{babel-french}, n’ajoute jamais d’espace avant la ponctuation haute ni + après `«’, ni avant `»’ même si ces caractères ont été activés par l’option + \fbo{og=«, fg=»}. De plus, les espaces présents dans texte source ne sont + pas modifiés, par exemple |\texttt{X != Y}| produit \texttt{X != Y} (pas + d’espace fine avant le~`!’). + Mettre cette option à \fbo{true} supprime ce comportement, ce qui peut être + utile pour recompiler à l’identique des anciens textes. + +\item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp} cette option + expérimentale n’a d’effet qu’avec LuaLaTeX ; lorsqu’on la met à \fbo{true} + les espaces insécables ajoutées par \ext{babel-french} dans le fichier PDF + de sortie (ponctuation haute, guillemets, etc.) sont codées sous forme de + caractères Unicode (U+A0 ou U+202F fine) au lieu des pénalités et ressorts + de type \textit{glues}. Ceci devrait préserver ces espaces lors de la + conversion en HTML des fichiers produits par LuaLaTeX, malheureusement la + version actuelle de \exe{pdftotext} ne les restitue pas correctement. + + En revanche, \exe{lwarp} (v.~0.37 et suivantes) est totalement compatible + avec \ext{babel-french} pour la conversion des fichiers PDF produits sous + XeLaTeX et pdfLaTeX : les espaces insécables sont préservées. + +\end{description} + +\subsubsection*{Guillemets} + +\begin{description} + +\item [og=«, fg=»]% + \footnote{Les valeurs affectées à \fbo{og} et \fbo{fg} sont les vrais + guillemets \fbo{«} et \fbo{»}, pas \fbo{<{}<} et \fbo{>{}>}. + Les espaces avant et après ces guillemets dans la commande + \fbsetup{} sont optionnels.} ; + \hlabel{og-fg} lorsqu’on dispose de guillemets français au + clavier (grâce à une touche \textit{compose} par exemple), cette option permet + d’utiliser directement ces guillemets à la place des commandes |\og| et |\fg|% + \footnote{Toutefois, si des guillemets doivent être utilisés dans une + commande \cs{index}, ils \emph{doivent} être codés en \cs{og} et + \cs{fg}.}. + On peut ainsi saisir \code{«guillemets»} ou \code{« guillemets »} (avec ou + sans espaces à l’intérieur) pour obtenir «guillemets» avec espaces + insécables adéquates en français. En revanche, si on active cette option, + \emph{il ne faut pas coder explicitement les espaces insécables} : + \code{«}|~|\code{guillemets}|~|\code{»} + produirait «~guillemets~» où l’espace qui suit le guillemet ouvrant est + trop large. + + Les espaces insécables ne sont ajoutées que lorsque la langue + courante est le français : en allemand, le codage \code{(»Auf Deutsch«)} + produit \foreignlanguage{german}{(»Auf Deutsch«)}. %» + + Ceci fonctionne en (pdf)LaTeX pour les codages d’entrée 8-bits (latin1, + latin9, ansinew, applemac,\dots) et pour les codages sur plusieurs octets + comme utf8 ou utf8x. Ceci fonctionne également avec LuaLaTeX et XeLaTeX ; + avec ces deux derniers toutefois, comme pour la ponctuation haute, + \ext{babel-french} respecte les espaces insécables U+00A0 et U+202F (fine). + +\item [INGuillSpace=true (false)] ; force \ext{babel-french} à mettre une + espace-mot justifiante insécable après les guillemets ouvrants et avant les + guillemets fermants comme le préconise l’Imprimerie nationale. Par défaut + les espaces insérées par \ext{babel-french} sont légèrement plus étroites et + moins extensibles qu’une espace-mot.\hlabel{INGuillspace} + + Cette option est équivalente à |\FBsetspaces{guill}{1}{1}{1}|, voir + p.~\pageref{FBsetspaces}. + +\item [EveryParGuill=open, close, none (open)] ; + selon sa valeur, cette option + ajoute un guillemet ouvrant + \bgroup\NoAutoSpacing + («\FBguillspace), fermant (»\FBguillspace)% + \egroup{} + ou rien au début de chaque paragraphe inclus dans une citation de premier + rang codée avec |\frquote{}|.\hlabel{everyparguill} + + Lorsque \fbo{InnerGuillSingle=true}, cette option est également prise en + compte pour les citations de second rang (internes) : selon sa valeur, un + guillemet simple ouvrant + \bgroup\NoAutoSpacing + (\guilsinglleft\FBguillspace), ou fermant (\guilsinglright\FBguillspace)% + \egroup, + ou rien, est ajouté à chaque début de paragraphe. + + Lorsque \fbo{InnerGuillSingle=false}, rien n’est ajouté en début de + paragraphe dans les citations de second rang. + +\item [EveryLineGuill=open, close, none (none)] ; + selon sa valeur, cette option + ajoute un guillemet ouvrant, fermant, ou rien, au début de chaque ligne + d’une citation de second rang. Notez que les citations de premier et de + secong rang doivent être toutes deux codées avec |\frquote{}| et que l’ajout + automatique de guillemets au début de ligne \emph{ne fonctionne qu’avec + LuaTeX}. + Lorsque \fbo{EveryLineGuill=open} ou \fbo{close} la citation interne + est toujours balisée par des guillemets français « et », l’option suivante + est sans effet. + +\item [InnerGuillSingle=true (false)] ; si \fbo{InnerGuillSingle=true} + les citations internes sont balisées comme + \guilsinglleft\FBguillspace ceci\FBguillspace\guilsinglright, + sinon comme ``cela’’. + +\end{description} + +\subsubsection*{Présentation des nombres} + +\begin{description} + + {\sloppy +\item [ThinSpaceInFrenchNumbers=true (false)] remplace le + séparateur des milliers utilisé en français par la commande + |\numprint{}| (ou son alias |\nombre{}|) pour le formatage + des nombres, par une espace fine (par défaut c’est une espace mot + insécable et sans élasticité en français). + Cette option n’a d’effet que si l’extension \ext{numprint} est chargée + avec l’option \opt{autolanguage} ; + sans elle, \ext{numprint} formate les nombres indépendamment de la langue + courante et le séparateur des milliers est par défaut l’espace fine. +\par} + +\end{description} + +\subsubsection*{Légendes de figures et tables} + +\begin{description} + +\item [SmallCapsFigTabcaptions=false (true*)]; si cette option est mise + à \fbo{false}, le recours aux petites capitales dans les intitulés des + légendes de figures et tables est supprimé, on obtient « Figure » et + « Table » au lieu de « \textsc{Figure} » et « \textsc{Table} ».% + \hlabel{scfigtab} + +\item [CustomiseFigTabcaptions=false (true*)] ; si cette option est mise + à \fbo{false}, le séparateur défini par |\CaptionSeparator| est remplacé par + le séparateur par défaut (deux-points) dans les légendes des figures et des + tables, ceci pour toutes les langues. En français, \ext{babel-french} ajoute + si possible une espace insécable adéquate devant le deux-points ou affiche + un message dans le fichier \file{.log}. + +\item [OldFigTabcaptions=true (false)] peut être utilisée pour retrouver + la présentation antérieure (pré~3.0) des légendes de figures et tables, + c.-à-d. |\CaptionSeparator| en français et deux-points pour les autres + langues. Cette option ne fonctionne que pour les classes standard + \cls{article}, \cls{report}, \cls{book}. + +\end{description} + +\subsubsection*{Divers : lettres supérieures et « warnings »} + +\begin{description} + +\item [FrenchSuperscripts=false (true)] ne devrait être utilisée que pour + recompiler des anciens fichiers à l’identique. Elle redéfinit |\up| comme + |\textsuperscript| alors que par défaut |\up| fait appel à la + commande |\fup| plus conforme aux usages francophones (voir + section~\ref{sec:description}, p.~\pageref{sec:description}. + +\item [LowercaseSuperscripts=false (true)] rend possible d’avoir des lettres + supérieures en capitales (est-ce bien utile ?). Par défaut, la nouvelle + commande |\up| (sauf si elle est redéfinie en |\textsuperscript| par l’option + précédente) empêche le passage en capitales des lettres supérieures dans les + hauts de pages par exemple. + +\item [SuppressWarning=true (false)] peut être utilisée pour supprimer les + avertissements non essentiels émis par \ext{babel-french}. + +\end{description} +\egroup + +\subsubsection*{Ordre des options} + +Il faut se souvenir que les options sont prises en compte dans l’ordre où +elles sont écrites dans la commande \fbsetup{}. + +Exemple : un utilisateur souhaitant que \ext{babel-french} ne touche pas à la +présentation des listes ni à celle des notes de bas de page +mais ajoute un renfoncement au début des 1\iers{} paragraphes de section +peut faire \fbsetup{StandardLayout,IndentFirst}. +S’il choisissait l’ordre inverse +l’option \fbo{IndentFirst} serait annulée par \fbo{StandardLayout}. + +Cet utilisateur obtiendrait également le résultat souhaité en codant\\ +\fbsetup{StandardLists,FrenchFootnotes=false,AutoSpaceFootnotes=false}\\ +là, l’ordre est indifférent car les options sont indépendantes. + +\subsection[Traduction des intitulés] + {Traduction des intitulés (« caption names » en anglais)} +\label{ssec:captions} + +Voici la liste des traductions proposées par \ext{babel-french} : + +{\setcounter{LTchunksize}{30} % Pour réduire le nombre de compilations. +\setlength{\LTleft}{0pt} % Avec \extracolsep{\fill}, assure que le +\setlength{\LTright}{0pt} % tableau prend toute la largeur de page. +\setlength{\LTpost}{\smallskipamount} +\newcommand*\name[1]{% + \texttt{\ColorVerb\textbackslash#1name}% + &\texttt{\ColorVerb\textbackslash french#1name}} + +\begin{longtable}{|l!{\extracolsep{\fill}}l!{\extracolsep{\fill}}l|} +\hline +Commande Babel & Commande pour le français & Intitulé par défaut en français\\* +\hline +\name{abstract} & Résumé\\* +\name{bib} & Bibliographie\\ +\name{ref} & Références\\ +\name{preface} & Préface\\ +\name{chapter} & Chapitre\\ +\name{appendix} & Annexe\\ +\name{contents} & Table des matières\\ +\name{listfigure} & Table des figures\\ +\name{listtable} & Liste des tableaux\\ +\name{index} & Index\\ +\name{glossary} & Glossaire\\ +\name{figure} & {\scshape Figure}\\ +\name{table} & {\scshape Table}\\ +\name{part} & Première partie, Deuxième partie…\\ +\name{encl} & P.~J.\\ +\name{cc} & Copie à \\ +\name{headto} & $\langle$\textit{vide}$\rangle$\\ +\name{page} & page\\ +\name{see} & voir\\ +\name{also} & voir aussi\\* +\name{proof} & Démonstration\\* +\hline +\end{longtable} +} + +Il est facile de modifier ces traductions : pour remplacer « Démonstration » +par « Preuve » (avec \ext{amsthm}) ajouter dans le préambule +|\def\frenchproofname{Preuve}|% +\footnote{Les puristes peuvent remplacer \cs{def} par \cs{renewcommand*} + s’ils le souhaitent.}, +noter que l’ancienne syntaxe |\addto\captionsfrench{\def\proofname{Preuve}}| +fonctionne toujours.\hlabel{captionsfrench} + +{\sloppy +\emph{Attention}, dans les deux cas, le nom de la langue est +\emph{obligatoirement} \opt{french}, les variantes \opt{frenchb} ou +\opt{francais} seraient sans effet ! Les commandes +|\acadianabstractname|, \dots, |\acadianproofname| sont, elles, définies +(comme leurs homologues françaises) et personnalisables pour le français du +Canada (option \lang{acadian}). +\par} + +La modification des noms de parties est plus complexe : si on préfère +« Partie~I », « Partie~II » à « Première partie », « Deuxième partie », +il suffit de redéfinir |\frenchpartname| comme ceci +|\def\frenchpartname{Partie}|\samefntmk{} ; +utiliser l’option \fbo{FullPartName=false} dans \fbsetup{} aboutit au même +résultat. +Si en revanche on veut que |\part{}| produise par exemple « Première phase », +« Deuxième phase », il faut redéfinir |\frenchpartnameord| et non +|\frenchpartname| : |\def\frenchpartnameord{phase}|\samefntmk. +Le remplacement de « Deuxième » par « Seconde » est possible en codant +|\def\frenchpartsecond{Seconde}|\samefntmk{} dans le préambule. +De même il est possible de remplacer « Première » par « Premier » en codant +|\def\frenchpartfirst{Premier}|\samefntmk. + +On remarquera que |\figurename| et |\tablename| sont en petites capitales en +français. Il serait préférable, notamment dans un document multilingue, de +s’en tenir à la traduction pure +(|\def\frenchfigurename{Figure}|\samefntmk, +|\def\frenchtablename{Table}|\samefntmk) +et de choisir les attributs de la police +(|\scshape| par exemple) au niveau de la classe ou d’une extension comme +\ext{captions}. L’option \fbo{SmallCapsFigTabCaptions} (p.~\pageref{scfigtab}) +peut être mise à \fbo{false} pour supprimer le passage en petites capitales. + +\subsection{Présentation des listes} +\label{ssec:lists} + +Voici la présentation par défaut% +\footnote{L’option \fbo{ListItemsAsPar} permet une autre présentation, voir + ci-dessous p.~\pageref{ListAsPar}.} +pour les listes \env{itemize} (tiret cadratin et alignement des tirets de +premier niveau sur le retrait (|\parindent|) de début de paragraphe) :\par +{\centering + \fbox{\begin{minipage}[t]{.40\textwidth}\raggedright + \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{itemize} + \item Premier élément sur plus d’une ligne\dots{} + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{itemize} + \item Second élément\dots + \end{itemize} + \end{minipage}}\par +} + +Ceux qui préfèrent le tiret demi-cadratin (\textendash) comme marqueur peuvent +ajouter l’option \fbsetup{ItemLabels=\boi{}textendash}, d’autres options +existent voir section~\ref{ssec:frenchbsetup}. + +\ext{babel-french} applique aux listes \env{enumerate} et \env{description} +les mêmes retraits horizontaux qu’aux listes \env{itemize}, tous sont donc +basés sur la largeur du marqueur choisi, |\textemdash| par défaut, +|\textendash|, ou autre. + +{\sloppy +Trois paramètres dimensionnels permettent d’ajuster la présentation des +listes \env{itemize}, \env{enumerate} et \env{description} : +\begin{description} +\item [\cs{listindentFB}] dont la valeur par défaut est + |\parindent| si |\parindent| est non nul et |1.5em| (valeur standard de + |\parindent|) sinon ; |\listindentFB| permet modifier la marge gauche du + premier niveau de liste (ce qui déplace aussi les listes incluses). + + Exemple : en ajoutant |\setlength{\listindentFB}{0pt}| dans le préambule, + les étiquettes de toutes les listes de premier niveau colleront à la marge + gauche au lieu d’être décalées vers la droite. + +% Illustration de \parindent et \listindentFB +\vspace{.5\baselineskip} +\begin{minipage}[t]{.45\textwidth} +\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright + \FBListItemsAsParfalse \parindent=0pt \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{itemize} + \item Premier élément sur plus d’une ligne\dots{} + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{itemize} + \item Second élément\dots + \end{itemize} + \end{minipage} +}\\ +\hspace*{\fill}|\parindent=0pt|\hspace*{\fill}% +\end{minipage} +\hspace{\fill} +\begin{minipage}[t]{.5\textwidth} +\hspace*{\fill} +\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 + \FBListItemsAsParfalse \parindent=0em \listindentFB=0em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{itemize} + \item Premier élément sur plus d’une ligne\dots{} + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{itemize} + \item Second élément\dots + \end{itemize} + \end{minipage} +}\hspace*{\fill}\\ +\hspace*{\fill}|\parindent=0pt| \emph{et} |\listindentFB=0pt|\hspace*{\fill}% +\end{minipage} + +\vspace{\baselineskip} +\item [\cs{labelwidthFB}] dont la valeur par défaut est la largeur de + |\FrenchLabelItem| (c.-à.d. |\textemdash| sauf changement décidé par + l’utilisateur) ; il est possible de fixer la valeur de |\labelwidthFB| + niveau par niveau, voir le second exemple ci-dessous. + +% Illustration de \labelwidthFB +\bgroup +\renewcommand*{\thempfootnote}{\arabic{mpfootnote}} +\parindentFFN=4pt\relax +\begin{minipage}[t]{.45\textwidth} +\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright + \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{enumerate} + \item Premier élément sur plus d’une ligne\dots{} + \begin{enumerate} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{enumerate} + \item Second élément\dots + \end{enumerate} + \end{minipage} +}\\ +\hspace*{\fill}Présentation par défaut% +\footnote{Remarquer l’alignement vertical avec l’exemple ci-dessus.} +\hspace*{\fill} +\end{minipage} +\hspace{\fill} +\begin{minipage}[t]{.5\textwidth} % .45 +\stepcounter{mpfootnote} +\hspace*{\fill} +\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright + \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{enumerate} + \item Premier élément sur plus d’une ligne\dots{} + \settowidth{\labelwidthFB}{(a)}% + \begin{enumerate} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{enumerate} + \item Second élément\dots + \end{enumerate} + \end{minipage} +}\hspace*{\fill}\\ +\hspace*{\fill}|\settowidth{\labelwidthFB}{(a)}|% +\footnote{Commande à placer juste avant le second environnement + \env{enumerate}.}% +\hspace*{\fill} +\end{minipage} +\egroup + +\vspace{\baselineskip} +\item [\cs{descindentFB}] dont la valeur par défaut est |\listindentFB| permet + de traiter les listes de type \env{description} différemment des autres : + pour que les étiquettes des seules listes \env{description} collent à la + marge gauche, il suffit d’ajouter dans le préambule + |\setlength{\descindentFB}{0pt}|. + +% Illustration de \parindent et \descindentFB +\vspace{.5\baselineskip} +\begin{minipage}[t]{.45\textwidth} +\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright + \FBListItemsAsParfalse + \parindent=0pt \listindentFB=1.5em \descindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{description} + \item [Premier] élément occupant plus d’une ligne\dots{} + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{itemize} + \item [Second] élément\dots + \end{description} + \end{minipage} +}\\ +\hspace*{\fill}|\parindent=0pt|\hspace*{\fill}% +\end{minipage} +\hspace{\fill} +\begin{minipage}[t]{.5\textwidth} +\hspace*{\fill} +\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 + \FBListItemsAsParfalse + \parindent=0pt \listindentFB=1.5em \descindentFB=0pt + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste + \begin{description} + \item [Premier] élément occupant plus d’une ligne\dots{} + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2, + \end{itemize} + \item [Second] élément\dots + \end{description} + \end{minipage} +}\hspace*{\fill}\\ +\hspace*{\fill}|\parindent=0pt| \emph{et} |\descindentFB=0pt|\hspace*{\fill}% +\end{minipage} +\end{description} +\par} + +\vspace{\baselineskip} +L’option \fbo{ListItemsAsPar} propose une présentation plus conforme aux +usages typographiques français, voir par exemple ce qui est fait dans le +« Lexique des règles typographiques en usage à l’Imprimerie nationale ». +\hlabel{ListAsPar} +Les éléments des listes sont alors présentés comme des paragraphes, les +marqueurs (tirets, etc.) étant placées en retrait de la marge gauche ; +dans la présentation par défaut les étiquettes sont placées en saillie dans la +marge gauche et celle-ci est augmentée comme le montre l’exemple ci-dessous. + +Noter que toute cette documentation a été compilée avec l’option +\fbo{ListItemsAsPar} dont l’effet est bien visible dans les +sections~\ref{sec:description} (listes \env{itemize}) et +\ref{sec:Perso} (listes \env{description}). + +% Illustration de l’option \fbo{ListItemsAsPar} +\vspace{.5\baselineskip} +\begin{minipage}[t]{.45\textwidth} +\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright + \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste et qui s’étend sur deux lignes. + \begin{itemize} + \item Premier élément qui se prolonge sur plusieurs… + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2 sur plus d’une ligne… + \end{itemize} + \item Second élément\dots + \end{itemize} + \end{minipage} +}\\ +\hspace*{\fill}Présentation par défaut\hspace*{\fill}% +\end{minipage} +\hspace{\fill} +\begin{minipage}[t]{.5\textwidth} +\hspace*{\fill} +\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 + \FBListItemsAsPartrue \parindent=1.5em \listindentFB=1.5em + \noindent$\Leftarrow$ Marge gauche\par + Paragraphe précédant la liste et qui s’étend sur deux lignes. + \begin{itemize} + \item Premier élément qui se prolonge sur plusieurs lignes… + \begin{itemize} + \item Un élément niveau 2, + \item Second élément niveau 2 sur plus d’une ligne… + \end{itemize} + \item Second élément\dots + \end{itemize} + \end{minipage} +}\hspace*{\fill}\\ +\hspace*{\fill}\fbo{ListItemsAsPar=true}\hspace*{\fill}% +\end{minipage} + +\vspace{\baselineskip} +Enfin, pour ceux qui voudraient bénéficier des facilités offertes par +l’extension \ext{enumitem} et conserver une présentation des listes +similaire à celle obtenue par défaut avec \ext{babel-french}, je propose +les quelques lignes de code suivantes à copier-coller dans le +préambule :\hlabel{enumitem-cfg} + +{%\small +|\usepackage{enumitem}|\\ +|\newlength\mylabelwidth|\\ +|\newcommand*{\mylabel}{\textemdash} % ou \textendash (tiret plus court)|\\ +|\settowidth{\mylabelwidth}{\mylabel}|\\ +|\setlist[itemize]{label=\mylabel, nosep}|\\ % nosep ou noitemsep +|\setlist[1]{labelindent=\parindent}|\\ +|\setlist{labelwidth=\mylabelwidth, leftmargin=!|\\ +| itemsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % enumitem ne redéfinit pas +| parsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % \list, on peut s’en passer +| topsep=0.8ex plus 0.4ex minus 0.4ex,|\\ % sauf option StandardLists, +| partopsep=0.4ex plus 0.2ex minus 0.2ex}| % évidemment ! +} + +Pour une présentation correspondant à l’option \fbo{ListItemsAsPar=true} on +aurait : + +{%\small +|\usepackage{enumitem}|\\ +|\newlength\mylabelwidth|\\ +|\newlength\myitemindent|\\ +|\newcommand*{\mylabel}{\textemdash} % ou \textendash (tiret plus court)|\\ +|\settowidth{\mylabelwidth}{\mylabel}|\\ +|\setlength{\myitemindent}{\parindent}|\\ +|\addtolength{\myitemindent}{\mylabelwidth}|\\ +|\addtolength{\myitemindent}{\labelsep}|\\ +|\setlist[itemize]{label=\mylabel, nosep}|\\ +|\setlist[1]{leftmargin=0pt}|\\ +|\setlist{leftmargin=\parindent, itemindent=\myitemindent,|\\ +| itemsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % enumitem ne redéfinit pas +| parsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % \list, on peut s’en passer +| topsep=0.8ex plus 0.4ex minus 0.4ex,|\\ % sauf option StandardLists, +| partopsep=0.4ex plus 0.2ex minus 0.2ex}| % évidemment ! +} + +%\newpage +\section{Changements entre les versions 3.4 et 2.6} +\label{sec:changes-3.0} + +\subsection{Changements entre les versions \latestversion{} et 3.4d} +\label{ssec:changes-3.5} + +La version 3.5a propose une nouvelle option \fbo{ListItemsAsPar} qui permet +une présentation des listes plus conforme à la tradition typographique +française, voir p.~\pageref{ListAsPar}. La présentation par défaut des listes +est inchangée. + +Quelques bogues affectant la commande |\frquote{}| ont été corrigées dans les +versions 3.5b à 3.5d. Cette dernière introduit une nouvelle option +\fbo{StandardListSpacing} à utiliser à la place de \fbo{ReduceListSpacing}, +voir p.~\pageref{ListAsPar}. La présente documentation est maintenant +incluse dans la distribution \ext{babel-french} sur CTAN. + +La commande |\NoEveryParQuote| a été ajoutée en version~3.5e, voir +p.~\pageref{frquote}. + +\subsection{Changements entre les versions 3.4d et 3.3d} +\label{ssec:changes-3.4} + +La version 3.4a introduit une nouvelle commande |\frenchdate| (voir +p.~\pageref{frenchdate}) et corrige une bogue mineure : |\FBthousandsep| n’est +plus une espace justifiante insécable mais une espace rigide (de même valeur). +Le retour à l’ancien comportement est obtenu par l’ajout dans le préambule de +|\renewcommand*{\FBthousandsep}{~}|. + +Les deux options \lang{french} et \lang{acadian} peuvent maintenant être +utilisées simultanément dans un même document ; elles ne présentent par défaut +aucune différence mais rien n’empêche de les personnaliser différemment +en ce qui concerne les motifs de césures, les légendes ou la ponctuation. + +Une commande |\FBsetspaces| a été ajoutée pour faciliter le réglage des +espaces précédant la ponctuation haute et les guillemets avec la possibilité +de réglages différents selon l’option \lang{french} ou \lang{acadian}, voir +p.~\pageref{FBsetspaces}. + +À partir de La version 3.4, eTeX et LuaTeX 1.0 sont requis. + +\subsection{Changements entre les versions 3.3d et 3.2h} +\label{ssec:changes-3.3} + +Le contrôle de l’ajout d’espace devant le deux-points a été amélioré dans la +version 3.3d mais uniquement avec le moteur LuaTeX : il n’y a plus d’ajout +d’espace parasite dans les URL (http://monsite), les chemins MSDOS +(C:\boi Mes Documents) ou les horaires (10:55). + +Lors de la conversion en HTML par \exe{lwarp} (versions 0.37 et suivantes) +des fichiers compilés sous XeLaTeX ou pdfLaTeX, les espaces insécables ajoutées +par \ext{babel-french} pour la ponctuation haute et les guillemets sont +respectées. +Une nouvelle option (expérimentale) \fbo{UnicodeNoBreakSpaces} pour LuaLaTeX +a été ajoutée dans la version~3.3c, voir~\pageref{ucs-nbsp}. + +{\sloppy +La version 3.3b a subi un réaménagement interne : chaque langue ou dialecte de +Babel devrait avoir son propre fichier \file{.ldf}. Ainsi pour le français il +y a dorénavant \file{french.ldf} qui contient le code principal et quatre +fichiers satellites \file{frenchb.ldf}, \file{francais.ldf}, \file{acadian.ldf} +et \file{canadien.ldf}. L’option à utiliser pour charger le français avec +Babel est toujours \opt{french} (ou \opt{acadian} pour le français du Canada +pour l’instant identique au français de base), les autres options (\opt{frenchb}, +\opt{francais} ou \opt{canadien}) sont déconseillées et affichent un message +d’avertissement dans le fichier \file{.log}.\par +} + +La version 3.3a disponible dans TeXLive 2017 est compatible avec LuaTeX 1.0.4 +(stable) mais aussi avec la version 0.95 (beta) de TL2016. +L’espacement de la ponctuation haute et des guillemets français est maintenant +contrôlé par les \emph{commandes} |\FBcolonspace|, |\FBthinspace| et +|\FBguillspace| quel que soit le moteur utilisé (LuaTeX, XeTeX ou pdfTeX) ; +auparavant LuaTeX avait recours à des \emph{glue} |\FBcolonskip|, +|\FBthinskip| et |\FBguillskip|. + +L’option \opt{french} devant être préférée à \opt{frenchb}, il m’a semblé +judicieux de renommer la commande de personnalisation |\frenchbsetup{}| en +|\frenchsetup{}|, l’ancien nom étant conservé par souci de compatibilité. + +De nouvelles possibilités de personnalisation de la commande |\part{}| ont été +introduites, voir page~\pageref{ssec:captions}. + +\subsection{Changements entre les versions 3.2h et 3.1m} +\label{ssec:changes-3.2} + +La version 3.2g modifie le comportement par défaut de la commande |\frquote{}| +sous LuaTeX qui est maintenant le même que sous XeTeX ou pdfTeX. +Il suffit d’ajouter l’option \fbo{EveryLineGuill=open} pour retrouver le +comportement des versions précédentes. + +Depuis la version 3.2f, \ext{babel-french} est compatible avec l’extension +\ext{icomma} qui offre une solution alternative à la commande +|\DecimalMathComma|. + +La construction des notes de bas de page a été revue pour les classes +\cls{beamer}, \cls{memoir} et koma-script (\cls{scrartcl}, \cls{scrreprt} +et \cls{scrbook}). Le rendu final est conservé mais les possibilités de +personnalisation offertes par ces classes pour la présentation des notes de +bas de page (changement de police, de couleur, etc.) sont désormais +disponibles même lorsque l’option \fbo{FrenchFootnotes} est activée. + +Un vieux bug affectant le comportement de |\frquote{}| lorsque l’extension +\ext{xspace} est chargée, a été corrigé. + +Les commandes |\NoAutoSpacing|, |\ttfamilyFB|, |\rmfamilyFB| et |\sffamilyFB| +ont été complètement réécrites dans la version~3.2c afin de leur assurer un +comportement identique quel que soit le moteur utilisé, pdfTeX, XeTeX ou +LuaTeX. + +\textbf{{babel-french} v.3.2b et suivantes, mise en garde pour les + utilisateurs de Lua(La)TeX :} +\nopagebreak +La version~3.2b est la première compatible avec la version~0.95 de LuaTeX +incluse dans TeXLive~2016. Les changements intervenus dans la structure des +nœuds de type \textit{glue} rendent cette nouvelle version de LuaTeX +incompatible avec les précédentes. Le code lua contenu dans les versions 3.2b +et suivantes de \file{frenchb.lua} ne fonctionne pas avec les versions de +LuaTeX antérieures à 0.95, aussi à partir de la version~3.2b \ext{babel-french} +revient aux caractères actifs pour la gestion de la ponctuation haute avec les +moteurs LuaTeX antérieurs à 0.95 ! +La bonne solution consiste à installer rapidement TeXLive~2016 ou une autre +distribution contenant LuaTeX~0.95. +En revanche il n’y a aucun problème de compatibilité ascendante avec les +moteurs XeTeX et pdfTeX. + +\subsection{Changements entre les versions 3.1m et 3.0c} +\label{ssec:changes-3.1} + +{\sloppy + Ajout de la commande |\frquote{}| et de sa variante |\frquote*{}| + recommandées pour saisir les citations, notamment les citations imbriquées + ou celles s’étendant sur plusieurs paragraphes, voir p.~\pageref{frquote} + et les nouvelles options \fbo{EveryParGuill}, \fbo{EveryLineGuill} et + \fbo{InnerGuillSingle}. +\par} + +Nouvelle option \fbo{SmallCapsFigTabCaptions}, voir p.~\pageref{scfigtab}. + +\subsection{Changements entre les versions 3.0c et 2.6h} +\label{ssec:changes-3.0} + +Plusieurs modifications de fond ont motivé le passage à la version~3.0. + +\begin{itemize} + +\item \ext{babel-french} ne fonctionne désormais qu’avec la version~3.9 + de Babel ce qui donne accès à une syntaxe plus agréable pour modifier les + \textit{captions}, voir p.~\pageref{captionsfrench}. + Le séparateur utilisé dans les légendes de figures et de tableaux est + choisi de manière globale pour toutes les langues, voir + p.~\pageref{captionseparator}. + +\item La gestion des options par \fbsetup{} a été complètement remaniée ; deux + nouvelles options ont été ajoutées. + +\item La variante « canadien » du français fonctionne désormais comme un vrai + \textit{dialect} au sens de Babel ; parallèlement le français ne devrait + plus être désigné que sous le nom \opt{french}, à la fois en option de + |\usepackage[...]{babel}|% + \footnote{Le mieux est encore de mettre toutes les déclarations de langues + en option de \cs{documentclass}.} + et en argument de |\selectlanguage{}| et consorts. + Les variantes \opt{frenchb} et \opt{francais} sont encore tolérées mais + sans aucune garantie de pérennité. + +\item \ext{babel-french} ne charge plus le fichier \file{frenchb.cfg} ; la + personnalisation passe par l’utilisation exclusive de \fbsetup{}. + +\item Les étiquettes des listes \env{description} sont positionnées comme + celles des listes \env{itemize} et \env{enumerate} avec un retrait + paramétrable |\listindentFB| par rapport à la marge gauche. + +\item Enfin et c’est probablement le plus important, le recours aux + caractères actifs est supprimé pour la gestion de la ponctuation haute + lorsqu’un format basé sur LuaTeX% + \footnote{C’est déjà le cas pour XeTeX depuis la version~2.5 de + \ext{babel-french}.} + est utilisé (LuaLaTeX par exemple). + Le mécanisme des caractères actifs est remplacé par un appel aux + \textit{callbacks} |pre_linebreak_filter| et |hpack_filter|% + \footnote{Depuis la version 3.1g c’est le\textit{callbacks} \texttt{kerning} + qui est mis en œuvre à la place.}. + + La base du code |lua| se trouve dans l’exposé de Paul Isambert + à la journée GUT’2010. Un grand merci à Paul pour cette source d’inspiration + et pour ses suggestions lors de la relecture finale de \file{frenchb.lua}. + +\end{itemize} + +À partir de la version 3.0c, \ext{babel-french} laisse le contrôle total des +listes à la classe \cls{beamer} (option \fbo{StandardLists} automatiquement +activée) ; nouvelle option \fbo{INGuillSpace} (voir p.~\pageref{INGuillspace}). + +\subsection{Comment recompiler un document écrit pour + {babel-french}~2.x ?} +\label{ssec:compat-2.6} + +Penser d’abord à remplacer \opt{frenchb} et \opt{francais} par \opt{french} +dans les options de Babel et dans |\selectlanguage{...}|, +|\begin{otherlanguage}{...}|, |\foreignlanguage{...}|. +Une exception toutefois : les classes SMF (\cls{smfart} et \cls{smfbook}) ne +fonctionnent qu’avec l’option \opt{frenchb}… vieux reliquat d’un passé +lointain où l’option \opt{french} de babel était ambiguë (ambiguïté levée depuis +2004). + +Ajouter l’option \fbo{OldFigTabCaptions} à \fbsetup{} si on tient à avoir +deux séparateurs différents pour les légendes de figures et de tableaux, +|\CaptionSeparator| en français et deux-points pour les autres langues. + +Ajouter |\listindentFB=0pt| juste avant les environnements \env{description} +si on souhaite que les étiquettes de ces environnements collent à la marge +gauche au premier niveau. + +\section{Problèmes de césures} +\label{sec:cesures} + +Pour vérifier que votre format LaTeX fonctionne correctement au niveau des +césures, au moins en français et en anglais, téléchargez le fichier de test +\expandafter\expandafter\expandafter\url{\urlperso/frenchb/frenchb-cesures.tex} +et suivez les instructions figurant en début de fichier. + +Si les résultats du test ne sont pas corrects, vérifiez tout au début du +fichier \file{.log} dans la ligne commençant par le mot « Babel », si +« french » figure bien dans la liste des langues disponibles. + +Si ce n’est pas le cas, installez le paquet appelé « collection-langfrench » +(TeXLive, MacTeX) ou « texlive-lang-french » (distributions Linux) ou +similaire. Si vous travaillez avec « tlmgr », les formats sont refaits +automatiquement, sinon il faut les faire à la main (la procédure dépend de +votre installation). + +Recompilez le fichier \file{frenchb-cesures.tex}, les résultats devraient +être corrects, contactez-moi par courriel si ce n’était pas le cas. + +\section{Problèmes avec les quatre caractères actifs + (\string; \string: \string! \string?)} +\label{sec:active-char} + +Rappelons d’abord que ces quatre caractères \emph{ne sont pas rendus actifs} +avec les moteurs LuaTeX ou XeTeX, donc aucun problème n’est à craindre +avec ces moteurs% +\footnote{N’est-ce pas une bonne raison d’abandonner pdf(La)TeX ?}, +cette section ne concerne \emph{que les vieux moteurs} TeX’82 et pdfTeX. + +Normalement, le nécessaire est fait par Babel pour que les caractères rendus +actifs ne perturbent pas les autres extensions\dots{} mais il y a hélas des +exceptions (\ext{tikz}, \ext{xypic}, \ext{xcolor}, \ext{autonum}, \ext{arabtex}, +\ext{cleveref} par exemple). Il faut savoir que les caractères +rendus actifs par une langue \emph{le restent dans tout le document}, repasser +en anglais par exemple ne désactive pas les \string; \string: \string! +\string? s’ils ont été rendus actifs par \ext{babel-french} ! + +Les espaces insécables ajoutés entre les guillemets peuvent également être +gênants. + +Depuis la version~2.5, la commande à utiliser en cas de problème est +|\NoAutoSpacing|% +\footnote{Elle fonctionne avec tous les formats pdf(La)TeX, Lua(La)TeX + et Xe(La)TeX mais ne règle pas tous les problèmes de caractères actifs, + notamment dans les \texttt{\boi{}label} et autres \texttt{\boi{}caption}, + voir la section~\ref{sec:Incomp} à ce sujet. +.} +\emph{dans un groupe} comme ceci : + +|{\NoAutoSpacing|\\ + \textit{Partie ne supportant pas les caractères actifs}\\ +|}| + +ou à l’intérieur d’un environnement, par exemple + +|\begin{tikzpicture}\NoAutoSpacing|\\ +| ... |\\ +|\end{tikzpicture}| + +Avec \ext{tikz} v3.0, une solution alternative consiste à ajouter +|\usetikzlibrary{babel}| dans le préambule, voir la documentation de TikZ +(\file{pgfmanual.pdf}). L’avantage de cette solution est de tenter de préserver +les caractères actifs dans les nœuds même si ça ne fonctionne pas toujours, +notamment pour le point d’exclamation. + +Avec pdf(La)TeX, il est également possible de désactiver un seul ou plusieurs +caractères actifs de manière sélective grâce à la commande |\shorthandoff| de +Babel. Le mieux est de le faire \emph{localement} dans un environnement ou +dans un groupe comme ceci : + +|{\shorthandoff{:!}%|\\ + \textit{Partie ne supportant pas les caractères actifs `:’ et `!’}\\ +|}| + +\section{Incompatibilités connues et remèdes} +\label{sec:Incomp} + +La liste suivante ne prétend pas être exhaustive, n’hésitez pas à me signaler +les incompatibilités que vous rencontrez afin qu’elles puissent figurer dans +cette liste. + +\begin{itemize} + +\item Les caractères rendus actifs par \ext{babel-french}% + \footnote{Ceci ne concerne ni Xe(La)TeX ni Lua(La)TeX qui gèrent autrement + la ponctuation haute.} + (\string; \string: \string! \string?) peuvent perturber certaines + extensions, c’est le cas de \ext{tikz}, \ext{xypic}, \ext{xcolor}, + \ext{arabtex}, \ext{cleveref} par exemple, voir comment y remédier + section~\ref{sec:active-char}. + + En règle générale, il vaudrait mieux éviter les caractères actifs dans les + |\label| et |\caption|, remplacer systématiquement les « \string: » par des + tirets « - » dans les |\label| est une saine précaution. Pour éviter les + problèmes de caractères actifs avec \ext{natbib} ou \ext{listings}, il + convient de charger \ext{natbib} \emph{avant} \ext{babel} et \ext{listings} + \emph{après} \ext{babel}.\hlabel{ch-doc3} + Un message est affiché dans le fichier \file{.log} lorsque l’ordre de + chargement n’est pas correct. + + \ext{hyperref} ne fonctionne pas avec la commande |\cite| standard lorsque + celle-ci contient un caractère actif, charger l’extension \ext{cite} règle + le problème. + +\item En LaTeX, les caractères \string; \string: \string! \string? ne sont + rendus actifs + qu’au |\begin{document}|, ainsi les espaces attendues ne sont pas + ajoutées automatiquement lorsque ces caractères sont utilisés dans des + commandes définies dans le préambule ou dans des fichiers~\file{.sty}.\\ + Exemple : la commande |\title{Quelle crise?}| placée dans le + préambule imprimera « Quelle crise\string? » (sans espace)% + \footnote{Mais l’espace sera préservée si on compile en LuaLaTeX ou + en XeLaTeX puisque le mécanisme est différent.} + lors de l’appel de |\maketitle|. Il y a plusieurs parades : + \begin{itemize} + \item soit placer la commande |\title{Quelle crise?}| après le + |\begin{document}| (et avant |\maketitle|), + \item soit placer les commandes du type |\title| entre un + |\shorthandon{;:!?}| (avant) et un |\shorthandoff{;:!?}| + (après), si on tient à les laisser dans le préambule. + \end{itemize} + +\item Les extensions \ext{caption}, \ext{subcaption}, \ext{floatrow} + doivent impérativement être chargées \emph{après} \ext{babel}. + En revanche \ext{beameraticle} doit être chargée \emph{avant} \ext{babel}. + + À chaque fois que le bon ordre de chargement + n’est pas respecté, un avertissement le signale dans le fichier \file{.log}. + +\item \ext{babel-french} modifie la présentation des listes ce qui peut + perturber les classes ou extensions qui veulent également le faire. + \ext{babel-french} s’efface automatiquement lorsqu’une des extensions + \ext{enumitem}, \ext{enumerate} ou \ext{paralist} est chargée. Pour les + autres, ou si on veut soi-même agir sur la présentation des listes, il + convient de débrayer l’action de \ext{babel-french} en utilisant la commande + \fbsetup{} avec les options adéquates (cf. section~\ref{ssec:frenchbsetup}) + dans le préambule du document (après le chargement de Babel). + +{\sloppy +\item Certaines classes (\cls{amsbook}, \cls{smfbook}, + \cls{beamer}, etc.) redéfinissent |\part|, ce qui peut conduire à + des titres du genre « Première partie~I ». La parade consiste à ajouter + l’option \fbo{PartNameFull=false} dans \fbsetup{}. +\par} + +\item L’option \opt{multiple} de l’extension \ext{footmisc} insère normalement + une virgule entre les appels de notes multiples. Pour que ce mécanisme + fonctionne avec \ext{babel-french} il faut ajouter l’option + \fbsetup{AutoSpaceFootnotes=false}, sinon \ext{babel-french} remplace la + virgule par une espace fine. + +\item Dans une commande |\index{}|, les guillemets français doivent + obligatoirement être codés sous la forme |\og|, |\fg| : + \hlabel{ch-doc4} + |\index{\og toto\fg}| donne le résultat attendu, tandis que + |\index{«toto»}| provoque soit une erreur à la compilation (en LaTeX), + soit un mauvais classement de l’entrée |«toto»| dans l’index (en + XeLaTeX et LuaLaTeX). +\end{itemize} + +\section{Bibliographie} +\label{sec:biblio} + +Ce qui suit ne concerne \emph{pas} les bibliographies faites « à la main » +dans l’environnement \env{thebibliography}, mais celles créées à partir d’un +ou plusieurs fichiers~\file{.bib} avec \BibTeX{} ou mieux avec +\biblatex/\biber{}. + +\vspace{-.5\baselineskip} +\subsection{Bibliographie avec \texorpdfstring{\BibTeX}{BibTeX}} +\label{ssec:bibtex} + +\BibTeX{} est obsolète, je conseille \emph{vraiment} de passer +à \biblatex/\biber{} (voir section suivante). +Néanmoins, voici quelques indications concernant la francisation des +bibliographies créées avec \BibTeX{} : + +Certains champs (les dates notamment) et certains mots-clés figurant dans les +fichiers~\file{.bib} (les «\emph{and}» des listes d’auteurs par exemple) +devraient pouvoir être affichés différemment selon le contexte (les +«\emph{and}» du fichier~\file{.bib} devraient pouvoir être transcrits en +«\emph{et}» dans le fichier~\file{.bbl} pour les références en français). +Babel n’opère pas au niveau \BibTeX, il faut donc agir +directement au niveau des bases de données~\file{.bib} et des fichiers de +style~\file{.bst}. + +\begin{description} + +\item [Fichiers~\file{.bib}] : s’assurer que chaque référence des bases de + données \file{.bib} utilisées comporte un champ « \code{language = + \{...\}} » définissant la langue d’origine de la référence. + +\item [Fichiers~\file{.bst}] : pour remplacer les styles standard + \bibsty{alpha}, \bibsty{plain}, \bibsty{unsrt}, faire appel à l’extension + \bibsty{babelbib} et aux styles \bibsty{babalpha}, \bibsty{babplain}, + \bibsty{babunsrt} (voir la documentation \file{babelbib.pdf} et le fichier + d’exemples \file{babelbibtest.tex}). Selon les options, il est possible + d’afficher chaque référence dans sa langue ou bien de les afficher toutes + dans la langue principale du document% + \footnote{Les styles francisés \file{*-fr.bst} qu’on trouve sur CTAN dans + \url{tex-archive/biblio/bibtex/contrib/bib-fr} n’offrent que + la seconde possibilité (références toutes en français).}. + + Ceux qui font appel à un style de bibliographie sur mesure créé à partir de + \file{custom-bib} devront choisir l’option \opt{babel} lors de la + création du fichier \file{.bst} et ensuite adapter le fichier + \file{babelbst.tex} aux langues utilisées. + +\end{description} + +\subsection{Bibliographie avec \biblatex/\biber} +\label{ssec:biblatex} + +La solution \biblatex/\biber{} présente des nombreux avantages par rapport +à \BibTeX{} : +\begin{itemize} + +\item \biblatex{} prend en compte les options de Babel, les «\emph{and}» des + listes d’auteurs sont transcrits automatiquement en «\emph{et}» dans un + document en français ; + +\item \biblatex{}, associé à \biber{}, permet le traitement des fichiers + ~\file{.bib} codés en UTF-8 ce qui facilite grandement la coexistence + de références à des ouvrages en français, en russe et en grec par exemple ; + +\item \biblatex{} possède des options qui remplacent de nombreuses extensions + spécifiques telles que \ext{bibtopic}, \ext{bibunits}, \ext{chapterbib}, + \ext{cite}, \ext{multibib}, \ext{natbib}, etc. + +\end{itemize} + +Pour la mise en œuvre pratique de \biblatex/\biber{}, consulter le manuel +\textit{\LaTeX, l’essentiel} de \bsc{D.~Bitouzé} et \bsc{J.-C.~Charpentier} ou +la documentation en anglais \file{biblatex.pdf}. + +\section[Compatibilité avec e-french] + {Compatibilité avec \ext{e-french}} +\label{sec:CompatFP} + +Il est souhaitable qu’un texte saisi avec +\ext{e-french} de Bernard~\bsc{Gaulle} puisse être compilé avec un +minimum de modifications sur une machine utilisant \ext{babel-french} +et réciproquement. + +En ce qui concerne les guillemets français, \ext{e-french} rend actifs les +caractères |<| et |>| afin de saisir les guillemets sous la forme |<||<| et +|>||>| tandis que \ext{babel-french} s’y refuse et utilise en interne des +macros |\og| et |\fg|. + +Lorsqu’on travaille en codage~\texttt{T1} avec \ext{babel-french}, l’existence +des ligatures~|<||<| et~|>||>| permet de saisir +|<||<~|\code{guillemets français}|~>||>|, +mais les espaces insécables sont \emph{indispensables}. +Les commandes |\og| et |\fg| (ou leurs alias \fbo{«} et \fbo{»}, à condition +que ceux-ci aient été activés dans \fbsetup{}) sont préférables : elles +introduisent automatiquement des espaces insécables et plus fines pour un +meilleur rendu typographique. + +Les points de suspensions sont saisis |...| avec +\ext{e-french} et |\dots| avec \ext{babel-french}. + +Les commandes suivantes peuvent être ajoutées au préambule pour +émuler certaines commandes de \ext{e-french} : +\begin{verbatim} +\let\numero=\no +\let\Numero=\No +\let\fsc=\bsc +\let\lsc=\bsc +\newcommand*{\french}{\leavevmode\selectlanguage{french}} +\newcommand*{\english}{\leavevmode\selectlanguage{english}} +\newcommand*{\AllTeX}{% + (L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)% + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX} +\end{verbatim} + +Pour ceux qui éditent leurs sources LaTeX avec emacs, une fonction Lisp +\file{french2b} opère une adaptation \emph{partielle} d’un fichier conçu pour +\ext{e-french} facilitant sa compilation avec \ext{babel-french}. L’appel +à \ext{e-french} est remplacé en un appel à \ext{babel-french}, les guillemets +|<<| et |>>| sont convertis en |\og| et |\fg| et les |...| en |\dots|, enfin +quelques commandes spécifiques à \ext{e-french} sont ajoutées dans le +préambule. + +Cette fonction est disponible sur +\expandafter\expandafter\expandafter\url{\urlperso/frenchb/french2b.el}. +Il suffit de l’ajouter à un fichier \file{.emacs} et de l’exécuter par +|Esc x french2b| sur le fichier à convertir. + +\nopagebreak +\vspace{2\baselineskip} +\nopagebreak +\hspace*{\fill}% +\begin{minipage}[b]{.5\linewidth} + \raggedleft + \href{mailto:daniel.flipo@free.fr}{Daniel \textsc{Flipo}}\\ + \expandafter\expandafter\expandafter\url{\urlperso} +\end{minipage} + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-engine: luatex +%%% TeX-master: t +%%% coding: utf-8 +%%% TeX-source-correlate-mode: t +%%% mode: flyspell +%%% ispell-local-dictionary: "francais" +%%% End: diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.dtx b/macros/latex/contrib/babel-contrib/french/frenchb.dtx new file mode 100644 index 0000000000..d916f838ac --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/frenchb.dtx @@ -0,0 +1,5899 @@ +%\CheckSum{3769} +% +%\iffalse +% Tell the LaTeX system who we are and write an entry on the +% transcript. +%<*dtx> +\ProvidesFile{frenchb.dtx} +%</dtx> +%<acadian>\ProvidesLanguage{acadian} +%<canadien>\ProvidesLanguage{canadien} +%<francais>\ProvidesLanguage{francais} +%<french>\ProvidesLanguage{french} +%<frenchb>\ProvidesLanguage{frenchb} +%<lua>--[[ +%<lua> File `frenchb.lua’ generated from frenchb.dtx + [2019/03/30 v3.5e French support from the babel system] +%<*internal> +\iffalse +%</internal> +%<*lua> + Copyright © 2014-2019 Daniel Flipo + <daniel (dot) flipo (at) free (dot) fr> + License LPPL: see french.ldf. +--]] +%</lua> +%<*internal> +\fi +%</internal> +%<*dtx> +%% File `frenchb.dtx’ +%</dtx> +%<*dtx|french> +%% +%% Babel package for LaTeX version 2e +%% Copyright © 1996-2019 +%% by Daniel Flipo <daniel (dot) flipo (at) free (dot) fr> +%% +%</dtx|french> +%<*dtx> +%% This file is part of the babel system, it provides the source +%% code for the French language definition file. +%% +%</dtx> +%<*filedriver> +\documentclass[a4paper]{ltxdoc} +\usepackage[left=42mm,right=42mm,top=40mm,bottom=40mm]{geometry} +\usepackage[utf8]{inputenc} +\usepackage{bera,textcomp} +\renewcommand{\rmdefault}{fvs} +\usepackage{array} +\usepackage[dvipsnames]{xcolor} +\def\PrintMacroName#1{% + \strut\MacroFont\color{Sepia}\normalsize\string#1} +\usepackage[expansion=true,protrusion=true]{microtype} +\def\ColorArg{\color{PineGreen}} +\usepackage{url} +\usepackage[numbered]{hypdoc} +\hypersetup{colorlinks,urlcolor=blue,unicode} +\newcommand*{\hlabel}[1]{\phantomsection\label{#1}} +\newcommand*\babel{\textsf{babel}} +\newcommand*\frenchb{\textsf{babel-french}} +\newcommand*\file[1]{\texttt{#1}} +\newcommand*\cls[1]{\texttt{#1}} +\newcommand*\pkg[1]{\texttt{#1}} +\newcommand*\opt[1]{\texttt{#1}} +\newcommand*\env[1]{\texttt{#1}} +\newcommand*\exe[1]{\texttt{#1}} +\newcommand*\fbo[1]{\texttt{\ColorArg #1}} +\newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}} +\renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty) +\let\Module\meta % no math mode (see doc.sty) +\renewcommand*\descriptionlabel[1]{% + \hspace\labelsep \normalfont \fbo{#1}} +\let\up\textsuperscript +\newcommand*{\FRguillspace}{\penalty 10000 + \hskip.8\fontdimen2\font + plus.3\fontdimen3\font + minus.8\fontdimen4\font} +\hyphenation{Lua-TeX Lua-LaTeX Xe-LaTeX} +\lefthyphenmin=2 \righthyphenmin=3 +\RecordChanges +\AtEndDocument{% + \clearpage + \section{Change History}% + \GlossaryPrologue{}% + Changes are listed in reverse order (latest first) and limited to + \frenchb{}~v3. + \PrintChanges +} +\begin{document} +\setlength{\parindent}{0pt} +\GetFileInfo{frenchb.dtx} +\begin{center} + \textbf{\Large A Babel language definition file for French}\\[2mm]^^A\] + \textbf{\large frenchb.dtx \fileversion, \filedate}\\[3mm]^^A\] + Daniel Flipo\\ + \texttt{daniel.flipo@free.fr} +\end{center} +\vspace{2\baselineskip} +\thispagestyle{empty} +\tableofcontents +\clearpage +\DocInput{frenchb.dtx} +\end{document} +%</filedriver> +%\fi +% +% \section{The French language} +% +% The file \file{\filename}\footnote{The file described in this +% section has version number \fileversion\ and was last revised on +% \filedate.}, defines all the language definition macros for the +% French language. +% +% Customisation for the French language is achieved following the +% book ``Lexique des règles typographiques en usage à +% l’Imprimerie Nationale’’ troisième édition (1994), +% ISBN-2-11-081075-0. +% +% First version released: 1.1 (May 1996) as part of +% \babel-3.6beta. Version~2.0a was released in February 2007 and +% version~3.0a in February 2014. +% +% \frenchb{} has been improved using helpful suggestions from many +% people, mainly from Jacques André, Michel Bovani, Thierry Bouche, +% Vincent Jalby, Denis Bitouzé and Ulrike Fisher. +% Thanks to all of them! +% +% LaTeX-2.09 is no longer supported. +% This new version (3.x) has been designed to be used only with +% LaTeX2e and Plain formats based on TeX, pdfTeX, LuaTeX or XeTeX +% engines. +% +% Changes between version 3.0 and \fileversion{} are listed in +% subsection~\ref{ssec-changes} p.~\pageref{ssec-changes}. +% +% An extensive documentation in French (file \file{frenchb-doc.pdf}) is +% now included in \frenchb. +% +% \subsection{Basic interface} +% +% In a multilingual document, some typographic rules are language +% dependent, i.e.\ spaces before `high punctuation’ (|:| |;| |!| +% |?|) in French, others modify the general layout (i.e.\ layout of +% lists, footnotes, indentation of first paragraphs of sections) and +% should apply to the whole document. +% +% The French language can be loaded with \babel{} by a command like: +% \\ |\usepackage[german,spanish,french,british]{babel}|% +% \footnote{\emph{Always} use \opt{french} as option name for the +% French language, former aliases \opt{frenchb} or \opt{francais} +% are \emph{depreciated}; expect them to be removed sooner or later!} +% +% \frenchb{} takes account of \babel’s \emph{main language} defined +% as the \emph{last} option at \babel’s loading. When French is +% not \babel’s main language, \frenchb{} does not alter the general +% layout of the document (even in parts where French is the current +% language): the layout of lists, footnotes, indentation of first +% paragraphs of sections are not customised by \frenchb. +% +% When French is loaded as the last option of \babel, \frenchb{} +% makes the following changes to the global layout, \emph{both in +% French and in all other languages}\footnote{% +% For each item, hooks are provided to reset standard +% LaTeX settings or to emulate the behavior of former versions +% of \frenchb{} (see command \fbsetup{}, +% section~\ref{ssec-custom} p.~\pageref{ssec-custom}).}: +% \begin{enumerate} +% \item the first paragraph of each section is indented +% (LaTeX only); +% \item the default items in itemize environment are set to `---’ +% instead of `\textbullet’, and all vertical spacing and glue +% is deleted; it is possible to change `---’ to something else +% (`--’ for instance) using \fbsetup{} (see +% section~\ref{ssec-custom} p.~\pageref{ssec-custom}); +% \item vertical spacing in general LaTeX lists is +% shortened; +% \item footnotes are displayed ``à la française’’. +% \item the separator following the table or figure number in +% captions is printed as `~--~’ instead of `:~’; +% for changing this see~\ref{sssec-captions-fig} +% p.~\pageref{sssec-captions-fig}. +% \end{enumerate} +% +% Regarding local typography, the command |\selectlanguage{french}| +% switches to the French language\footnote{% +% \cs{selectlanguage\{francais\}} and +% \cs{selectlanguage\{frenchb\}} are no longer supported.}, +% with the following effects: +% \begin{enumerate} +% \item French hyphenation patterns are made active; +% \item `high punctuation’ characters (|:| |;| |!| |?|) +% automatically add correct spacing% +% \footnote{Well, the automatic insertion may add unwanted +% spaces in some cases, for correction see +% \fbo{AutoSpacePunctuation} option and \cs{NoAutoSpacing} +% command p.~\pageref{autospacepunctuation}.} +% in French; this is achieved using callbacks in Lua(La)TeX +% or `XeTeXinterchar’ mechanism in Xe(La)TeX; with TeX’82 and +% pdf(La)TeX these four characters are made active in the +% whole document; +% \item |\today| prints the date in French; +% \item the caption names are translated into French +% (LaTeX only). For customisation of caption names see +% section~\ref{sssec-captions-name} +% p.~\pageref{sssec-captions-name}. +% \item the space after |\dots| is removed in French. +% \end{enumerate} +% +% Some commands are provided by \frenchb{} to make typesetting +% easier: +% \begin{enumerate} +% \item French quotation marks can be entered using the commands +% |\og| and |\fg| which work in LaTeX2e and PlainTeX, +% their appearance depending on what is available to draw +% them; even if you use LaTeX2e \emph{and} |T1|-encoding, +% you should refrain from entering them as +% |<<~French quotation~>>|: |\og| and |\fg| provide +% better horizontal spacing (controlled by |\FBguillspace|). +% If French quote characters are available on your keyboard, +% you can use them, to get proper spacing in LaTeX2e see +% option \fbo{og=«, fg=»} p.~\pageref{option-og-fg}. +% +% |\og| and |\fg| can be used outside French, they typeset +% then English quotes `` and ’’. +% +% A new command |\frquote{}| has been added in version~3.1 to +% enter French quotations. |\frquote{|\textit{texte}|}| is +% equivalent to |\og| \textit{texte} |\fg{}| for short +% quotations.\hlabel{frquote} +% For quotations spreading over more than one paragraph, +% |\frquote| will add at the beginning of every paragraph of +% the quotation either an opening French guillemet («), or +% a closing one (») or nothing depending on option +% \fbo{EveryParGuill=open} or \fbo{=close} or \fbo{=none}, +% see p.~\pageref{everyparguill}. +% Command |\NoEveryParQuote| is provided to locally suppress +% unwanted guillemets (typically when lists are embedded in +% |\frquote{}|), it is meant to be used inside an environment +% or a group. +% +% |\frquote| is recommended to enter embedded quotations ``à la +% française’’, several variants are provided through options. +% \begin{itemize} +% \item with all engines: the inner quotation +% is surrounded by double quotes (``\textit{texte}’’) +% unless option \fbo{InnerGuillSingle=true}, then +% a) the inner quotation is printed as +% \guilsinglleft\FRguillspace\textit{texte}\FRguillspace +% \guilsinglright{} and b) if the inner quotation +% spreads over more than one paragraph, every paragraph +% included in the inner quotation starts with +% a \guilsinglleft{} or a \guilsinglright{} or nothing, +% depending on option \fbo{EveryParGuill=open} (default) +% or \fbo{=close} or \fbo{=none}. +% \item with LuaTeX based engines, it is possible to add a +% French opening or closing guillemet (« or ») at the +% beginning of every line of the inner quotation using +% option \fbo{EveryLineGuill=open} or \fbo{=close}; note +% that with any of these options, the inner quotation is +% surrounded by French guillemets (« and ») regardless +% option \fbo{InnerGuillSingle}; +% the default is \fbo{EveryLineGuill=none} so that +% |\frquote{}| behaves as with non-LuaTeX engines. +% \end{itemize} +% A starred variant |\frquote*| is meant for inner quotations +% which end together with the outer one: using |\frquote*| for +% the inner quotation will print only one closing quote +% character (the outer one) as recommended by the French +% `Imprimerie Nationale’. +% +% \item |\frenchdate|\marg{year}\marg{month}\marg{day} helps +% typesetting dates in French: |\frenchdate{2001}{01}{01}| +% will print 1\up{er} janvier 2001 in a box without any +% linebreak.\label{frenchdate} +% +% \item A command |\up| is provided to typeset superscripts like +% |M\up{me}| (abbreviation for ``Madame’’), |1\up{er}| (for +% ``premier’’). Other commands are also provided for +% ordinals: |\ier|, |\iere|, |\iers|, |\ieres|, |\ieme|, +% |\iemes| (|3\iemes| prints 3\up{es}). +% All these commands take advantage of real superscript +% letters when they are available in the current font. +% +% \item Family names should be typeset in small capitals and never +% be hyphenated, the macro |\bsc| (boxed small caps) does +% this, e.g., |L.~\bsc{Lamport}| will print the same as +% |L.~\mbox{\textsc{Lamport}}|. Note that composed names +% (such as Dupont-Durant) may now be hyphenated on explicit +% hyphens, this differs from \frenchb~v.~1.x. +% +% \item Commands |\primo|, |\secundo|, |\tertio| and |\quarto| +% print 1\up{o}, 2\up{o}, 3\up{o}, 4\up{o}. +% |\FrenchEnumerate{6}| prints 6\up{o}. +% \item Abbreviations for ``Numéro(s)’’ and ``numéro(s)’’ +% (N\up{o} N\up{os} n\up{o} and n\up{os}~) are obtained +% via the commands |\No|, |\Nos|, |\no|, |\nos|. +% +% \item Two commands are provided to typeset the symbol for +% ``degré’’: |\degre| prints the raw character and +% |\degres| should be used to typeset temperatures (e.g., +% ``|20~\degres C|’’ with a non-breaking space), or for +% alcohols’’ strengths (e.g., ``|45\degres|’’ with \emph{no} +% space in French). +% +% \item In math mode the comma has to be surrounded with +% braces to avoid a spurious space being inserted after it, +% in decimal numbers for instance (see the \TeX{}book p.~134). +% The command |\DecimalMathComma| makes the comma behave as an +% ordinary character \emph{when the current language is French} +% (no space added); +% as a counterpart, if |\DecimalMathComma| is active, an +% explicit space has to be added in lists and intervals: +% |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches +% back to the standard behaviour of the comma in French. +% +% The \pkg{icomma} package is an alternative workaround. +% +% \item A command |\nombre| was provided in 1.x versions to easily +% format numbers in slices of three digits separated either +% by a comma in English or with a space in French; |\nombre| +% is now mapped to |\numprint| from \file{numprint.sty}, see +% \file{numprint.pdf} for more information. +% +% \item \frenchb{} has been designed to take advantage of the +% \pkg{xspace} package if present: adding +% |\usepackage{xspace}| in the preamble will force macros +% like |\fg|, |\ier|, |\ieme|, |\dots|, \dots, to respect +% the spaces you type after them, for instance typing +% `|1\ier juin|’ will print `1\up{er} juin’ +% (no need for a forced space after |1\ier|). +% \end{enumerate} +% +% \subsection{Customisation} +% \label{ssec-custom} +% +% Customisation of \frenchb{} relies on command \fbsetup{} +% (formerly called |\frenchbsetup{}|, the latter name will be kept +% for ever to ensure backwards compatibility), options are entered +% using the \file{keyval} syntax. +% The command \fbsetup{} is to appear in the preamble only +% (after loading \babel). +% +% \subsubsection[\textbackslash frenchsetup{}] +% {\fbsetup{options}} +% \label{sssec-frenchbsetup} +% +% \vspace{.5\baselineskip} +% |\frenchsetup{}| and |\frenchbsetup{}| are synonymous; +% the latter should be preferred as the language name for +% French in \babel{} is no longer |frenchb| but |french|. +% +% \fbsetup{ShowOptions} prints all available options to +% the \file{.log} file, it is just meant as a remainder of the +% list of offered options. As usual with \file{keyval} syntax, +% boolean options (as \fbo{ShowOptions}) can be entered as +% \fbo{ShowOptions=true} or just \fbo{ShowOptions}, the +% \fbo{=true} part can be omitted. +% +% \vspace{.5\baselineskip} +% The other options are listed below. Their default value is +% shown between braces, sometimes followed be a `\texttt{*}’. +% The `\texttt{*}’ means that the default shown applies when +% \frenchb{} is loaded as the \emph{last} option of \babel{} +% ---\babel’s \emph{main language}---, and is toggled otherwise. +% \begin{description} +% \item [StandardLayout=true (false*)] forces \frenchb{} not to +% interfere with the layout: no action on any kind of lists, +% first paragraphs of sections are not indented (as in English), +% no action on footnotes; it useless unless French is the main +% language. This option can be used to avoid conflicts with +% classes or packages which customise lists or footnotes. +% \item [GlobalLayoutFrench=false (true*)] can only be used when +% French is the main language; setting it to \fbo{false} will +% emulate what prior versions of \frenchb{} (pre-2.2) did: +% lists, and first paragraphs of sections will be displayed +% the standard way in other languages than French, and ``à la +% française’’ in French (changing the layout inside a document +% is a bad practice imho). Note that the layout of footnotes is +% language independent anyway (see below \fbo{FrenchFootnotes} +% and \fbo{AutoSpaceFootnotes}). +% \item [IndentFirst=false (true*)]; set this option to \fbo{false} +% if you do not want \frenchb{} to force indentation of the +% first paragraph of sections. When French is the main language, +% this option applies to all languages. +% \item [PartNameFull=false (true)]; when true, \frenchb{} numbers +% the title of |\part{}| commands as ``Première partie’’, +% ``Deuxième partie’’ and so on. With some classes which +% change the |\part{}| command (AMS classes do so), you could +% get ``Première partie~1’’, ``Deuxième partie~2’’ in the toc; +% when this occurs, this option should be set to +% \fbo{false}, part titles will then be printed as ``Partie I’’, +% ``Partie II’’. +% +% \item [ListItemsAsPar=true (false)] setting this option to +% \fbo{true} is recommended: list items will be displayed as +% paragraphs with indented labels (in the ``Imprimerie Nationale’’ +% way) instead of having labels hanging into the left margin. +% How these two layouts differ is shown below:\\[.5\baselineskip] +% \fbox{\parbox[t]{.4\textwidth}{\raggedright +% \parindent=1.5em +% \def\FBlabel{\textemdash}% +% \settowidth{\labelwidth}{\FBlabel}% +% Text starting at `parindent’ \\ +% \noindent<= Leftmargin\par +% \textemdash{} first item running on two +% \hspace*{\parindent}\hspace*{\labelwidth} +% lines or more\dots{}\par +% \hspace*{\labelwidth} \textemdash{} first second level +% \hspace*{\parindent}\hspace*{\labelwidth}% +% \hspace*{\labelwidth} item on two lines\dots{}\par +% \hspace*{\labelwidth} \textemdash{} next one\dots{}\par +% \textemdash{} second item\dots +% }} +% \hfill \hlabel{ListAsPar}% +% \fbox{\parbox[t]{.4\textwidth}{\raggedright +% \parindent=1.5em +% \def\FBlabel{\textemdash}% +% \settowidth{\labelwidth}{\FBlabel}% +% Text starting at `parindent’ \\ +% \noindent<= Leftmargin\par +% \textemdash{} first item running on two +% lines or more\dots{}\par +% \hspace*{\labelwidth} \textemdash{} first second level +% \hspace*{\parindent} item on two lines\dots{}\par +% \hspace*{\labelwidth} \textemdash{} next one\dots{}\par +% \textemdash{} second item\dots +% }}\par +% Default French layout% +% \hspace{\fill}With \fbo{ListItemsAsPar=true}% +% \item [StandardListSpacing=true (false*)]% +% \footnote{This option should be used instead of former option +% \fbo{ReduceListSpacing} (kept for backward compatibility) which +% could be misleading: with some classes (smfart, smfbook f.i.) +% you had to set \fbo{ReduceListSpacing=false} to revert to the +% class settings which actually reduce list’s spacings even more +% than \frenchb! \fbo{StandardListSpacing=true} replaces +% \fbo{ReduceListSpacing=false}.}; \frenchb{} customises +% the vertical spaces in the \env{list} environment, this affects +% all lists, including \env{itemize} \env{enumerate}, +% \env{description}, but also \env{abstract}, \env{quote}, +% \env{quotation}, \env{verse}, etc. which are based on \env{list}. +% Setting this option to \fbo{true} reverts to the standard +% settings of the \env{list} environment as defined by the document +% class. +% \item [StandardItemizeEnv=true (false*)]; \frenchb{} redefines +% the \env{itemize} environment to suppress any vertical space +% between items of \env{itemize} lists in French and customises +% left margins. Setting this option to \fbo{true} reverts to +% the standard definition of \env{itemize}. +% \item [StandardEnumerateEnv=true (false*)]; starting with +% version~2.6 \frenchb{} redefines the \env{enumerate} and +% \env{description} environments to make left margins match those +% of the French version of \env{itemize} lists. Setting this +% option to \fbo{true} reverts to the standard definition of +% \env{enumerate} and \env{description}. +% \item [StandardItemLabels=true (false*)] when set to \fbo{true} +% this option prevents \frenchb{} from changing the labels in +% \env{itemize} lists in French. +% \item [ItemLabels=\cs{textbullet}, \cs{textendash}, +% \cs{ding\{43\}},...(\cs{textemdash}*)];\\ +% when \fbo{StandardItemLabels=false} (the default), this option +% enables to choose the label used in French \env{itemize} lists +% for all levels. The next four options do the same but each +% one for a specific level only. Note that the example +% |\ding{43}| requires |\usepackage{pifont}|. +% \item [ItemLabeli=\cs{textbullet}, \cs{textendash}, +% \cs{ding\{43\}},...(\cs{textemdash}*)] +% \item [ItemLabelii=\cs{textbullet}, \cs{textendash}, +% \cs{ding\{43\}},...(\cs{textemdash}*)] +% \item [ItemLabeliii=\cs{textbullet}, \cs{textendash}, +% \cs{ding\{43\}},..(\cs{textemdash}*)] +% \item [ItemLabeliv=\cs{textbullet}, \cs{textendash}, +% \cs{ding\{43\}},...(\cs{textemdash}*)] +% \item [StandardLists=true (false*)] forbids \frenchb{} to +% customise any kind of list. Try the option \fbo{StandardLists} +% in case of conflicts with classes or packages that customise +% lists too. This option is just a shorthand setting all four +% options \fbo{StandardListSpacing=true}, +% \fbo{StandardItemizeEnv=true}, \fbo{StandardEnumerateEnv=true} +% and \fbo{StandardItemLabels=true}. +% \item [ListOldLayout=true (false)]; starting with version~2.6a, +% the layout of lists has changed regarding leftmargins’ sizes +% and default itemize label (`---’ instead of `--’ up to~2.5k). +% This option, provided for backward compatibility, displays +% lists as they were up to version~2.5k. +% +% \item [FrenchFootnotes=false (true*)] reverts to the standard +% layout of footnotes. By default \frenchb{} typesets leading +% numbers as `1.\hspace{.5em}’ instead of `\up{1}’, but +% has no effect on footnotes numbered with symbols (as in the +% |\thanks| command). Two commands |\StandardFootnotes| +% and |\FrenchFootnotes| are available to change the layout of +% footnotes locally; |\StandardFootnotes| can help when some +% footnotes are numbered with letters (inside minipages for +% instance). +% \item [AutoSpaceFootnotes=false (true*)]; by default \frenchb{} +% adds a thin space in the running text before the number or +% symbol calling the footnote. Making this option \fbo{false} +% reverts to the standard setting (no space added). +% +% \item [AutoSpacePunctuation=false (true)]; in French, the user +% \hlabel{autospacepunctuation} +% \emph{should} input a space before the four characters `|:;!?|’ +% but as many people forget about it (even among native French +% writers!), the default behaviour of \frenchb{} is to +% automatically typeset non-breaking spaces the width of which is +% either |\FBthinspace| (defauts to a thin space) before `|;|’ +% `|!|’ `|?|’ or |\FBcolonspace| (defauts to |\space|) before +% `|:|’; the defaults follow the French `Imprimerie Nationale’s +% recommendations. This is convenient in most cases but can lead +% to addition of spurious spaces in URLs, in MS-DOS paths or in +% timetables (10:55) ---this no longer occurs with LuaTeX---, +% except if they are typed in |\texttt| or verbatim mode. +% When the current font is a monospaced (typewriter) font, +% no spurious space is added in that case% +% \footnote{Unless option \fbo{OriginalTypewriter} is set, +% \cs{ttfamily} is redefined in French to switch off space +% tuning, see below.}, +% so the default behaviour of of \frenchb{} in that area should +% be fine in most circumstances. +% +% Choosing \fbo{AutoSpacePunctuation=false} will ensure that +% a proper space is added before `|:;!?|’ \emph{if and only if} +% a (normal) space has been typed in. This option gives full +% control on space insertion before `|:;!?|’. Those who are +% unsure about their typing in this area should stick to the +% default option and use the provided |\NoAutoSpacing| command +% inside a group in case an unwanted space is added by \frenchb{} +% (i.e.\ |{\NoAutoSpacing http://mysite}|% +% \footnote{Actually, this is needed only with the XeTeX and +% pdfTeX engines. LuaTeX no longer inserts any space in strings +% like http://mysite, C:\textbackslash Foo, 10:55…} +% or |{\NoAutoSpacing ???}| (needed for pdfTeX only). +% \item [ThinColonSpace=true (false)] changes the inter-word +% non-breaking space added before the colon `:’ to a thin space, +% so that the same amount of space is added before any of the +% four `high punctuation’ characters. The default setting is +% supported by the French `Imprimerie Nationale’. +% \item [OriginalTypewriter=true (false)] prevents any +% customisation of |\ttfamily| and |\texttt{}| in French. +% This option should only be used to ensure backward compatibility. +% The current default behaviour is to switch off any addition of +% space before high punctuation with typewriter fonts +% (\textit{e.g.} verbatim). +% \item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp} +% (experimental) this option should be set to \fbo{true} +% \emph{only while converting LuaLaTeX files} to HTML. +% It ensures that non-breaking spaces added by \frenchb{} are +% inserted in the PDF file as U+A0 or U+202F (thin) instead of +% penalties and glues. +% Note that \exe{lwarp} (v.~0.37 and up) is fully compatible with +% \frenchb{} for translating PDFLaTeX or XeLaTeX files to HTML. +% +% \item [og=«, fg=»]; when guillemets characters are available on +% the keyboard (through a compose key for instance), it is nice +% to use them instead of typing |\og| and |\fg|. This option +% tells \frenchb{} which characters are opening and closing +% French guillemets (they depend on the input encoding), then +% you can type either \hlabel{option-og-fg} +% \texttt{« guillemets »} or \texttt{«guillemets»} (with or +% without spaces) to get properly typeset French quotes. +% This option works with LuaLaTeX and XeLaTeX; with pdfLaTeX it +% requires \file{inputenc} to be loaded with a proper encoding: +% 8-bits encoding (latin1, latin9, ansinew, applemac,\dots) or +% multi-byte encoding (utf8, utf8x). +% \item [INGuillSpace=true (false)] resets the dimensions of spaces +% after opening French quotes and before closing French quotes to +% the French `Imprimerie Nationale’ standards (inter-word space). +% \frenchb’s default setting produces slightly narrower spaces +% with less stretchability. +% \item [EveryParGuill=open, close, none (open)]; sets whether +% an opening quote (\texttt{«}) or a closing one (\texttt{»}) or +% nothing should be printed by |\frquote{}| at the beginning of +% every parapraph included in a level 1 (outer) quotation. +% This option is also considered for level 2 (inner) quotations +% to decide between \texttt{\guilsinglleft} and +% \texttt{\guilsinglright} when \fbo{InnerGuillSingle=true} +% (see below). \hlabel{everyparguill} +% \item [EveryLineGuill=open, close, none (none)]; with LuaTeX +% based engines \emph{only}, it is possible to set this option +% to \fbo{open} [resp. \fbo{close}]; this ensures that a `«’ +% [resp. `»’] followed by a proper space will be inserted at the +% beginning of every line of embedded (inner) quotations +% spreading over more than one line (provided that both outer +% and inner quotations are entered with |\frquote{}|). When +% \fbo{EveryLineGuill=open} or \fbo{=close} the inner quotation is +% always surrounded by « and », the next option is ineffective. +% \item [InnerGuillSingle=true (false)]; +% if \fbo{InnerGuillSingle=false} (default), inner quotations +% entered with |\frquote{}| start with~\texttt{``} and end +% with~\texttt{’’}. +% If \fbo{InnerGuillSingle=true}, \texttt{\guilsinglleft} and +% \texttt{\guilsinglright} are used instead of British double +% quotes; moreover if option \fbo{EveryParGuill=open} (or +% \fbo{close}) is set, a \texttt{\guilsinglleft} (or +% \texttt{\guilsinglright}) is added at the beginning of every +% parapraph included in the inner quotation. +% +% \item [ThinSpaceInFrenchNumbers=true (false)]; if \pkg{numprint} +% has been loaded with the \opt{autolanguage} option, while +% typesetting numbers with the |\numprint{}| command, +% |\npthousandsep| is defined as a non-breaking space (|~|)% +% \footnote{Actually without stretch nor shrink.} in French; +% when set to true, this option redefines |\npthousandsep| +% as a thin space (|\,|). +% +% \item [SmallCapsFigTabCaptions=false (true*)]; when set to +% \fbo{false}, |\figurename| and |\tablename| will be printed in +% French captions as ``Figure’’ and ``Table’’ instead of being +% printed in small caps (the default). +% \item [CustomiseFigTabCaptions=false (true*)]; when \fbo{false} +% the default separator (colon) is used instead of +% |\CaptionSeparator|. Anyway, \frenchb{} tries hard to insert +% a proper space before it and warns if it fails to do so. +% \item [OldFigTabCaptions=true (false)] is to be used when +% figures’ and tables’ captions must be typeset as with pre~3.0 +% versions of \frenchb{} (with |\CaptionSeparator| in French and +% colon otherwise). Intended for standard LaTeX classes only. +% +% \item [FrenchSuperscripts=false (true)]; then +% |\up=\textsuperscript|. % (option added in version 2.1). +% Should only be made \fbo{false} to recompile documents written +% before 2008 without changes: by default |\up| now relies on +% |\fup| designed to produce better looking superscripts. +% \item [LowercaseSuperscripts=false (true)]; by default \frenchb{} +% inhibits the uppercasing of superscripts (for instance when +% they are moved to page headers). Making this option +% \fbo{false} will disable this behaviour (not recommended). +% \item [SuppressWarning=true (false)]; can be turned to \fbo{true} +% if you are bored with \frenchb’s warnings; use this option as +% \emph{first} option of \fbsetup{} to cancel warnings launched +% by other options. +% \end{description} +% +% \textbf{Options’ order} -- Please remember that options are read +% in the order they appear in the \fbsetup{} command. +% Someone wishing that \frenchb{} leaves the layout of lists +% and footnotes untouched but caring for indentation of first +% paragraph of sections should choose\\ +% \fbsetup{StandardLayout,IndentFirst} to get the expected +% layout. The reverse order +% \fbsetup{IndentFirst,StandardLayout} would lead to option +% \fbo{IndentFirst} being overwritten by \fbo{StandardLayout}. +% +% \subsubsection{Caption names} +% \label{sssec-captions-name} +% +% All caption names can easily be customised in French using the +% simplified syntax introduced by \babel~3.9, for instance +% |\def\frenchproofname{Preuve}| or +% |\def\acadianproofname{Preuve}| for the \opt{acadian} dialect. +% The older syntax |\addto\captionsfrench{\def\proofname{Preuve}}| +% still works. Keep in mind that \emph{only} |french| can be used +% to redefine captions, even if \babel{}’s option was entered as +% |frenchb| or |francais|. +% +% \subsubsection{Figure and table captions} +% \label{sssec-captions-fig} +% +% In French, captions in figures and tables should never be printed +% as ‘Figure~1: ’ which is the default in standard LaTeX2e +% classes (a space should \emph{always} preceed a colon in French), +% anyway ‘Figure 1 -- ’ is preferred. +% +% When French is the main language, the default behaviour of +% \frenchb{} is to change the separator (colon) used in figures’ and +% tables’ captions \emph{for all languages} to |\CaptionSeparator| +% which defaults to ` -- ’ and can be redefined in the preamble with +% |\renewcommand*{\CaptionSeparator}{...}|. +% This works for the standard LaTeX2e classes, for the \cls{memoir} +% and koma-script classes. +% In case this procedure fails a warning is issued. +% +% When French is not the main language, the colon is preserved for +% all languages including French but \frenchb{} tries hard to insert +% a proper space before it and warns if it fails to do so. +% +% Three options are provided to customise figure and table captions: +% \begin{itemize} +% \item if \fbo{CustomiseFigTabCaptions} is set to \fbo{false} the +% colon will be used as separator in all languages, with a proper +% space before the colon in French (if possible); +% \item the second option, \fbo{OldFigTabCaptions}, can be set to +% \fbo{true} to print figures’ and tables’ captions as they were +% with versions pre~3.0 of \frenchb{} (using |\CaptionSeparator| +% in French and colon in other languages); this option only makes +% sense with the standard LaTeX classes \cls{article}, +% \cls{report} and \cls{book}; +% \item the last option, \fbo{SmallCapsFigTabCaptions}, can be set +% to \fbo{false} to typeset |\figurename| and |\tablename| in +% French as ``Figure’’ and ``Table’’ rather than in small caps +% (the default). +% \end{itemize} +% +% \subsection{Hyphenation checks} +% \label{ssec-hyphen} +% +% Once you have built your format, a good precaution would be to +% perform some basic tests about hyphenation in French. +% For LaTeX2e I suggest this: +% \begin{itemize} +% \item run |pdfLaTeX| on the following file:\\[3mm]^^A\] +% |%%% Test file for French hyphenation.|\\ +% |\documentclass[french]{article}|\\ +% |\usepackage[utf8]{inputenc} % utf8, what else?|\\ +% |\usepackage[T1]{fontenc} % mandatory for French|\\ +% |\usepackage{lmodern} % or erewhon, palatino…|\\ +% |\usepackage{babel}|\\ +% |\begin{document}|\\ +% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\ +% |\showhyphens{signal container événement algèbre}|\\ +% |\end{document}| +% \item check the hyphenations proposed by \TeX{} in your log-file; +% in French you should get with both 7-bit and 8-bit encodings\\ +% \texttt{si-gnal contai-ner évé-ne-ment al-gèbre}.\\ +% Do not care about how accented characters are displayed in the +% log-file, what matters is the position of the `|-|’ hyphen +% signs \emph{only}. +% \end{itemize} +% If they are all correct, your installation (probably) works fine, +% if one (or more) is (are) wrong, ask a local wizard to see what’s +% going wrong and perform the test again (or e-mail me about what +% happens).\\ +% Frequent mismatches: +% \begin{itemize} +% \item you get |sig-nal con-tainer|, this probably means that the +% hyphenation patterns you are using are for US-English, not for +% French; +% \item you get no hyphen at all in \texttt{évé-ne-ment}, this +% probably means that you are using CM fonts and the macro +% |\accent| to produce accented characters. +% Using 8-bits fonts with built-in accented characters avoids +% this kind of mismatch. +% \end{itemize} +% +% \subsection{Changes} +% \label{ssec-changes} +% +% \subsubsection*{What’s new in version 3.5?} +% +% Version 3.5a offers a new option \fbo{ListItemsAsPar}. The default +% layout of lists is unchanged (for backward compatibility), but +% users should try this new option which ensures a layout of lists +% closer to French typographic standards: see f.i.\ how lists are +% typeset in the book ``Lexique des règles typographiques en usage +% à l’Imprimerie Nationale’’. +% +% Version 3.5b fixes a bug due to wrong |\everypar|’s management in +% |\frquote{}|; it showed up when |\frquote{}| immediately followed +% a sectionning command. +% +% Starting with version 3.5d, a new option \fbo{StandardListSpacing} +% has been added to supersede \fbo{ReduceListSpacing}. +% +% A new command |\NoEveryParQuote| has been added in version 3.5e: +% it is meant to be used inside a group or environment to suppress +% unwanted guillemets (typically when lists are embedded in +% |\frquote{}|). +% +% \subsubsection*{What’s new in version 3.4?} +% +% Version 3.4a adds a new command |\frenchdate| (see +% p.~\pageref{frenchdate}) and slightly changes number formatting: +% |\FBthousandsep| is now a \textit{kern} instead of a rubber +% length. |\renewcommand*{\FBthousandsep}{~}| will switch back +% to the former (wrong) behaviour. +% +% Both options \opt{french} and \opt{acadian} can now be used +% simultaneously in a document; currently \opt{french} and +% \opt{acadian} are identical, it is up to the user to customise +% \opt{acadian} in terms of hyphenation patterns, captionnames, +% date format or high punctuation and quotes spacing if he/she +% needs a variant for French. +% +% A new command |\FBsetspaces| has been added for easy customising of +% spacing before high punctuation and inside quotes independently for +% \opt{french} and \opt{acadian}, see p.~\pageref{FBsetspaces}. +% +% Version 3.4 requires eTeX and LuaTeX 1.0.4 or newer. +% +% \subsubsection*{What’s new in version 3.3?} +% +% In version~3.3d the automatic insertion of non-breaking spaces +% before the colon character has been improved \emph{with engine +% LuaTeX only}: a spurious space is no longer inserted in strings +% like http://mysite, C:\textbackslash Program Files or 10:55. +% Unfortunately, my attempts to do the same with XeTeX or pdfTeX +% were unsuccessful. +% +% A few internal changes have been made in version~3.3c to improve +% the convertion into HTML of non-breaking spaces added by \frenchb. +% Usage of \exe{lwarp} (v.0.37 and up) is recommended for HTML +% output, it works fine on files compiled with XeLaTeX or pdfLaTeX +% formats. +% A new experimental option \fbo{UnicodeNoBreakSpaces} has been +% added for LuaLaTeX in version~3.3c, see p.~\pageref{ucs-nbsp}. +% +% According to current \babel’s standards, every dialect should +% have it’s own \file{.ldf} file; starting with version~3.3b, +% the main support for French is in \file{french.ldf}, portmanteau +% files \file{frenchb.ldf},\file{francais.ldf}, \file{acadian.ldf} +% and \file{canadien.ldf} have been added. Recommended options are +% \opt{french} or \opt{acadian}, all other are deprecated. +% BTW, options \opt{french} and \opt{acadian} are currently +% strictly identical. +% +% Release 3.3a is compatible with LuaTeX v.~0.95 (TL2016) and up. +% Former skips |\FBcolonskip|, |\FBthinskip| and |\FBguillskip| +% controlling punctuation spacings in LuaTeX have been removed; +% all three engines now rely on the same commands |\FBcolonspace|, +% |\FBthinspace| and |\FBguillspace|. +% +% An alias |\frenchsetup{}| for |\frenchbsetup{}| has been added +% in version 3.3a, it might appear more relevant in the future as +% the language name |frenchb| should vanish. +% +% Further customisation of the |\part{}| command is provided via +% three new commands |\frenchpartfirst|, |\frenchpartsecond| and +% |\frenchpartnameord|. +% +% \subsubsection*{What’s new in version 3.2?} +% +% Version 3.2g changes the default behaviour of |\frquote{}| +% with LuaTeX based engines, the output is now the same with +% all engines; to recover the former behaviour, add option +% \fbo{EveryLineGuill=open}. +% +% The handling of footnotes has been redesigned for the +% \cls{beamer}, \cls{memoir} and koma-script classes. +% The layout of footnotes ``à la française’’ should be unchanged +% but footnotes’ customisations offered by these classes +% (i.e.\ font or color changes) are now available even when option +% \fbo{FrenchFootnotes} is \fbo{true}. +% +% A long standing bug regarding the \pkg{xspace} package has been +% fixed: |\xspace| has been moved up from the internal command +% |\FB@fg| to |\fg|; |\frquote{}| now works properly when the +% \pkg{xspace} package is loaded. +% +% Version 3.2b is the first one designed to work with LuaTeX +% v.~0.95 as included in TeXLive 2016 (LuaTeX’s new glue node +% structure is not compatible with previous versions). +% +% \textbf{Warning to Lua(La)TeX users:} starting with version~3.2b +% the lua code included in \file{frenchb.lua} will \emph{not work} +% on older installations (TL2015 f.i.), so \frenchb{} reverts to +% active characters while handling high punctuation with LuaTeX +% engines older than 0.95! +% The best way to go is to upgrade to TL2016 or equivalent asap. +% Xe(La)TeX and pdf(La)TeX users can safely use \frenchb{} v.~3.2b +% and later on older installations too. +% \enlargethispage*{.5\baselineskip} +% +% Tne internals of commands |\NoAutoSpacing|, |\ttfamilyFB|, +% |\rmfamilyFB| and |\sffamilyFB| have been completely redesigned +% in version~3.2c, they behave now consistently with all engines. +% +% \subsubsection*{What’s new in version 3.1?} +% +% New command |\frquote{}| meant to enter French quotations, +% especially long ones (spreading over several paragraphs) and/or +% embedded ones. see p.~\pageref{frquote} for details. +% +% \subsubsection*{What’s new in version 3.0?} +% +% Many deep changes lead me to step \frenchb’s version number +% to~3.0a: +% \begin{itemize} +% \item \babel{}~3.9 is required now to process +% \file{frenchb.ldf}, this change allows for cleaner definitions +% of dates and captions for the Unicode engines LuaTeX and +% XeTeX and also provides a simpler syntax for end-users, see +% section~\ref{sssec-captions-name} +% p.\pageref{sssec-captions-name}. +% \item \fbsetup{} options management has been completely +% reworked; two new options added. +% \item Canadian French didn’t work as a normal \babel’s dialect, +% it should now; btw. the French language should now be loaded +% as \opt{french}, \emph{not as} \opt{frenchb} or +% \opt{francais} and preferably as a \emph{global} option of +% |\documentclass|. Some tolerance still exists in v3.0, but +% do not rely on it. +% \item \frenchb{} no longer loads \file{frenchb.cfg}: +% customisation should definitely be done using \fbsetup{} +% options. +% \item Description lists labels are now indented; try setting +% |\descindentFB=0pt| (or |\listindentFB=0pt| for all lists) +% in the preamble if you don’t like it. +% \item The last but not least change affects the (recent) +% LuaTeX-based engines, (this means version 0.76 as included in +% TL2013 and up): active characters are no longer used in French +% for `high punctuation’% +% \footnote{The current \frenchb{} version requires LuaTeX +% v.~1.0.4 as included in TL2017, see above.}. +% Functionalities and user interface are unchanged. +% +% Many thanks to Paul Isambert who provided the basis for the +% lua code (see his presentation at GUT’2010) and kindly +% reviewed my first drafts suggesting significant improvements. +% +% Please note that this code, still experimental, is likely to +% change until LuaTeX itself has reached version~1.0. +% \end{itemize} +% +% Starting with version~3.0c, \frenchb{} no longer customises +% lists with the \cls{beamer} class and offers a new option +% (\fbo{INGuillSpace}) to follow French `Imprimerie Nationale’ +% recommendations regarding quotes’ spacing. +% +% \StopEventually{} +% +% \changes{v2.6c}{2013/05/20}{Dummy file frenchb.cfg is no longer +% generated from frenchb.dtx.} +% +% \clearpage +% \newgeometry{left=53mm,right=25mm} +% +% \section{The code} +% +% \subsection{Initial setup} +% +% \changes{v2.1d}{2008/05/02}{Argument of \cs{ProvidesLanguage} changed +% above from `french’ to `frenchb’ (otherwise \cs{listfiles} prints +% no date/version information). The real name of current language +% (french) as to be corrected before calling \cs{LdfInit}.} +% +% \changes{v3.0a}{2014/02/28}{Support for options frenchb, francais, +% canadien, acadian changed.} +% +% \changes{v3.0a}{2014/02/19}{\cs{LdfInit} checks \cs{captionsfrench} +% instead of \cs{datefrench} to avoid a conflict with papertex.cls +% which loads datetime.sty.} +% +% \changes{v3.4a}{2018/01/14}{\cs{LdfInit} checks \cs{FBclean@on@exit} +% instead of \cs{captionsfrench} (undefined in PLain). +% Prevents loading french.ldf again with acadian option.} +% +% The macro |\LdfInit| takes care of preventing that this file is +% loaded more than once (even if both options \opt{french} and +% \opt{acadian} are used in the same document), checking the +% category code of the \texttt{@} sign, etc. +% +% \begin{macrocode} +%<*french> +\LdfInit\CurrentOption{FBclean@on@exit} +% \end{macrocode} +% +% \changes{v3.0a}{2014/02/15}{In Plain, provide a substitute for +% \cs{PackageWarning} and \cs{PackageInfo}.} +% +% Let’s provide a substitute for |\PackageError|, |\PackageWarning| +% and |\PackageInfo| not defined in Plain: +% \begin{macrocode} +\def\fb@error#1#2{% + \begingroup + \newlinechar=`\^^J + \def\\{^^J(french.ldf) }% + \errhelp{#2}\errmessage{\\#1^^J}% + \endgroup} +\def\fb@warning#1{% + \begingroup + \newlinechar=`\^^J + \def\\{^^J(french.ldf) }% + \message{\\#1^^J}% + \endgroup} +\def\fb@info#1{% + \begingroup + \newlinechar=`\^^J + \def\\{^^J}% + \wlog{#1}% + \endgroup} +% \end{macrocode} +% +% \changes{v3.4a}{2018/01/04}{babel-french now requires eTeX.} +% +% Quit if eTeX is not available. +% \begin{macrocode} +\let\bbl@tempa\relax +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname eTeXversion\endcsname\relax + \let\bbl@tempa\endinput + \fb@error{babel-french requires eTeX.\\ + Aborting here} + {Orignal PlainTeX is not supported,\\ + please use LuaTeX or XeTeX engines.} +\fi +\bbl@tempa +% \end{macrocode} +% +% \changes{v3.0c}{2014/03/30}{babel-french requires babel-3.9i.} +% +% Quit if \babel’s version is less than 3.9i. +% \begin{macrocode} +\let\bbl@tempa\relax +\ifdefined\babeltags +\else + \let\bbl@tempa\endinput + \ifdefined\PackageError + \PackageError{french.ldf} + {babel-french requires babel v.3.16.\MessageBreak + Aborting here} + {Please upgrade Babel!} + \else + \fb@error{babel-french requires babel v.3.16.\\ + Aborting here} + {Please upgrade Babel!} + \fi +\fi +\bbl@tempa +% \end{macrocode} +% +% \changes{v3.0c}{2014/03/30}{No need to define \cs{l@french} as +% \cs{lang@french}, babel.def (3.9j) takes care for this.} +% +% Make sure that |\l@french| is defined (fallbacks are +% |\l@nohyphenation| if available or~0). +% \file{babel.def} (3.9i and up) defines |\l@<languagename>| also for +% eTeX, LuaTeX and XeTeX formats which set |\lang@<languagename>|. +% \begin{macrocode} +\def\FB@nopatterns{% + \ifdefined\l@nohyphenation + \adddialect\l@french\l@nohyphenation + \edef\bbl@nulllanguage{\string\language=nohyphenation}% + \else + \edef\bbl@nulllanguage{\string\language=0}% + \adddialect\l@french0 + \fi + \@nopatterns{French}} +\ifdefined\l@french \else \FB@nopatterns \fi +% \end{macrocode} +% +% Babel’s French language can be loaded with option \opt{acadian} +% which stands for Canadian French. +% If no specific hyphenation patterns are available, Canadian French +% will use the French ones. +% \begin{macrocode} +\ifdefined\l@acadian \else \adddialect\l@acadian\l@french \fi +% \end{macrocode} +% +% French uses the standard values of |\lefthyphenmin| (2) +% and |\righthyphenmin| (3); let’s provide their values though, +% as required by \babel. +% +% \begin{macrocode} +\providehyphenmins{french}{\tw@\thr@@} +\providehyphenmins{acadian}{\tw@\thr@@} +% \end{macrocode} +% +%\changes{v2.1d}{2008/05/04}{Avoid warning `\cs{end} occurred +% when \cs{ifx} ... incomplete’ with LaTeX-2.09.} +% +% \begin{macro}{\ifLaTeXe} +% No support is provided for late LaTeX-2.09: issue a warning +% and exit if LaTeX-2.09 is in use. Plain is still supported. +% \begin{macrocode} +\newif\ifLaTeXe +\let\bbl@tempa\relax +\ifdefined\magnification +\else + \ifdefined\@compatibilitytrue + \LaTeXetrue + \else + \PackageError{french.ldf} + {LaTeX-2.09 format is no longer supported.\MessageBreak + Aborting here} + {Please upgrade to LaTeX2e!} + \let\bbl@tempa\endinput + \fi +\fi +\bbl@tempa +% \end{macrocode} +% \end{macro} +% +%\begin{macro}{\ifFBunicode} +% \begin{macro}{\ifFBLuaTeX} +% \begin{macro}{\ifFBXeTeX} +% French hyphenation patterns are now coded in Unicode, see file +% \file{hyph-fr.tex}. XeTeX and LuaTeX engines require some extra +% code to deal with the French ``apostrophe’’. +% Let’s define three new `if’: |\ifFBLuaTeX|, |\ifFBXeTeX| and +% |\ifFBunicode| which will be true for XeTeX and LuaTeX engines +% and false for 8-bits engines. +% +% \changes{v2.4a}{2009/11/23}{Added a new `if’ \cs{FBunicode} and +% some \cs{lccode} definitions to \cs{extrasfrench} and +% \cs{noextrasfrench}.} +% +% \changes{v2.5d}{2011/01/17}{Added two new `if’ \cs{FBXeTeX} and +% \cs{FBLuaTeX} as XeTeX and behave differently regarding the status +% of the French `apostrophe’.} +% +% \changes{v2.6g}{2013/12/15}{lccode values for the French +% `apostrophe’ are now the same for XeTeX and LuaTeX.} +% +% \changes{v3.4c}{2018/02/16}{Reverting to former test, beware of +% \cs{XeTeXrevision} left as \cs{relax} by careless testing.} +% +% \begin{macrocode} +\newif\ifFBunicode +\newif\ifFBLuaTeX +\newif\ifFBXeTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname luatexversion\endcsname\relax +\else + \FBunicodetrue \FBLuaTeXtrue +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname XeTeXrevision\endcsname\relax +\else + \FBunicodetrue \FBXeTeXtrue +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v3.3b}{2017/07/08}{New `if’ \cs{ifFBfrench} to replace +% \cs{iflanguage} test which is based on patterns.} +% +% \begin{macro}{\ifFBfrench} +% True when the current language is French or any of its dialects; +% will be set to true by |\extrasfrench| and to false by +% |\noextrasfrench|. Used in |\DecimalMathComma| and +% |frenchsetup{og=«, fg=»}|. +% \begin{macrocode} +\newif\ifFBfrench +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\extrasfrench} +% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s +% \cs{babel@savevariable} to handle apostrophe’s \cs{lccode}.} +% +% \changes{v3.4a}{2018/01/06}{Change \cs{(no)extras}\cs{CurrentOption} +% to \cs{(no)extrasfrench}. \cs{(no)extrasacadian} will be defined +% as \cs{(no)extrasfrench} in file acadian.ldf.} +% +% \begin{macro}{\noextrasfrench} +% The macro |\extrasfrench| will perform all the extra +% definitions needed for the French language. +% The macro |\noextrasfrench| is used to cancel the actions of +% |\extrasfrench|. +% +% In French, character ``apostrophe’’ (U+27 or U+2019) is a letter in +% expressions like |l’ambulance| (French hyphenation patterns provide +% entries for this kind of words). This means that the |\lccode| of +% ``apostrophe’’ has to be non null in French for proper hyphenation +% of those expressions, and has to be reset to null when exiting +% French. +% +% The following code ensures correct hyphenation of words like +% |d’aventure|, |l’utopie|, with all TeX engines (XeTeX, LuaTeX, +% pdfTeX) using \file{hyph-fr.tex} patterns. +% +% \changes{v3.5c}{2018/09/11}{\cs{lccode} of quote 0x27 changed from +% 0x2019 to 0x27 for Unicode engines.} +% +% \begin{macrocode} +\def\extrasfrench{% + \FBfrenchtrue + \babel@savevariable{\lccode"27}% + \lccode"27="27 + \ifFBunicode + \babel@savevariable{\lccode"2019}% + \lccode"2019="2019 + \fi +} +\def\noextrasfrench{\FBfrenchfalse} +% \end{macrocode} +% +% One more thing |\extrasfrench| needs to do is to make sure that +% ``Frenchspacing’’ is in effect. |\noextrasfrench| will switch +% ``Frenchspacing’’ off again if necessary. +% \begin{macrocode} +\addto\extrasfrench{\bbl@frenchspacing} +\addto\noextrasfrench{\bbl@nonfrenchspacing} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Punctuation} +% \label{ssec-punct} +% +% \changes{v2.5a}{2010/08/10}{Punctation is no longer made active +% with XeTeX-based engines.} +% +% As long as no better solution is available, the `high +% punctuation’ characters (|;| |!| |?| and |:|) have to be made +% |\active| for an automatic control of the amount of space to be +% inserted before them. Both XeTeX and LuaTeX provide an +% alternative to active characters (`XeTeXinterchar’ mechanism and +% LuaTeX’s callbacks). +% +% \changes{v3.0a}{2014/01/10}{New flag \cs{ifFB@luatex@punct} for +% `high punctuation’ management with LuaTeX engines.} +% +% \begin{macro}{\ifFB@active@punct} +% Three internal flags are needed for the three different techniques +% used for `high punctuation’ management. +% \begin{macrocode} +\newif\ifFB@active@punct \FB@active@puncttrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifFB@luatex@punct} +% With LuaTeX, starting with version 1.0.4, callbacks are used to +% get rid of active punctuation. With previous versions, `high +% punctuation’ characters remain active (see below). +% \begin{macrocode} +\newif\ifFB@luatex@punct +\ifFBLuaTeX + \ifnum\luatexversion<100 + \ifx\PackageWarning\@undefined + \fb@warning{Please upgrade LuaTeX to version 1.0.4 or above!\\% + babel-french will make high punctuation characters (;:!?)\\% + active with LuaTeX < 1.0.4.}% + \else + \PackageWarning{french.ldf}{Please upgrade LuaTeX + to version 1.0.4 or above!\MessageBreak + babel-french will make high punctuation characters% + \MessageBreak (;:!?) active with LuaTeX < 1.0.4;% + \MessageBreak reported}% + \fi + \else + \FB@luatex@puncttrue\FB@active@punctfalse + \fi +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifFB@xetex@punct} +% For XeTeX, the availability of |\XeTeXinterchartokenstate| +% decides whether the `high punctuation’ characters (|;| |!| |?| +% and |:|) have to be made |\active| or not. +% +% \changes{v3.2b}{2016/04/18}{New counter \cs{FB@nonchar} needed for +% non characters: it’s value will be 4095 for new engines and 255 +% for older ones.} +% +% The number of available character classes has been increased from +% 256 to 4096 in XeTeX v.~0.99994, the class for non-characters is +% now 4095 instead of 255. +% \begin{macrocode} +\newcount\FB@nonchar +\newif\ifFB@xetex@punct +\ifdefined\XeTeXinterchartokenstate + \FB@xetex@puncttrue\FB@active@punctfalse + \ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt + \FB@nonchar=255 \relax + \else + \FB@nonchar=4095 \relax + \fi +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\FBguillspace} +% \begin{macro}{\FBcolonspace} +% \begin{macro}{\FBthinspace} +% \changes{v2.5a}{2010/08/10}{Define \cs{FBthinspace} for those who want +% to customise the width of the space before ; and co.} +% +% \changes{v2.6d}{2013/06/19}{Rename \cs{Fthinspace} to +% \cs{FBthinspace} and \cs{Fcolonspace} to \cs{FBcolonspace} to avoid +% a conflict with fournier.sty.} +% +% \changes{v3.1f}{2015/05/31}{\cs{FBthinspace} is no longer a kern but +% a skip (babel-french adds a nobreak penalty before it).} +% +% \changes{v3.2c}{2016/05/14}{Change .16667em to +% .5\cs{fontdimen2}\cs{font} to get in XeTeX and pdfTeX +% the same spacing as in LuaTeX.} +% +% \changes{v3.3a}{2016/04/30}{Skips \cs{FBcolonskip} and +% \cs{FBthinskip} replaced by toks \cs{FBcolonsp} and +% \cs{FBthinsp}.} +% +% These three commands are meant for basic French. Other French +% dialects can use different settings, see below. +% According to the I.N.\ specifications, the `:’ requires an +% inter-word space before it, the other three require just a thin +% space. We define |\FBcolonspace| as |\space| (inter-word space) +% and |\FBthinspace| as an half inter-word space with no shrink nor +% stretch. +% |\FBguillspace| is defined btw. as spacing for French quotes is +% handled together with high punctuation for LuaTeX and XeTeX. +% |\FBguillspace| has been fine tuned by Thierry Bouche to 80\% of an +% inter-word space with reduced stretchability. +% All three are user customisable in the preamble, best using the +% |\FBsetspaces| command described below. +% A penalty will be added before these spaces to prevent line +% breaking. +% \begin{macrocode} +\newcommand*{\FBguillspace}{\hskip .8\fontdimen2\font + plus .3\fontdimen3\font + minus .8\fontdimen4\font \relax} +\newcommand*{\FBcolonspace}{\space} +\newcommand*{\FBthinspace}{\hskip .5\fontdimen2\font \relax} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v3.3a}{2016/04/30}{Skip \cs{FBguillskip} for LuaTeX +% replaced by toks \cs{FBguillsp}.} +% +% \changes{v3.4a}{2018/01/15}{Toks \cs{FBcolonsp}, \cs{FBthinsp} and +% \cs{FBguillsp} removed.} +% +% \changes{v3.4a}{2018/01/26}{New command \cs{FBsetspaces} to fine tune +% spacing independently in French and in French dialects.} +% +% \begin{macro}{\FBsetspaces} +% This command makes it easy to fine tune |\FBguillspace|, +% |\FBcolonspace| and |\FBthinspace| in French (defaut) or +% independently in a French dialect using the optional argument. +% They are meant for LaTeX2e \emph{only} and can only be used +% in the preamble. +% Four mandatory arguments are expected besides the optional one: +% the first one is a \textit{string} either "guill", "colon", or +% "thin", the last four are decimal numbers specifying +% \textit{width}, \textit{stretch} and \textit{shrink} relative to +% \textit{fontdimens}.\hlabel{FBsetspaces} +% For instance |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| defines +% |\acadianFBcolonspace| as a thinspace which will be used for +% the Acadian dialect only. When used without optional argument or +% with argument `french’, the same command would tune the basic +% |\FBcolonspace| command. +% \begin{macrocode} +\ifLaTeXe + \newcommand*{\FBsetspaces}[5][french]{% + \def\bbl@tempa{french}\def\bbl@tempb{#1}% + \ifx\bbl@tempa\bbl@tempb \def\bbl@tempb{}\fi + \@namedef{\bbl@tempb FB#2space}{\hskip #3\fontdimen2\font + plus #4\fontdimen3\font + minus #5\fontdimen4\font \relax}% +% \end{macrocode} +% With option "acadian", fill the corresponding LuaTeX table. +% All unset values in the "acadian" subtables will be filled +% `AtBeginDocument’ by |\set@glue@table| with the value available +% for "french". +% \begin{macrocode} + \ifFB@luatex@punct + \ifx\bbl@tempb\FB@acadian + \directlua{ + FBsp.#2.gl.ac[1] = #3 + FBsp.#2.gl.ac[2] = #4 + FBsp.#2.gl.ac[3] = #5 + if #3 > 0.6 then + FBsp.#2.ch.ac = 0xA0 + elseif #3 > 0.2 then + FBsp.#2.ch.ac = 0x202F + else + FBsp.#2.ch.ac = 0x200B + end + }% + \fi + \fi + } + \@onlypreamble\FBsetspaces +\fi +% \end{macrocode} +% \end{macro} +% +% Remember that the \emph{same} |\extrasfrench| command is executed +% when switching to French or to a French dialect (Acadian). +% Acadian and French may share the same patterns (or not), and may +% use different spacing for high punctuation and/or quotes. +% Basically, for pdfLaTeX and XeLaTeX, the spacing is set for French, +% then potentially tuned differently for Acadian. +% LuaTeX relies on an attribute |\FB@dialect| to decide what spacing +% is needed for French or Acadian (see LuaTeX table |FBsp|). +% \hlabel{extrapunct} +% As a rough test on |\languagename| would be unreliable to set the +% value of |\FB@dialect| (see \file{babel.pdf}), we use a trick +% based on |\detokenize|; another option would be to use the +% |\IfLanguageName| command from Oberdiek’s package \file{iflang}. +% \begin{macrocode} +\ifLaTeXe + \addto\extrasfrench{% + \ifFB@luatex@punct + \edef\bbl@tempa{\detokenize\expandafter{\languagename}}% + \edef\bbl@tempb{\detokenize{french}}% + \ifx\bbl@tempa\bbl@tempb \FB@dialect=0 \relax + \else \FB@dialect=1 \relax + \fi +% \end{macrocode} +% The first time whe enter French, we have to set the LuaTeX +% tables for French (|\FB@dialet=0|) \emph{before} any dialect +% redefines any |\FB...space| command. Doing this `AtBeginDocument’ +% would be too late: if French or a French dialect is the main +% language, |\extrasfrench| has been executed before! +% \begin{macrocode} + \ifdefined\FB@once\else + \set@glue@table{colon}% + \set@glue@table{thin}% + \set@glue@table{guill}% + \def\FB@once{}% + \fi + \fi +% \end{macrocode} +% Any dialect dependent customisation done using +% |\FBsetspaces[|\textit{dialect}|]| command or alike is now +% taken into account: the value of |\FBthinspace| (meant for French, +% i.e.|\FB@dialect=0|) is first saved then changed (for Acadian). +% \begin{macrocode} + \ifcsname\languagename FBthinspace\endcsname + \babel@save\FBthinspace + \renewcommand*{\FBthinspace}{% + \csname\languagename FBthinspace\endcsname}% + \fi +% \end{macrocode} +% Same for |\FBcolonspace|: +% \begin{macrocode} + \ifcsname\languagename FBcolonspace\endcsname + \babel@save\FBcolonspace + \renewcommand*{\FBcolonspace}{% + \csname\languagename FBcolonspace\endcsname}% + \fi +% \end{macrocode} +% And for |\FBguillspace|: +% \begin{macrocode} + \ifcsname\languagename FBguillspace\endcsname + \babel@save\FBguillspace + \renewcommand*{\FBguillspace}{% + \csname\languagename FBguillspace\endcsname}% + \fi + } +\fi +% \end{macrocode} +% +% \changes{v3.2c}{2016/05/14}{Newif \cs{ifFB@spacing} and new commands +% \cs{FB@spacingon}, \cs{FB@spacingoff} to control space tuning in +% French.} +% +% The conditional |\ifFB@spacing| will be used by pdfTeX and XeTeX +% engines to switch on or off space tuning before high punctuation +% and inside French quotes. +% A matching attribute will be defined later for LuaTeX. +% \begin{macrocode} +\newif\ifFB@spacing \FB@spacingtrue +% \end{macrocode} +% +% \begin{macro}{\FB@spacing@off} +% \begin{macro}{\FB@spacing@on} +% Two internal commands to switch on and off all space tuning +% for all six characters `;:!?«»’. +% They will be triggered by user command |\NoAutoSpacing| and by +% font family switching commands |\ttfamilyFB| |\rmfamilyFB| and +% |\sffamilyFB|. These four commands will now behave the same with +% any engine (up to version 3.2b, results were engine dependent). +% \begin{macrocode} +\newcommand*{\FB@spacing@on}{% + \ifFB@luatex@punct + \FB@spacing=1 \relax + \else + \FB@spacingtrue + \fi} +\newcommand*{\FB@spacing@off}{% + \ifFB@luatex@punct + \FB@spacing=0 \relax + \else + \FB@spacingfalse + \fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Punctuation with LuaTeX} +% \label{sssec-punct-luatex} +% +% \changes{v3.0a}{2014/01/10}{New handling of `high punctuation’ +% through callbacks with LuaTeX engines.} +% +% The following part holds specific code for punctuation with modern +% LuaTeX engines, i.e. version 1.0.4 (included in TL2017) or newer. +% +% \changes{v3.0b}{2014/02/13}{Require luatexbase with LaTeX2e in case +% fontspec has not been loaded before babel.} +% +% \changes{v3.0c}{2014/03/26}{Just load luatexbase.sty instead of +% luaotfload.sty with plain formats.} +% +% \changes{v3.1a}{2014/05/30}{Misplaced \cs{fi} for plain formats.} +% +% \changes{v3.1j}{2015/10/16}{Loading luatexbase.sty is no longer +% needed with LaTeX release 2015/10/01 or later.} +% +% \changes{v3.2b}{2016/04/18}{Load ltluatex.tex for plain LuaTeX to +% ensure \cs{newattribute} is defined.} +% +% \changes{v3.2c}{2016/05/14}{New LuaTeX attribute \cs{FB@spacing}.} +% +% \changes{v3.3a}{2017/04/30}{Compatibility code for pre +% 2015/10/01 LaTeX release removed, see ltnews23.tex.} +% +% \changes{v3.4a}{2018/01/15}{New attribute \cs{FB@dialect} for the +% French dialect acadian.} +% +% \begin{macrocode} +\ifFB@luatex@punct + \ifdefined\newluafunction\else +% \end{macrocode} +% This code is for Plain: load \file{ltluatex.tex} if it hasn’t been +% loaded before \babel. +% \begin{macrocode} + \input ltluatex.tex + \fi +% \end{macrocode} +% We define five LuaTeX attributes to control spacing in French +% and/or Acadian for `high punctuation’ and quotes, making sure +% that |\newattribute| is defined. +% +% |\FB@spacing=0| switches off any space tuning both before high +% punctuation characters and inside French quotes (i.e.\ function +% |french_punctuation| doesn’t alter the node list at all). +% +% |\FB@addDPspace=0| switches off automatic insertion of spaces +% before high punctuation characters (but typed spaces are still +% turned into non-breaking thin- or word-spaces). +% +% |\FB@addGUILspace| will be set to~1 by option \fbo{og=«, fg=»}, +% thus enabling automatic insertion of proper spaces after `«’ and +% before `»’. +% +% |\FB@ucsNBSP| triggers the replacement of glues by characters, it +% is controlled by option \fbo{UnicodeNoBreakSpaces}. +% +% |\FB@dialect| is 0 for French and 1 for Acadian; its value controls +% which parts of the glue table (|.fr| or |.ac|) are taken into +% account. +% \begin{macrocode} + \newattribute\FB@spacing \FB@spacing=1 \relax + \newattribute\FB@addDPspace \FB@addDPspace=1 \relax + \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax + \newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax + \newattribute\FB@dialect \FB@dialect=0 \relax + \ifLaTeXe + \PackageInfo{french.ldf}{No need for active punctuation + characters\MessageBreak with this version + of LuaTeX!\MessageBreak reported} + \else + \fb@info{No need for active punctuation characters\\ + with this version of LuaTeX!} + \fi +% \end{macrocode} +% The next command will be used in the first call of |\extrasfrench| +% to convert |\FBcolonspace|, |\FBthinspace| and |\FBguillspace| +% into a table usable by LuaTeX. This way, any customisation done +% in the preamble (by \fbsetup{}, redefinitions or |\FBsetspaces| +% commands) are taken into account. Values not explicitly set for +% Acadian by |\FBsetspaces[|\textit{acadian}|]| commands are copied +% from the French ones. +% In case parsing by the Lua function |FBget_glue| (defined in file +% \file{frenchb.lua}) fails due to unexpected syntax in |\FB...space| +% the table remains unchanged and a warning is issued. +% The matching space characters for option \fbo{UnicodeNoBreakSpaces} +% are set as word space, thin space or null space according to the +% \textit{width} parameter. +% +% \changes{v3.4a}{2018/01/30}{Lua function token.get\_meaning requires +% LuaTeX 1.0.} +% +% \begin{macrocode} + \newcommand*{\set@glue@table}[1]{% + \directlua { + local s = token.get_meaning("FB#1space") + local t = FBget_glue(s) + if t then + FBsp.#1.gl.fr = t + if not FBsp.#1.gl.ac[1] then + FBsp.#1.gl.ac = t + end + if FBsp.#1.gl.fr[1] > 0.6 then + FBsp.#1.ch.fr = 0xA0 + elseif FBsp.#1.gl.fr[1] > 0.2 then + FBsp.#1.ch.fr = 0x202F + else + FBsp.#1.ch.fr = 0x200B + end + if not FBsp.#1.ch.ac then + FBsp.#1.ch.ac = FBsp.#1.ch.fr + end + else + texio.write_nl('term and log', '') + texio.write_nl('term and log', + '*** french.ldf warning: Unexpected syntax in FB#1space,') + texio.write_nl('term and log', + '*** french.ldf warning: LuaTeX table FBsp unchanged.') + texio.write_nl('term and log', + '*** french.ldf warning: Consider using FBsetspaces to ') + texio.write('term and log', 'customise FB#1space.') + texio.write_nl('term and log', '') + end + }% + } +\fi +%</french> +% \end{macrocode} +% +% \begin{macro}{frenchb.lua} +% This is \file{frenchb.lua}. It holds Lua code to deal with `high +% punctuation’ and quotes. This code is based on suggestions from +% Paul Isambert. +% +% First we define two flags to control spacing before French `high +% punctuation’ (thin space or inter-word space). +% +% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French +% quotes in T1-encoding.} +% +% \changes{v3.3c}{2017/09/07}{Function `get\_glue’ robustified. +% `french\_punctuation’ can insert Unicode characters instead +% of glues.} +% +% \begin{macrocode} +%<*lua> +local FB_punct_thin = + {[string.byte("!")] = true, + [string.byte("?")] = true, + [string.byte(";")] = true} +local FB_punct_thick = + {[string.byte(":")] = true} +% \end{macrocode} +% Managing spacing after `«’ (U+00AB) and before `»’ (U+00BB) can be +% done by the way; we define two flags, |FB_punct_left| for +% characters requiring some space before them and |FB_punct_right| +% for `\guillemotleft’ which must be followed by some space. +% In case LuaTeX is used to output T1-encoded fonts instead of +% OpenType fonts, codes \texttt{0x13} and \texttt{0x14} have to be +% added for `«’ and `»’. +% \begin{macrocode} +local FB_punct_left = + {[string.byte("!")] = true, + [string.byte("?")] = true, + [string.byte(";")] = true, + [string.byte(":")] = true, + [0x14] = true, + [0xBB] = true} +local FB_punct_right = + {[0x13] = true, + [0xAB] = true} +% \end{macrocode} +% Two more flags will be needed to avoid spurious spaces in +% strings like !! ?? or (?) +% \begin{macrocode} +local FB_punct_null = + {[string.byte("!")] = true, + [string.byte("?")] = true, + [string.byte("[")] = true, + [string.byte("(")] = true, +% \end{macrocode} +% or if the user has typed a non-breaking space U+00A0 or U+202F +% (thin) before a `high punctuation’ character: no space +% should be added by \frenchb. Same is true inside French quotes. +% \begin{macrocode} + [0xA0] = true, + [0x202F] = true} +local FB_guil_null = + {[0xA0] = true, + [0x202F] = true} +% \end{macrocode} +% \changes{v3.1g}{2015/06/17}{Node HLIST added; node TEMP added +% for the first node of \cs{hbox}es.} +% +% Local definitions for nodes: +% \begin{macrocode} +local new_node = node.new +local copy_node = node.copy +local node_id = node.id +local HLIST = node_id("hlist") +local TEMP = node_id("temp") +local KERN = node_id("kern") +local GLUE = node_id("glue") +local GLYPH = node_id("glyph") +local PENALTY = node_id("penalty") +local nobreak = new_node(PENALTY) +nobreak.penalty = 10000 +local insert_node_before = node.insert_before +local insert_node_after = node.insert_after +local remove_node = node.remove +% \end{macrocode} +% +%\changes{v3.4a}{2018/01/26}{Global `FBsp’ table added; local function +% `get\_glue’ changed into global `FBget\_glue’.} +% +% Commands |\FBthinspace|, |\FBcolonspace| and |\FBguillspace| are +% converted `AtBeginDocument’ by the next function |FBget_glue| into +% tables of three values which are fractions of |\fontdimen2|, +% |\fontdimen3| and |\fontdimen4|. \hlabel{lua-scaling} +% If parsing fails due to unexpected syntax, the function returns +% \textit{nil} instead of a table. +% \begin{macrocode} +function FBget_glue(toks) + local t = nil + local f = string.match(toks, + "[^%w]hskip%s*([%d%.]*)%s*[^%w]fontdimen 2") + if f == "" then f = 1 end + if tonumber(f) then + t = {tonumber(f), 0, 0} + f = string.match(toks, "plus%s*([%d%.]*)%s*[^%w]fontdimen 3") + if f == "" then f = 1 end + if tonumber(f) then + t[2] = tonumber(f) + f = string.match(toks, "minus%s*([%d%.]*)%s*[^%w]fontdimen 4") + if f == "" then f = 1 end + if tonumber(f) then + t[3] = tonumber(f) + end + end + elseif string.match(toks, "[^%w]F?B?thinspace") then + t = {0.5, 0, 0} + elseif string.match(toks, "[^%w]space") then + t = {1, 1, 1} + end + return t +end +% \end{macrocode} +% Let’s initialize the global LuaTeX table |FBsp|: it holds the +% characteristics of the glues used in French and Acadian for +% high punctuation and quotes and the corresponding no-breaking +% space characters for option \fbo{UnicodeNoBreakSpaces}. +% \begin{macrocode} +FBsp = {} +FBsp.thin = {} +FBsp.thin.gl = {} +FBsp.thin.gl.fr = {.5, 0, 0} ; FBsp.thin.gl.ac = {} +FBsp.thin.ch = {} +FBsp.thin.ch.fr = 0x202F ; FBsp.thin.ch.ac = nil +FBsp.colon = {} +FBsp.colon.gl = {} +FBsp.colon.gl.fr = { 1, 1, 1} ; FBsp.colon.gl.ac = {} +FBsp.colon.ch = {} +FBsp.colon.ch.fr = 0xA0 ; FBsp.colon.ch.ac = nil +FBsp.guill = {} +FBsp.guill.gl = {} +FBsp.guill.gl.fr = {.8, .3, .8} ; FBsp.guill.gl.ac = {} +FBsp.guill.ch = {} +FBsp.guill.ch.fr = 0xA0 ; FBsp.guill.ch.ac = nil +% \end{macrocode} +% The next function converts the glue table returned by function +% |FBget_glue| into sp for the current font; beware of null values +% for fid, see |\nullfont| in TikZ, and of special fonts like +% lcircle1.pfb for which |font.getfont(fid)| does not return a proper +% font table, in such cases the function returns |nil|. +% +% \changes{v3.1l}{2016/02/13}{font.getfont(fid) possibly +% returns nil even for a positive fid (i.e. AMS lcircle1.pfb). +% Reported by François Legendre.} +% +% \changes{v3.1m}{2016/02/16}{new\_glue\_scaled returns +% nil in case of invalid font table (i.e. lcircle1.pfb). In such +% cases babel-french leaves the node list unchanged.} +% +% \changes{v3.2b}{2016/04/18}{glue\_spec removed; +% starting with LuaTeX 0.95, glue specifications fit in glue.} +% +% \begin{macrocode} +local font_table = {} +local function new_glue_scaled (fid,table) + if fid > 0 and table[1] then + local fp = font_table[fid] + if not fp then + local ft = font.getfont(fid) + if ft then + font_table[fid] = ft.parameters + fp = font_table[fid] + end + end + local gl = new_node(GLUE,0) + if fp then + node.setglue(gl, table[1]*fp.space, + table[2]*fp.space_stretch, + table[3]*fp.space_shrink) + return gl + else + return nil + end + else + return nil + end +end +% \end{macrocode} +% Let’s catch LuaTeX attributes |\FB@spacing|, |\FB@addDPspace| +% and |\FB@addGUILspace|. +% \begin{macrocode} +local FBspacing = luatexbase.attributes['FB@spacing'] +local addDPspace = luatexbase.attributes['FB@addDPspace'] +local addGUILspace = luatexbase.attributes['FB@addGUILspace'] +local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP'] +local FBdialect = luatexbase.attributes['FB@dialect'] +local has_attribute = node.has_attribute +% \end{macrocode} +% The following function will be added to |kerning| callback. +% It catches all nodes of type |GLYPH| in the list starting at +% |head| and checks the language attributes of the current glyph: +% nothing is done if the current language is not French and only +% specific punctuation characters (those for which |FB_punct_left| +% or |FB_punct_right| is true) need a special treatment. +% In French, local variables are defined to hold the properties of +% the current glyph (|item|) and of the previous one (|prev|) or the +% next one (|next|). Constants |FR_fr| (french) and |FR_ca| +% (acadian) are defined by command |\activate@luatexpunct|. +% +% \changes{v3.1b}{2014/09/16}{Add a check for null fid +% in french\_punctuation (Tikz \cs{nullfont}). +% Bug pointed out by Paul Gaborit.} +% +% \begin{macrocode} +local function french_punctuation (head) + for item in node.traverse_id(GLYPH, head) do + local lang = item.lang + local char = item.char + local fid = item.font + local FRspacing = has_attribute(item, FBspacing) + FRspacing = FRspacing and FRspacing > 0 + local FRucsNBSP = has_attribute(item, FBucsNBSP) + FRucsNBSP = FRucsNBSP and FRucsNBSP > 0 + local FRdialect = has_attribute(item, FBdialect) + FRdialect = FRdialect and FRdialect > 0 + local SIG = has_attribute(item, addGUILspace) + SIG = SIG and SIG >0 + if lang ~= FR_fr and lang ~= FR_ca then + FRspacing = nil + end + local nbspace = new_node("glyph") + if FRspacing and FB_punct_left[char] and fid > 0 then + local prev = item.prev + local prev_id, prev_subtype, prev_char + if prev then + prev_id = prev.id + prev_subtype = prev.subtype + if prev_id == GLYPH then + prev_char = prev.char + end + end +% \end{macrocode} +% +% \changes{v3.0c}{2014/04/18}{Null glues should not trigger space +% insertion before high ponctuation. Bug pointed out by Benoit +% Rivet for the `lstlisting’ environment of the listings package.} +% +% \changes{v3.1c}{2014/10/25}{Previous bug fix for null glues +% (v3.0c) did not work properly. Fixed now (I hope!). +% Pointed out by Jacques André.} +% +% If the previous node is a glue, check its natural width, only +% positive glues (actually glues > 1 sp, for tabular `l’ +% columns) are to be replaced by a non-breaking space. +% \begin{macrocode} + local is_glue = prev_id == GLUE + local glue_wd + if is_glue then + glue_wd = prev.width + end + local realglue = is_glue and glue_wd > 1 +% \end{macrocode} +% +% \changes{v3.3d}{2017/10/17}{In default mode, for `:’ only, check +% if next node is a glyph or not. If it is, turn the `auto’ flag +% to false (avoids spurious spaces in URLs, MSDOS paths or 10:35).} +% +% For characters for which |FB_punct_thin| or |FB_punct_thick| is +% \emph{true}, the amount of spacing to be typeset before them +% is controlled by commands |\FBthinspace| and |\FBcolonspace| +% respectively. +% Two options: if a space has been typed in before (turned into +% \emph{glue} in the node list), we remove the \emph{glue} and add a +% nobreak penalty and the required \emph{glue}. +% Otherwise (|auto| option), the penalty and the required +% \emph{glue} are inserted if attribute |\FB@addDPspace| is set, +% unless any of these four conditions is met: +% a) node is `:’ and the next one is of type GLYPH (avoids spurious +% spaces in http://mysite, C:\textbackslash{} or 10:35); +% b) the previous character is part of type |FB_punct_null| +% (avoids spurious spaces in strings like |(!)| or |??|); +% c) a null glue (actually glues <= 1 sp for tabulars) preceeds +% the punctuation character (for tabulars and listings); +% d) the punctuation character starts a paragraph or an |\hbox{}|. +% +% When option \fbo{UnicodeNoBreakSpaces} is set to \fbo{true}, +% a Unicode character U+00A0 or U+202F is inserted instead of +% penalty and glue. +% \begin{macrocode} + if FB_punct_thin[char] or FB_punct_thick[char] then + local SBDP = has_attribute(item, addDPspace) + local auto = SBDP and SBDP > 0 + if FB_punct_thick[char] and auto then + local next = item.next + local next_id + if next then + next_id = next.id + end + if next_id and next_id == GLYPH then + auto = false + end + end + if auto then + if (prev_char and FB_punct_null[prev_char]) or + (is_glue and glue_wd <= 1) or + (prev_id == HLIST and prev_subtype == 3) or + (prev_id == TEMP) then + auto = false + end + end + local fbglue + local t + if FB_punct_thick[char] then + if FRdialect then + t = FBsp.colon.gl.ac + nbspace.char = FBsp.colon.ch.ac + else + t = FBsp.colon.gl.fr + nbspace.char = FBsp.colon.ch.fr + end + else + if FRdialect then + t = FBsp.thin.gl.ac + nbspace.char = FBsp.thin.ch.ac + else + t = FBsp.thin.gl.fr + nbspace.char = FBsp.thin.ch.fr + end + end + fbglue = new_glue_scaled(fid, t) +% \end{macrocode} +% In case |new_glue_scaled| fails (returns |nil|) the node list +% remains unchanged. +% \begin{macrocode} + if (realglue or auto) and fbglue then + if realglue then + head = remove_node(head,prev,true) + end + if (FRucsNBSP) then + nbspace.font = fid + insert_node_before(head, item, copy_node(nbspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end + end +% \end{macrocode} +% Let’s consider `»’ now (the only remaining glyph of +% |FB_punct_left| class): we just have to remove any \emph{glue} +% possibly preceeding `»’, then to insert the nobreak penalty and +% the proper \emph{glue} (controlled by |\FBguillspace|). +% This is done only if French quotes have been `activated’ by +% options \fbo{og=«, fg=»} in \fbsetup{} and can be denied locally +% with |\NoAutoSpacing| (this is controlled by the |SIG| flag). +% If either a) the preceding glyph is member of |FB_guil_null|, or +% b) `»’ is the first glyph of an |\hbox{}| or a paragraph, nothing +% is done, this is controlled by the |addgl| flag. +% +% \changes{v3.1a}{2014/06/18}{Added flag addgl which must also be true +% when prev or next is not a char (i.e. \cs{kern}0 in +% «\cs{texttt}\{a\}»).} +% +% \changes{v3.1g}{2015/06/26}{flag addgl set to false for `»’ +% at the beginning of an \cs{hbox} or a paragraph or a tabular +% `l’ and `c’ columns.} +% +% \begin{macrocode} + elseif SIG then + local addgl = (prev_char and not FB_guil_null[prev_char]) or + (not prev_char and + prev_id ~= TEMP and + not (prev_id == HLIST and prev_subtype == 3) + ) +% \end{macrocode} +% Correction for tabular `c’ (glue 0 plus 1 fil) and `l’ (glue 1sp) +% columns: +% \begin{macrocode} + if is_glue and glue_wd <= 1 then + addgl = false + end + local t = FBsp.guill.gl.fr + nbspace.char = FBsp.guill.ch.fr + if FRdialect then + t = FBsp.guill.gl.ac + nbspace.char = FBsp.guill.ch.ac + end + local fbglue = new_glue_scaled(fid, t) + if addgl and fbglue then + if is_glue then + head = remove_node(head,prev,true) + end + if (FRucsNBSP) then + nbspace.font = fid + insert_node_before(head, item, copy_node(nbspace)) + else + insert_node_before(head, item, copy_node(nobreak)) + insert_node_before(head, item, copy_node(fbglue)) + end + end + end + end +% \end{macrocode} +% Similarly, for `«’ (unique member of the |FB_punct_right| class): +% unless either a) the next glyph is member of |FB_guil_null|, or +% b) `«’ is the last glyph of an |\hbox{}| or a paragraph (then the +% |addgl| flag is false, nothing is done), we remove any \emph{glue} +% possibly following it and insert first the proper \emph{glue} then +% a nobreak penalty so that finally the penalty preceeds the +% \emph{glue}. +% +% \changes{v3.1a}{2014/06/18}{Look ahead when next is a kern +% (i.e. in « \cs{texttt}\{a\} »).} +% +% \changes{v3.1g}{2015/06/26}{Flag addgl set to false for +% `«’ at the end of an \cs{hbox} or a paragraph or when followed by +% a null glue (i.e. springs).} +% +% \begin{macrocode} + if FRspacing and FB_punct_right[char] + and fid > 0 and SIG then + local next = item.next + local next_id, next_subtype, next_char, nextnext, kern_wd + if next then + next_id = next.id + next_subtype = next.subtype + if next_id == GLYPH then + next_char = next.char +% \end{macrocode} +% A |kern0| might hide a |glue|, so look ahead if |next| is a kern +% (this occurs with |« \texttt{a} »|): +% \begin{macrocode} + elseif next_id == KERN then + kern_wd = next.kern + if kern_wd == 0 then + nextnext = next.next + if nextnext then + next = nextnext + next_id = nextnext.id + next_subtype = nextnext.subtype + if next_id == GLYPH then + next_char = nextnext.char + end + end + end + end + end + local is_glue = next_id == GLUE + if is_glue then + glue_wd = next.width + end + local addgl = (next_char and not FB_guil_null[next_char]) or + (next and not next_char) +% \end{macrocode} +% Correction for tabular `c’ columns. For `r’ columns, a final +% `«’ character needs to be coded as |\mbox{«}| for proper spacing +% (|\NoAutoSpacing| is another option). +% \begin{macrocode} + if is_glue and glue_wd == 0 then + addgl = false + end + local fid = item.font + local t = FBsp.guill.gl.fr + nbspace.char = FBsp.guill.ch.fr + if FRdialect then + t = FBsp.guill.gl.ac + nbspace.char = FBsp.guill.ch.ac + end + local fbglue = new_glue_scaled(fid, t) + if addgl and fbglue then + if is_glue then + head = remove_node(head,next,true) + end + if (FRucsNBSP) then + nbspace.font = fid + insert_node_after(head, item, copy_node(nbspace)) + else + insert_node_after(head, item, copy_node(fbglue)) + insert_node_after(head, item, copy_node(nobreak)) + end + end + end + end + return head +end +return french_punctuation +%</lua> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\FB@luatex@punct@french} +% As a language tag is part of glyph nodes in LuaTeX, no more +% switching has to be done in |\extrasfrench|, setting the dialect +% attribute has already be done (see above, p.~\pageref{extrapunct}). +% We will just redefine |\shorthandoff| and |\shorthandon| in French +% to issue a warning reminding the user that active characters are no +% longer used in French with recent LuaTeX engines. +% +% \changes{v3.1l}{2016/02/07}{Use \cs{babel@save} to save and restore +% \cs{shorthandon} and \cs{shorthandoff}.} +% +% \begin{macrocode} +%<*french> +\ifFB@luatex@punct + \newcommand*{\FB@luatex@punct@french}{% + \babel@save\shorthandon + \babel@save\shorthandoff + \def\shorthandoff##1{% + \ifx\PackageWarning\@undefined + \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with + LuaTeX,\\ use \noexpand\NoAutoSpacing + *inside a group* instead.}% + \else + \PackageWarning{french.ldf}{\protect\shorthandoff{;:!?} is + helpless with LuaTeX,\MessageBreak use \protect\NoAutoSpacing + \space *inside a group* instead;\MessageBreak reported}% + \fi}% + \def\shorthandon##1{}% + } + \addto\extrasfrench{\FB@luatex@punct@french} +% \end{macrocode} +% \end{macro} +% +% \changes{v3.0b}{2014/02/13}{frenchb.lua was not found by +% Lua function dofile (not kpathsea aware). +% Call function kpse.find\_file first, as suggested by Paul Gaborit.} +% +% \changes{v3.1g}{2015/06/17}{Lua function french\_punctuation is now +% inserted at the end of the `kerning’ callback (no priority) +% instead of `hpack\_filter’ and `pre\_linebreak\_filter’.} +% +% The next definition will be used to activate Lua punctuation: it +% loads \file{frenchb.lua} and adds function |french_punctuation| +% at the end of the |kerning| callback (no priority). +% \begin{macrocode} + \def\activate@luatexpunct{% + \directlua{% + FR_fr = \the\l@french ; FR_ca = \the\l@acadian ; + local path = kpse.find_file("frenchb.lua", "lua") + if path then + local f = dofile(path) + luatexbase.add_to_callback("kerning", + f, "frenchb.french_punctuation") + else + texio.write_nl('') + texio.write_nl('*****************************') + texio.write_nl('Error: frenchb.lua not found.') + texio.write_nl('*****************************') + texio.write_nl('') + end + }% + } +\fi +% \end{macrocode} +% End of specific code for punctuation with LuaTeX engines. +% +% \subsubsection{Punctuation with XeTeX} +% \label{sssec-punct-xetex} +% +% If |\XeTeXinterchartokenstate| is available, we use the +% ``inter char’’ mechanism to provide correct spacing in French +% before the four characters |;| |!| |?| and |:|. The basis of the +% following code was borrowed from the \pkg{polyglossia} package, +% see \file{gloss-french.ldf}. We use the same mechanism for French +% quotes (\texttt{«} and \texttt{»}), when automatic spacing for +% quotes is required by options \fbo{og=«} and \fbo{fg=»} in +% \fbsetup{} (see section~\ref{ssec-keyval}). +% +% The default value for |\XeTeXcharclass| is 0 for characters tokens +% and |\FB@nonchar| for all other tokens (glues, kerns, math and box +% boundaries, etc.). +% These defaults should not be changed otherwise the spacing before +% the `high punctuation’ characters and inside quotes might not be +% correct. +% +% We switch |\XeTeXinterchartokenstate| to 1 and change the +% |\XeTeXcharclass| values of |;| |!| |?| |:| |(| |]| +% \texttt{«} and \texttt{»} when +% entering French. Special care is taken to restore them to their +% inital values when leaving French. +% +% \changes{v2.5d}{2011/01/19}{Moved the \cs{newcount} command outside +% \cs{ifFB@xetex@punct} ... \cs{fi} (it broke Plain formats).} +% +% \changes{v3.1g}{2015/06/14}{Use Babel defined loops \cs{bbl@for} +% instead of \cs{@for} borrowed from file ltcntrl.dtx +% (\cs{@for} is undefined in Plain).} +% +% The following part holds specific code for punctuation with XeTeX +% engines. +% +% \begin{macrocode} +\ifFB@xetex@punct + \ifLaTeXe + \PackageInfo{french.ldf}{No need for active punctuation characters% + \MessageBreak with this version of XeTeX!% + \MessageBreak reported} + \else + \fb@info{No need for active punctuation characters\\ + with this version of XeTeX!} + \fi +% \end{macrocode} +% +% \changes{v2.5i}{2012/04/20}{Temporary fix: as long as +% \file{xeCJK.sty} will not use \cs{newXeTeXintercharclass} to +% allocate its classes, we will have to define 3 fake classes.} +% +% \changes{v2.5j}{2012/05/08}{Previous fix removed: bug fixed in +% \file{xeCJK.sty} version 3.0.4 (06-May-2012).} +% +% \changes{v2.6g}{2013/12/09}{U+00A0 (Unicode nobreakspace) and U+202F +% (Unicode nobreakthinspace) added to class \cs{FB@punctnul} +% to prevent frenchb from adding it’s own space before `high +% punctuation’ characters.} +% +% \changes{v2.6h}{2014/01/03}{New class \cs{FB@guilnul} for characters +% U+00A0 (Unicode nobreakspace) and U+202F (Unicode +% nobreakthinspace), to prevent frenchb from adding spurious spaces +% inside quotes.} +% +% Six new character classes are defined for \frenchb. +% \begin{macrocode} + \newXeTeXintercharclass\FB@punctthick + \newXeTeXintercharclass\FB@punctthin + \newXeTeXintercharclass\FB@punctnul + \newXeTeXintercharclass\FB@guilo + \newXeTeXintercharclass\FB@guilf + \newXeTeXintercharclass\FB@guilnul +% \end{macrocode} +% +% \changes{v3.1l}{2016/02/07}{Add a variant of \cs{babel@savevariable} +% to save \cs{XeTeXcharclass}(es) in a loop.} +% +% As |\babel@savevariable| doesn’t work inside a |\bbl@for| loop, +% we define a variant to save the |\XeTeXcharclass| values which +% will be modified in French. +% \begin{macrocode} + \def\FBsavevariable@loop#1#2{\begingroup + \toks@\expandafter{\originalTeX #1}% + \edef\x{\endgroup + \def\noexpand\originalTeX{\the\toks@ #2=\the#1#2\relax}}% + \x} +% \end{macrocode} +% |\FB@charlist| holds the all list of characters which have their +% |\XeTeXcharclass| value modified in French: the first set includes +% high punctuation, French quotes, opening delimiters and no-break +% spaces \\[5pt] +% \begin{tabular}{*{10}{|c}|}\hline +% "21 &"3A &"3B &"3F &"AB &"BB &"28 &"5B &"A0 &"202F +% \\ \hline +% \char"21 &\char"3A &\char"3B &\char"3F & « & » +% &\char"28 &\char"5B & & \\ \hline +% \end{tabular}\\[5pt] +% the second one holds those which need resetting in French when +% \file{xeCJK.sty} is in use\\[5pt] +% \begin{tabular}{*{12}{|c}|}\hline +% "29 &"5D &"7B &"7D &"2C &"2D &"2E &"22 &"25 &"27 &"60 &"2019 +% \\ \hline +% \char"29 &\char"5D &\char"7B &\char"7D &\char"2C &\char"2D +% &\char"2E &\char"22 &\char"25 &\textquotesingle &\char"60 +% &\char"27 \\ \hline +% \end{tabular} +% +% \begin{macrocode} + \def\FB@charlist{"21,"3A,"3B,"3F,"AB,"BB,"28,"5B,"A0,"202F,% + "29,"5D,"7B,"7D,"2C,"2D,"2E,"22,"25,"27,"60,"2019} +% \end{macrocode} +% +% \begin{macro}{\FB@xetex@punct@french} +% The following command will be executed when entering French, it +% first saves the values to be modified, then fits them to our +% needs. It also redefines |\shorthandoff| and |\shorthandon| +% (locally) to avoid error messages with XeTeX-based engines. +% +% \changes{v2.5g}{2011/12/31}{XeTeXcharclass(es) for French quotes will +% be set to \cs{FB@guilo} and \cs{FB@guilf} by options +% `og’ and `fg’ in \cs{frenchbsetup}. French quotes should behave +% as normal characters by default in XeLaTeX as in LaTeX.} +% +% \changes{v2.5i}{2012/04/20}{\file{xeCJK.sty} changes the +% \cs{XeTeXcharclass} of ASCII chars `-’ `,’ `.’ `)’ `]’ `\}’ +% `\{’ `\%’ opening and closing single and double quotes. +% We set their class to 0 in French and reset their class +% to their original value when leaving French. See +% \cs{FB@xetex@punct@nonfrench} below.} +% +% \changes{v3.1k}{2015/12/05}{Thin glues (less than 1sp) should not +% trigger space insertion before high ponctuation. Add a check on +% \cs{lastkip}.} +% +% \changes{v3.1l}{2016/02/07}{Save and restore +% \cs{XeTeXinterchartokenstate}, \cs{shorthandon}, \cs{shorthandoff} +% using \cs{babel@savevariable} and \cs{babel@save}, +% \cs{XeTeXcharclass}(es) using \cs{FB@savevariable@loop}.} +% +% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to all +% \cs{XeTeXinterchartoks} commands.} +% +% \begin{macrocode} + \newcommand*{\FB@xetex@punct@french}{% + \babel@savevariable{\XeTeXinterchartokenstate}% + \babel@save{\shorthandon}% + \babel@save{\shorthandoff}% + \bbl@for\FB@char\FB@charlist + {\FBsavevariable@loop{\XeTeXcharclass}{\FB@char}}% + \def\shorthandoff##1{% + \ifx\PackageWarning\@undefined + \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with + XeTeX,\\ use \noexpand\NoAutoSpacing + *inside a group* instead.}% + \else + \PackageWarning{french.ldf}{\protect\shorthandoff{;:!?} is + helpless with XeTeX,\MessageBreak use \protect\NoAutoSpacing + \space *inside a group* instead;\MessageBreak reported}% + \fi}% + \def\shorthandon##1{}% +% \end{macrocode} +% Let’s now set the classes and interactions between classes. +% When false, the flag |\ifFB@spacing| switches off any interaction +% between classes (this flag is controlled by user-level command +% |\NoAutoSpacing|; this flag is also set to false when the current +% font is a typewriter font). +% \begin{macrocode} + \XeTeXinterchartokenstate=1 + \XeTeXcharclass `\: = \FB@punctthick + \XeTeXinterchartoks \z@ \FB@punctthick = {% + \ifFB@spacing\ifhmode\FDP@colonspace\fi\fi}% + \XeTeXinterchartoks \FB@guilf \FB@punctthick = {% + \ifFB@spacing\FDP@colonspace\fi}% +% \end{macrocode} +% Small glues such as ``glue 1sp’’ in tabular `l’ columns or ``glue +% 0 plus 1 fil’’ in tabular `c’ columns or \env{lstlisting} +% environment should not trigger any extra space; they will still do +% when \fbo{AutoSpacePunctuation} is true: unfortunately +% |\XeTeXcharclass=\FB@nonchar| isn’t specific to glue tokens (this +% class includes box and math boundaries f.i.), so the |\else| part +% cannot be omitted. +% \begin{macrocode} + \XeTeXinterchartoks \FB@nonchar \FB@punctthick = {% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBcolonspace + \else + \FDP@colonspace + \fi + \fi + \fi}% + \bbl@for\FB@char + {`\;,`\!,`\?}% + {\XeTeXcharclass\FB@char=\FB@punctthin}% + \XeTeXinterchartoks \z@ \FB@punctthin = {% + \ifFB@spacing\ifhmode\FDP@thinspace\fi\fi}% + \XeTeXinterchartoks \FB@guilf \FB@punctthin = {% + \ifFB@spacing\FDP@thinspace\fi}% + \XeTeXinterchartoks \FB@nonchar \FB@punctthin = {% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBthinspace + \else + \FDP@thinspace + \fi + \fi + \fi}% + \XeTeXinterchartoks \FB@guilo \z@ = {% + \ifFB@spacing\FB@guillspace\fi}% + \XeTeXinterchartoks \FB@guilo \FB@nonchar = {% + \ifFB@spacing\FB@guillspace\ignorespaces\fi}% + \XeTeXinterchartoks \z@ \FB@guilf = {% + \ifFB@spacing\FB@guillspace\fi}% + \XeTeXinterchartoks \FB@punctthin \FB@guilf = {% + \ifFB@spacing\FB@guillspace\fi}% + \XeTeXinterchartoks \FB@nonchar \FB@guilf = {% + \ifFB@spacing\unskip\FB@guillspace\fi}% +% \end{macrocode} +% This will avoid spurious spaces in (!), [?] and with Unicode +% non-breaking spaces (U+00A0, U+202F): +% \begin{macrocode} + \bbl@for\FB@char + {`\[,`\(,"A0,"202F}% + {\XeTeXcharclass\FB@char=\FB@punctnul}% +% \end{macrocode} +% These characters have their class changed by \file{xeCJK.sty}, +% let’s reset them to 0 in French. +% \begin{macrocode} + \bbl@for\FB@char + {`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}% + {\XeTeXcharclass\FB@char=\z@}% + } + \addto\extrasfrench{\FB@xetex@punct@french} +% \end{macrocode} +% \end{macro} +% +% End of specific code for punctuation with modern XeTeX engines. +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \subsubsection{Punctuation with standard (pdf)TeX} +% \label{sssec-punct-tex} +% +% In standard (pdf)TeX we need to make the four characters |;| |!| |?| +% and |:| `active’ and provide their definitions. +% \begin{macrocode} +\ifFB@active@punct + \initiate@active@char{:}% + \initiate@active@char{;}% + \initiate@active@char{!}% + \initiate@active@char{?}% +% \end{macrocode} +% We first tune the amount of space before \texttt{;} +% \texttt{!} \texttt{?} and \texttt{:}. This should only happen +% in horizontal mode, hence the test |\ifhmode|. +% +% In horizontal mode, if a space has been typed before `;’ we +% remove it and put a non-breaking |\FBthinspace| instead. +% If no space has been typed, we add |\FDP@thinspace| which will be +% defined, up to the user’s wishes, as a non-breaking |\FBthinspace| +% or as |\@empty|. +% +% \changes{v3.1k}{2015/12/05}{(pdfTeX shorthands) test on \cs{lastskip} +% changed from 0pt to 1sp for active punctuation for consistency +% with XeTeX and LuaTeX.} +% +% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to the +% four French shorthands.} +% +% \begin{macrocode} + \declare@shorthand{french}{;}{% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBthinspace + \else + \FDP@thinspace + \fi + \fi + \fi +% \end{macrocode} +% Now we can insert a |;| character. +% \begin{macrocode} + \string;} +% \end{macrocode} +% The next three definitions are very similar. +% \begin{macrocode} + \declare@shorthand{french}{!}{% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBthinspace + \else + \FDP@thinspace + \fi + \fi + \fi + \string!} + \declare@shorthand{french}{?}{% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBthinspace + \else + \FDP@thinspace + \fi + \fi + \fi + \string?} + \declare@shorthand{french}{:}{% + \ifFB@spacing + \ifhmode + \ifdim\lastskip>1sp + \unskip\penalty\@M\FBcolonspace + \else + \FDP@colonspace + \fi + \fi + \fi + \string:} +% \end{macrocode} +% When the active characters appear in an environment where their +% French behaviour is not wanted they should give an `expected’ +% result. Therefore we define shorthands at system level as well. +% \begin{macrocode} + \declare@shorthand{system}{:}{\string:} + \declare@shorthand{system}{!}{\string!} + \declare@shorthand{system}{?}{\string?} + \declare@shorthand{system}{;}{\string;} +%} +% \end{macrocode} +% We specify that the French group of shorthands should be used when +% switching to French. +% \begin{macrocode} + \addto\extrasfrench{\languageshorthands{french}% +% \end{macrocode} +% These characters are `turned on’ once, later their definition may +% vary. Don’t misunderstand the following code: they keep being +% active all along the document, even when leaving French. +% \begin{macrocode} + \bbl@activate{:}\bbl@activate{;}% + \bbl@activate{!}\bbl@activate{?}% + } + \addto\noextrasfrench{% + \bbl@deactivate{:}\bbl@deactivate{;}% + \bbl@deactivate{!}\bbl@deactivate{?}% + } +\fi +% \end{macrocode} +% +% \subsubsection{Punctuation switches common to all engines} +% \label{sssec-punct-switches} +% +% A new `if’ |\ifFBAutoSpacePunctuation| needs to be defined now to +% control the two possible ways of dealing with `high punctuation’. +% it’s default value is true, but it can be set to false by +% \fbsetup{AutoSpacePunctuation=false} for finer control. +% \begin{macrocode} +\newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue +% \end{macrocode} +% +% \begin{macro}{\AutoSpaceBeforeFDP} +% \begin{macro}{\NoAutoSpaceBeforeFDP} +% +% \changes{v2.3a}{2008/10/10}{\cs{NoAutoSpaceBeforeFDP} and +% \cs{AutoSpaceBeforeFDP} now set the flag +% \cs{ifFBAutoSpacePunctuation} accordingly (LaTeX only).} +% +% \changes{v2.3e}{2009/10/10}{Execute \cs{AutoSpaceBeforeFDP} +% also in LaTeX to define \cs{FDP@colonspace}: needed for +% tex4ht, pointed out by MPG.} +% +% |\autospace@beforeFDP| and |\noautospace@beforeFDP| are internal +% commands. |\autospace@beforeFDP| defines |\FDP@thinspace| and +% |\FDP@colonspace| as non-breaking spaces and sets LuaTeX attribute +% |\FB@addDPspace| to 1 (true), while |\noautospace@beforeFDP| +% lets these spaces empty and sets flag |\FB@addDPspace| +% to 0 (false). User commands |\AutoSpaceBeforeFDP| and +% |\NoAutoSpaceBeforeFDP| do the same and take care of the flag +% |\ifFBAutoSpacePunctuation| in \LaTeX{}. +% Set the default now for Plain (done later for LaTeX). +% \begin{macrocode} +\def\autospace@beforeFDP{% + \ifFB@luatex@punct\FB@addDPspace=1 \fi + \def\FDP@thinspace{\penalty\@M\FBthinspace}% + \def\FDP@colonspace{\penalty\@M\FBcolonspace}} +\def\noautospace@beforeFDP{% + \ifFB@luatex@punct\FB@addDPspace=0 \fi + \let\FDP@thinspace\@empty + \let\FDP@colonspace\@empty} +\ifLaTeXe + \def\AutoSpaceBeforeFDP{\autospace@beforeFDP + \FBAutoSpacePunctuationtrue} + \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP + \FBAutoSpacePunctuationfalse} + \AtEndOfPackage{\AutoSpaceBeforeFDP} +\else + \let\AutoSpaceBeforeFDP\autospace@beforeFDP + \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP + \AutoSpaceBeforeFDP +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v2.3a}{2008/10/10}{In LaTeX, frenchb no longer adds spaces +% before `high punctuation’ characters in computer code. +% Suggested by Yannis Haralambous.} +% +% \begin{macro}{\rmfamilyFB} +% \begin{macro}{\sffamilyFB} +% \begin{macro}{\ttfamilyFB} +% +% \changes{v2.3c}{2009/02/07}{Commands \cs{ttfamily}, \cs{rmfamily} +% and \cs{sffamily} have to be robust. Bug introduced in 2.3a, +% pointed out by Manuel Pégourié-Gonnard.} +% +% In LaTeX2e |\ttfamily| (and hence |\texttt|) will be redefined +% `AtBeginDocument’ as |\ttfamilyFB| so that no space +% is added before the four |; : ! ?| characters, even if +% \fbo{AutoSpacePunctuation} is \fbo{true}. When +% \fbo{AutoSpacePunctuation} is \fbo{false}, the eventually typed +% spaces are left unchanged (not turned into thin spaces, no penalty +% added). |\rmfamily| and |\sffamily| need to be redefined also +% (|\ttfamily| is not always used inside a group, its effect can be +% cancelled by |\rmfamily| or |\sffamily|). +% +% These redefinitions can be canceled if necessary, for instance to +% recompile older documents, see option \fbo{OriginalTypewriter} +% below. +% +% \changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel +% automatic spaces inside French guillemets entered as characters +% (see \cs{frenchbsetup}).} +% +% \changes{v3.2c}{2016/05/14}{New definitions of \cs{ttfamilyFB} and +% co, common to all engines, based on \cs{FB@spacing@off} +% and\cs{FB@spacing@on}.} +% +% To be consistent with what is done for the |; : ! ?| +% characters, |\ttfamilyFB| also switches off insertion of spaces +% inside French guillemets \emph{when they are typed in as +% characters} with the `og’/`fg’ options in \fbsetup{}. +% This is also a workaround for the weird behaviour of these +% characters in verbatim mode. +% +% \begin{macrocode} +\ifLaTeXe + \DeclareRobustCommand\ttfamilyFB{\FB@spacing@off \ttfamilyORI} + \DeclareRobustCommand\rmfamilyFB{\FB@spacing@on \rmfamilyORI} + \DeclareRobustCommand\sffamilyFB{\FB@spacing@on \sffamilyORI} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v2.5a}{2010/08/14}{New command \cs{NoAutoSpacing}, +% suggested by MPG.} +% +% \begin{macro}{\NoAutoSpacing} +% The following command disables automatic spacing for high +% punctuation and French quote characters; it also switches off +% active punctuation characters (if any). +% It is engine independent (works for TeX, LuaTeX and +% XeTeX based engines) and is meant to be used inside a group. +% +% \changes{v3.2b}{2016/04/18}{\cs{NoAutoSpacing} made robust.} +% +% \changes{v3.2c}{2016/05/14}{New definition based on +% \cs{FB@spacing@off} common to all engines.} +% +% \begin{macrocode} +\DeclareRobustCommand*{\NoAutoSpacing}{% + \FB@spacing@off + \ifFB@active@punct\shorthandoff{;:!?}\fi +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Commands for French quotation marks} +% \label{ssec-quotes} +% +% \begin{macro}{\guillemotleft} +% \begin{macro}{\guillemotright} +% \begin{macro}{\textquoteddblleft} +% \begin{macro}{\textquoteddblright} +% pdfLaTeX users are supposed to use 8-bit output +% encodings (T1, LY1,\dots) to typeset French, those who still +% stick to OT1 should load \pkg{aeguill} or a similar package. +% In both cases the commands |\guillemotleft| and |\guillemotright| +% will print the French opening and closing quote characters from +% the output font. +% For XeLaTeX and LuaLaTeX, |\guillemotleft| and |\guillemotright| +% are defined by package \pkg{fontspec} (v.~2.5d and up). +% +% \changes{v2.5a}{2010/08/20}{Change \cs{guillemotleft} and +% \cs{guillemotright} definitions for Unicode anf provide +% definitions for \cs{textquotedblleft} and +% \cs{textquotedbright}. Insures correct printing of quotes +% by \cs{og} and \cs{fg} in French and outside.} +% +% We provide the following definitions for non-LaTeX users only as +% fall-back, they are welcome to change them for anything better. +% \begin{macrocode} +\ifLaTeXe +\else + \ifFBunicode + \def\guillemotleft{{\char"00AB}} + \def\guillemotright{{\char"00BB}} + \def\textquotedblleft{{\char"201C}} + \def\textquotedblright{{\char"201D}} + \else + \def\guillemotleft{\leavevmode\raise0.25ex + \hbox{$\scriptscriptstyle\ll$}} + \def\guillemotright{\raise0.25ex + \hbox{$\scriptscriptstyle\gg$}} + \def\textquotedblleft{``} + \def\textquotedblright{''} + \fi + \let\xspace\relax +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v3.4a}{2018/01/18}{New \cs{FBgspchar} to customise the +% space character to be used for \cs{og} and\cs{fg} with the +% UnicodeNoBreakSpaces option.} +% +% \begin{macro}{\FBgspchar} +% \begin{macro}{\FB@og} +% \begin{macro}{\FB@fg} +% The next step is to provide correct spacing after `«’ and before +% `»’; no line break is allowed neither \emph{after} the opening +% one, nor \emph{before} the closing one. +% French quotes (including spacing) are printed by |\FB@og| and +% |\FB@fg|, the expansion of the top level commands |\og| and |\og| +% is different in and outside French. +% +% \changes{v3.0a}{2014/01/10}{Definitions of \cs{FB@og} and \cs{FB@fg} +% now depend on punctuation handling (LuaTeX / XeTeX / active).} +% +% The definitions of |\FB@og| and |\FB@fg| need some engine-dependent +% tuning: for LuaTeX, |\FB@spacing| is set to~0 locally to prevent +% the quotes characters from adding space when option +% \fbo{og=«, fg=»} is set. +% \begin{macrocode} +\newcommand*{\FB@guillspace}{\penalty\@M\FBguillspace} +\newcommand*{\FBgspchar}{\char"A0\relax} +\newif\ifFBucsNBSP +\ifFB@luatex@punct + \DeclareRobustCommand*{\FB@og}{\leavevmode + \bgroup\FB@spacing=0 \guillemotleft\egroup + \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi} + \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi + \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi + \bgroup\FB@spacing=0 \guillemotright\egroup} +\fi +% \end{macrocode} +% With XeTeX, |\ifFB@spacing| is set to |false| locally for the +% same reason. +% \begin{macrocode} +\ifFB@xetex@punct + \DeclareRobustCommand*{\FB@og}{\leavevmode + \bgroup\FB@spacingfalse\guillemotleft\egroup + \FB@guillspace} + \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi + \FB@guillspace + \bgroup\FB@spacingfalse\guillemotright\egroup} +\fi +\ifFB@active@punct + \DeclareRobustCommand*{\FB@og}{\leavevmode + \guillemotleft + \FB@guillspace} + \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi + \FB@guillspace + \guillemotright} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\og} +% \begin{macro}{\fg} +% +% The user level macros for quotation marks are named |\og| +% (``\underline{o}uvrez \underline{g}uillemets’’) and |\fg| +% (``\underline{f}ermez \underline{g}uillemets’’). +% Another option for typesetting quotes in French is to use the +% command |\frquote| (see below). +% Dummy definition of |\og| and |\fg| just to ensure that this +% commands are not yet defined. +% \begin{macrocode} +\newcommand*{\og}{\@empty} +\newcommand*{\fg}{\@empty} +% \end{macrocode} +% +% The definitions of |\og| and |\fg| for quotation marks are +% switched on and off through the |\extrasfrench| |\noextrasfrench| +% mechanism. Outside French, |\og| and |\fg| will typeset standard +% English opening and closing double quotes. +% We’ll try to be smart to users of David~Carlisle’s \pkg{xspace} +% package: if this package is loaded there will be no need for |{}| +% or |\ | to get a space after |\fg|, otherwise |\xspace| will be +% defined as |\relax| (done at the end of this file). +% +% \changes{v2.5a}{2010/08/20}{\cs{og} and \cs{fg} do not print +% correctly in English when using XeTeX or LuaTeX, fixed by using +% \cs{textquotedblleft} and \cs{textquotedblright} defined above.} +% +% \changes{v3.2a}{2016/03/18}{\cs{xspace} moved from \cs{FB@fg} to +% \cs{fg}: \cs{xspace} messes up \cs{frquote}, pointed out by Sonia +% Labetoulle. As a side effect \cs{xspace} is now active in \cs{fg} +% in and outside French.} +% +% \begin{macrocode} +\ifLaTeXe + \def\bbl@frenchguillemets{% + \renewcommand*{\og}{\FB@og}% + \renewcommand*{\fg}{\FB@fg\xspace}} + \renewcommand*{\og}{\textquotedblleft} + \renewcommand*{\fg}{\ifdim\lastskip>\z@\unskip\fi + \textquotedblright\xspace} +\else + \def\bbl@frenchguillemets{\let\og\FB@og + \let\fg\FB@fg} + \def\og{\textquotedblleft} + \def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v3.0a}{2014/01/10}{\cs{bbl@nonfrenchguillemets} deleted, +% use \cs{babel@save} instead.} +% +% \begin{macrocode} +\addto\extrasfrench{\babel@save\og \babel@save\fg \bbl@frenchguillemets} +% \end{macrocode} +% +% \changes{v3.1a}{2014/05/20}{New command \cs{frquote} for imbedded or +% long French quotations.} +% +% \begin{macro}{\frquote} +% Another way of entering French quotes relies on |\frquote{}| +% with supports up to two levels of quotes. +% Let’s define the default quote characters to be used for level one +% or two of quotes\dots{} +% \begin{macrocode} +\newcommand*{\ogi}{\FB@og} +\newcommand*{\fgi}{\FB@fg} +\newcommand*{\@ogi}{\ifmmode\hbox{\ogi}\else\ogi\fi} +\newcommand*{\@fgi}{\ifmmode\hbox{\fgi}\else\fgi\fi} +\newcommand*{\ogii}{\textquotedblleft} +\newcommand*{\fgii}{\textquotedblright} +\newcommand*{\@ogii}{\ifmmode\hbox{\ogii}\else\ogii\fi} +\newcommand*{\@fgii}{\ifmmode\hbox{\fgii}\else\fgii\fi} +% \end{macrocode} +% and the needed technical stuff to handle options: +% +% \changes{v3.2g}{2017/01/30}{Default options of \cs{frquote} are no +% longer engine-dependent.} +% +% \changes{v3.5b}{2018/07/15}{New command \cs{FB@addquote@everypar} to +% manage \cs{everypar}: \cs{frquote} failed when used immediately +% after a sectionning command.} +% +% \begin{macrocode} +\newcount\FBguill@level +\newtoks\FBold@everypar +% \end{macrocode} +% |\FB@addquote@everypar| was borrowed from \file{csquotes.sty}. +% \begin{macrocode} +\def\FB@addquote@everypar{% + \let\FBnew@everypar\everypar + \FBold@everypar=\expandafter{\the\everypar}% + \FBnew@everypar={\the\FBold@everypar\FBeverypar@quote}% + \let\everypar\FBold@everypar + \let\FB@addquote@everypar\relax +} +\newif\ifFBcloseguill \FBcloseguilltrue +\newif\ifFBInnerGuillSingle +\def\FBguillopen{\bgroup\NoAutoSpacing\guillemotleft\egroup} +\def\FBguillclose{\bgroup\NoAutoSpacing\guillemotright\egroup} +\let\FBguillnone\empty +\let\FBeveryparguill\FBguillopen +\let\FBeverylineguill\FBguillnone +\let\FBeverypar@quote\relax +\let\FBeveryline@quote\empty +% \end{macrocode} +% The main command |\frquote| accepts (in LaTeX2e only) a starred +% version which suppresses the closing quote; it is meant to be used +% for inner quotations which end together with the outer one, then +% only one closing guillemet (the outer one) should be printed. +% \begin{macrocode} +\ifLaTeXe + \DeclareRobustCommand\frquote{% + \@ifstar{\FBcloseguillfalse\fr@quote}% + {\FBcloseguilltrue\fr@quote}} +\else + \newcommand\frquote[1]{\fr@quote{#1}} +\fi +% \end{macrocode} +% +% \changes{v3.1j}{2015/11/25}{\cs{fr@quote} completely rewritten: +% \cs{leavevmode} added and explicitly save/retore \cs{everypar} and +% \cs{localleftbox} instead of using a group in order to ensure +% compatibility with package wrapfig.} +% +% \changes{v3.1j}{2015/11/21}{\cs{PackageWarning} is undefined in +% Plain, use \cs{fb@warning} instead.} +% +% \changes{v3.3a}{2017/04/30}{\cs{FB@quotespace} (kern), changed +% into \cs{FB@guillspace}.} +% +% The internal command |\fr@quote| takes one (long) argument: the +% quotation text. +% \begin{macrocode} +\newcommand{\fr@quote}[1]{% + \leavevmode + \advance\FBguill@level by \@ne + \ifcase\FBguill@level + \or +% \end{macrocode} +% This for level 1 (outer) quotations: set |\FBeverypar@quote| +% for level 1 quotations and add it to |\everypar| using +% |\FB@addquote@everypar|, then print the quotation: +% \begin{macrocode} + \ifx\FBeveryparguill\FBguillnone + \else + \def\FBeverypar@quote{\FBeveryparguill\FB@guillspace}% + \FB@addquote@everypar + \fi + \@ogi #1\@fgi + \or +% \end{macrocode} +% This for level 2 (inner) quotations: Omega’s command +% |\localleftbox| included in LuaTeX, is convenient for repeating +% guillemets at the beginning of every line.\hlabel{cs:localleftbox} +% +% \changes{v3.1i}{2015/10/04}{\cs{luatexlocalleftbox} changed to +% \cs{localleftbox} by new LaTeX release 2015/10/01.} +% +% \changes{v3.5c}{2018/09/14}{\cs{FBeverypar@quote}’s value now properly +% reset across level changes.} +% +% \changes{v3.5e}{2019/03/23}{reset \cs{FB@addGUILspace} attribute +% inside \cs{localleftbox} (LuaTeX).} +% +% \begin{macrocode} + \ifx\FBeverylineguill\FBguillopen + \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotleft + \FB@guillspace}% + \localleftbox{\FBeveryline@quote}% + \let\FBeverypar@quote\relax + \@ogi #1\ifFBcloseguill\@fgi\fi + \else + \ifx\FBeverylineguill\FBguillclose + \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotright + \FB@guillspace}% + \localleftbox{\FBeveryline@quote}% + \let\FBeverypar@quote\relax + \@ogi #1\ifFBcloseguill\@fgi\fi + \else +% \end{macrocode} +% otherwise we need to redefine |\FBeverypar@quote| (and eventually +% |\ogii|, |\fgii|) for level 2 quotations: +% \begin{macrocode} + \let\FBeverypar@quote\relax + \ifFBInnerGuillSingle + \def\ogii{\leavevmode + \guilsinglleft\FB@guillspace}% + \def\fgii{\ifdim\lastskip>\z@\unskip\fi + \FB@guillspace\guilsinglright}% + \ifx\FBeveryparguill\FBguillopen + \def\FBeverypar@quote{\guilsinglleft\FB@guillspace}% + \fi + \ifx\FBeveryparguill\FBguillclose + \def\FBeverypar@quote{\guilsinglright\FB@guillspace}% + \fi + \fi + \@ogii #1\ifFBcloseguill \@fgii \fi + \fi + \fi + \else +% \end{macrocode} +% Warn if |\FBguill@level| >~2: +% \begin{macrocode} + \ifx\PackageWarning\@undefined + \fb@warning{\noexpand\frquote\space handles up to + two levels.\\ Quotation not printed.}% + \else + \PackageWarning{french.ldf}{% + \protect\frquote\space handles up to two levels. + \MessageBreak Quotation not printed. Reported} + \fi + \fi +% \end{macrocode} +% +% \changes{v3.5e}{2019/03/14}{Make resettings global on exit.} +% +% Closing: step down |\FBguill@level| and clean on exit. +% Changes made global in case |\frquote{}| ends inside an +% environment. +% \begin{macrocode} + \global\advance\FBguill@level by \m@ne + \ifcase\FBguill@level \global\let\FBeverypar@quote\relax + \or \gdef\FBeverypar@quote{\FBeveryparguill\FB@guillspace}% + \global\let\FBeveryline@quote\empty + \ifx\FBeverylineguill\FBguillnone\else\localleftbox{}\fi + \fi +} +% \end{macrocode} +% \changes{v3.5e}{2019/03/14}{new command \cs{NoEveryParQuote}.} +% +% The next command is intended to be used in list environments to +% suppress quotes which might be added by |\FBeverypar@quote| after +% items for instance. +% \begin{macrocode} +\newcommand*{\NoEveryParQuote}{\let\FBeveryparguill\FBguillnone} +% \end{macrocode} +% \end{macro} +% +% \subsection{Date in French} +% \label{sssec-date} +% +% \begin{macro}{\frenchtoday} +% \begin{macro}{\frenchdate} +% \begin{macro}{\datefrench} +% The following code creates a macro |\datefrench| which in turn +% defines command |\frenchtoday| (|\today| is defined as +% |\frenchtoday| in French). +% The corresponding commands for the French dialect, |\dateacadian| +% and |\acadiantoday| are also created btw. +% This new implementation relies on commands |\SetString| and +% |\SetStringLoop|, therefore requires \babel~3.10 or newer. +% +% \changes{v2.0}{2006/11/06}{2 `\cs{relax}’ added in +% \cs{today}’s definition.} +% +% \changes{v2.1a}{2008/03/25}{\cs{today} changed (correction in 2.0 +% was wrong: \cs{today} was printed without spaces in toc).} +% +% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString} +% commands for \cs{datefrench}. Doesn’t work with Plain (yet?).} +% +% \changes{v3.4a}{2018/01/04}{Specific code for Plain finally removed +% (babel bug reported).} +% +% \changes{v3.4b}{2018/02/04}{Do not redefine \cs{date} as +% \cs{frenchdate} in French.} +% +% Explicitly defining |\BabelLanguages| as the list of all French +% dialects defines \emph{both} |\datefrench| and |\dateacadian|; +% this is required as \file{french.ldf} is read only once even if +% both language options \opt{french} and \opt{acadian} are supplied +% to \babel. Note that coding |\StartBabelCommands*{french,acadian}| +% would \emph{only} define |\csname date\CurrentOption\endcsname|, +% leaving the second language undefined in \babel’s sens. +% \begin{macrocode} +\def\BabelLanguages{french,acadian} +\StartBabelCommands*{\BabelLanguages}{date} + [unicode, fontenc=TU EU1 EU2, charset=utf8] + \SetString\monthiiname{février} + \SetString\monthviiiname{août} + \SetString\monthxiiname{décembre} +\StartBabelCommands*{\BabelLanguages}{date} + \SetStringLoop{month#1name}{% + janvier,f\'evrier,mars,avril,mai,juin,juillet,% + ao\^ut,septembre,octobre,novembre,d\'ecembre} + \SetString\today{\FB@date{\year}{\month}{\day}} +\EndBabelCommands +% \end{macrocode} +% |\frenchdate| (which produces an unbreakable string) and +% |\frenchtoday| (breakable) both rely on |\FB@date|, the inner +% group is needed for |\hbox|. +% \begin{macrocode} +\newcommand*{\FB@date}[3]{% + {{\number#3}\ifnum1=#3{\ier}\fi\FBdatespace + \csname month\romannumeral#2name\endcsname + \ifx#1\@empty\else\FBdatespace\number#1\fi}} +\newcommand*{\FBdatebox}{\hbox} +\newcommand*{\FBdatespace}{\space} +\newcommand*{\frenchdate}{\FBdatebox\FB@date} +\newcommand*{\acadiandate}{\FBdatebox\FB@date} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Extra utilities} +% +% Let’s provide the French user with some extra utilities. +% +% \changes{v2.1a}{2008/03/24}{Command \cs{fup} added to produce +% better superscripts than \cs{textsuperscript}.} +% +% \begin{macro}{\up} +% +% \changes{v2.1c}{2008/04/29}{Provide a temporary definition +% (hyperref safe) of \cs{up} in case it has to be expanded in +% the preamble (by beamer’s \cs{title} command for instance).} +% +% \changes{v2.4d}{2010/07/28}{Command \cs{up} defined with +% \cs{providecommand} instead of \cs{newcommand} as \cs{up} may be +% defined elsewhere (catalan.ldf). +% Bug pointed out by Felip Manyé i Ballester.} +% +% \begin{macro}{\fup} +% +% \changes{v2.1b}{2008/04/02}{Command \cs{fup} changed to use +% real superscripts from fourier v.~1.6.} +% +% \changes{v2.2a}{2008/05/08}{\cs{newif} and \cs{newdimen} moved +% before \cs{ifLaTeXe} to avoid an error with plainTeX.} +% +% \changes{v2.3a}{2008/09/30}{\cs{lowercase} changed to +% \cs{MakeLowercase} as the former doesn’t work for non ASCII +% characters in encodings like applemac, utf-8,\dots} +% +% |\up| eases the typesetting of superscripts like +% `1\up{er}’. Up to version 2.0 of \frenchb{} |\up| was just a +% shortcut for |\textsuperscript| in LaTeX2e, but several users +% complained that |\textsuperscript| typesets superscripts +% too high and too big, so we now define |\fup| as an attempt to +% produce better looking superscripts. |\up| is defined as |\fup| +% but \fbsetup{FrenchSuperscripts=false} redefines |\up| +% as |\textsuperscript| for compatibility with previous versions. +% +% When a font has built-in superscripts, the best thing to do is +% to just use them, otherwise |\fup| has to simulate superscripts +% by scaling and raising ordinary letters. Scaling is done using +% package \pkg{scalefnt} which will be loaded at the end of +% \babel’s loading (\frenchb{} being an option of \babel, it cannot +% load a package while being read). +% +% \begin{macrocode} +\newif\ifFB@poorman +\newdimen\FB@Mht +\ifLaTeXe + \AtEndOfPackage{\RequirePackage{scalefnt}} +% \end{macrocode} +% |\FB@up@fake| holds the definition of fake superscripts. +% The scaling ratio is 0.65, raising is computed to put the top of +% lower case letters (like `m’) just under the top of upper case +% letters (like `M’), precisely 12\% down. The chosen settings +% look correct for most fonts, but can be tuned by the end-user +% if necessary by changing |\FBsupR| and |\FBsupS| commands. +% +% |\FB@lc| is defined as |\MakeLowercase| to inhibit the uppercasing +% of superscripts (this may happen in page headers with the standard +% classes but is wrong); |\FB@lc| can be redefined to do nothing +% by option \fbo{LowercaseSuperscripts=false} of \fbsetup{}. +% \begin{macrocode} + \newcommand*{\FBsupR}{-0.12} + \newcommand*{\FBsupS}{0.65} + \newcommand*{\FB@lc}[1]{\MakeLowercase{#1}} + \DeclareRobustCommand*{\FB@up@fake}[1]{% + \settoheight{\FB@Mht}{M}% + \addtolength{\FB@Mht}{\FBsupR \FB@Mht}% + \addtolength{\FB@Mht}{-\FBsupS ex}% + \raisebox{\FB@Mht}{\scalefont{\FBsupS}{\FB@lc{#1}}}% + } +% \end{macrocode} +% The only packages I currently know to take advantage of real +% superscripts are a) \pkg{realscripts} used in conjunction with +% XeLaTeX or LuaLaTeX and OpenType fonts having the font feature +% `VerticalPosition=Superior’ and b) \pkg{fourier} +% (from version 1.6) when Expert Utopia fonts are available. +% +% |\FB@up| checks whether the current font is a Type1 `Expert’ +% (or `Pro’) font with real superscripts or not (the code works +% currently only with \file{fourier-1.6} but could work with any +% Expert Type1 font with built-in superscripts, see below), and +% decides to use real or fake superscripts. +% It works as follows: the content of |\f@family| (family name of +% the current font) is split by |\FB@split| into two pieces, the +% first three characters (`|fut|’ for Fourier, `|ppl|’ for Adobe’s +% Palatino, \dots) stored in |\FB@firstthree| and the rest stored +% in |\FB@suffix| which is expected to be `|x|’ or `|j|’ for expert +% fonts. +% \begin{macrocode} + \def\FB@split#1#2#3#4\@nil{\def\FB@firstthree{#1#2#3}% + \def\FB@suffix{#4}} + \def\FB@x{x} + \def\FB@j{j} + \DeclareRobustCommand*{\FB@up}[1]{% + \bgroup \FB@poormantrue + \expandafter\FB@split\f@family\@nil +% \end{macrocode} +% Then |\FB@up| looks for a \file{.fd} file named \file{t1fut-sup.fd} +% (Fourier) or \file{t1ppl-sup.fd} (Palatino), etc.\ supposed to +% define the subfamily (|fut-sup| or |ppl-sup|, etc.) giving access +% to the built-in superscripts. If the \file{.fd} file is not found +% by |\IfFileExists|, |\FB@up| falls back on fake superscripts, +% otherwise |\FB@suffix| is checked to decide whether to use fake or +% real superscripts. +% \begin{macrocode} + \edef\reserved@a{\lowercase{% + \noexpand\IfFileExists{\f@encoding\FB@firstthree -sup.fd}}}% + \reserved@a + {\ifx\FB@suffix\FB@x \FB@poormanfalse\fi + \ifx\FB@suffix\FB@j \FB@poormanfalse\fi + \ifFB@poorman \FB@up@fake{#1}% + \else \FB@up@real{#1}% + \fi}% + {\FB@up@fake{#1}}% + \egroup} +% \end{macrocode} +% |\FB@up@real| just picks up the superscripts from the subfamily +% (and forces lowercase). +% \begin{macrocode} + \newcommand*{\FB@up@real}[1]{\bgroup + \fontfamily{\FB@firstthree -sup}\selectfont \FB@lc{#1}\egroup} +% \end{macrocode} +% |\fup| is defined as |\FB@up| unless |\realsuperscript| is +% defined by \file{realscripts.sty}. +% \begin{macrocode} + \DeclareRobustCommand*{\fup}[1]{% + \ifx\realsuperscript\@undefined + \FB@up{#1}% + \else + \bgroup\let\fakesuperscript\FB@up@fake + \realsuperscript{\FB@lc{#1}}\egroup + \fi} +% \end{macrocode} +% Let’s provide a temporary definition for |\up| (redefined +% `AtBeginDocument’ as |\fup| or |\textsuperscript| according to +% \fbsetup{} options). +% \begin{macrocode} + \providecommand*{\up}{\relax} +% \end{macrocode} +% Poor man’s definition of |\up| for Plain. +% \begin{macrocode} +\else + \providecommand*{\up}[1]{\leavevmode\raise1ex\hbox{\sevenrm #1}} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ieme} +% \begin{macro}{\ier} +% \begin{macro}{\iere} +% \begin{macro}{\iemes} +% \begin{macro}{\iers} +% \begin{macro}{\ieres} +% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions +% of \cs{ieme} and co: \cs{up} already does the conversion.} +% +% Some handy macros for those who don’t know how to abbreviate +% ordinals: +% \begin{macrocode} +\def\ieme{\up{e}\xspace} +\def\iemes{\up{es}\xspace} +\def\ier{\up{er}\xspace} +\def\iers{\up{ers}\xspace} +\def\iere{\up{re}\xspace} +\def\ieres{\up{res}\xspace} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v3.3c}{2017/07/23}{New configurable kerns \cs{FBmedkern}, +% and \cs{FBthickkern} suitable for HTML translation.} +% +% \begin{macro}{\FBmedkern} +% \begin{macro}{\FBthickkern} +% \begin{macrocode} +\newcommand*{\FBmedkern}{\kern+.2em} +\newcommand*{\FBthickkern}{\kern+.3em} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \changes{v2.1c}{2008/04/29}{Added commands \cs{Nos} and \cs{nos}.} +% +% \begin{macro}{\No} +% \begin{macro}{\no} +% \begin{macro}{\Nos} +% \begin{macro}{\nos} +% \begin{macro}{\primo} +% \begin{macro}{\fprimo)} +% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions +% of \cs{FrenchEnumerate}, \dots{} \cs{No} and co: \cs{up} already +% does the conversion.} +% +% And some more macros relying on |\up| for numbering, +% first two support macros. +% \begin{macrocode} +\newcommand*{\FrenchEnumerate}[1]{#1\up{o}\FBthickkern} +\newcommand*{\FrenchPopularEnumerate}[1]{#1\up{o})\FBthickkern} +% \end{macrocode} +% +% Typing |\primo| should result in `\up{o}\kern+.3em’, +% \begin{macrocode} +\def\primo{\FrenchEnumerate1} +\def\secundo{\FrenchEnumerate2} +\def\tertio{\FrenchEnumerate3} +\def\quarto{\FrenchEnumerate4} +% \end{macrocode} +% while typing |\fprimo)| gives `\up{o})\kern+.3em. +% \begin{macrocode} +\def\fprimo){\FrenchPopularEnumerate1} +\def\fsecundo){\FrenchPopularEnumerate2} +\def\ftertio){\FrenchPopularEnumerate3} +\def\fquarto){\FrenchPopularEnumerate4} +% \end{macrocode} +% +% Let’s provide four macros for the common abbreviations +% of ``Numéro’’. +% \begin{macrocode} +\DeclareRobustCommand*{\No}{N\up{o}\FBmedkern} +\DeclareRobustCommand*{\no}{n\up{o}\FBmedkern} +\DeclareRobustCommand*{\Nos}{N\up{os}\FBmedkern} +\DeclareRobustCommand*{\nos}{n\up{os}\FBmedkern} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bsc} +% As family names should be written in small capitals and never be +% hyphenated, we provide a command (its name comes from Boxed Small +% Caps) to input them easily. Note that this command has changed +% with version~2 of \frenchb: a |\kern0pt| is used instead of |\hbox| +% because |\hbox| would break microtype’s font expansion; as a +% (positive?) side effect, composed names (such as Dupont-Durand) +% can now be hyphenated on explicit hyphens. +% Usage: |Jean~\bsc{Duchemin}|. +% +% \changes{v2.0}{2006/11/06}{\cs{hbox} dropped, replaced by +% \cs{kern0pt}.} +% +% \begin{macrocode} +\DeclareRobustCommand*{\bsc}[1]{\leavevmode\begingroup\kern0pt + \scshape #1\endgroup} +\ifLaTeXe\else\let\scshape\relax\fi +% \end{macrocode} +% \end{macro} +% +% Some definitions for special characters. We won’t define |\tilde| +% as a Text Symbol not to conflict with the macro |\tilde| for math +% mode and use the name |\tild| instead. Note that |\boi| may +% \emph{not} be used in math mode, its name in math mode is +% |\backslash|. |\degre| can be accessed by the command |\r{}| +% for ring accent. +% +% \changes{v2.5f}{2011/07/18}{Changed definitions of \cs{at}, +% \cs{circonflexe}, \cs{tild}, \cs{boi} and \cs{degre} for +% Unicode based engines.} +% +% \changes{v3.2g}{2017/01/24}{Changed Unicode definition of \cs{boi}.} +% +% \begin{macrocode} +\ifFBunicode + \newcommand*{\at}{{\char"0040}} + \newcommand*{\circonflexe}{{\char"005E}} + \newcommand*{\tild}{{\char"007E}} + \newcommand*{\boi}{{\char"005C}} + \newcommand*{\degre}{{\char"00B0}} +\else + \ifLaTeXe + \DeclareTextSymbol{\at}{T1}{64} + \DeclareTextSymbol{\circonflexe}{T1}{94} + \DeclareTextSymbol{\tild}{T1}{126} + \DeclareTextSymbolDefault{\at}{T1} + \DeclareTextSymbolDefault{\circonflexe}{T1} + \DeclareTextSymbolDefault{\tild}{T1} + \DeclareRobustCommand*{\boi}{\textbackslash} + \DeclareRobustCommand*{\degre}{\r{}} + \else + \def\T@one{T1} + \ifx\f@encoding\T@one + \newcommand*{\degre}{{\char6}} + \else + \newcommand*{\degre}{{\char23}} + \fi + \newcommand*{\at}{{\char64}} + \newcommand*{\circonflexe}{{\char94}} + \newcommand*{\tild}{{\char126}} + \newcommand*{\boi}{$\backslash$} + \fi +\fi +% \end{macrocode} +% +% \begin{macro}{\degres} +% We now define a macro |\degres| for typesetting the abbreviation +% for `degrees’ (as in `degrees Celsius’). As the bounding box of +% the character `degree’ has \emph{very} different widths in CM/EC +% and PostScript fonts, we fix the width of the bounding box of +% |\degres| to 0.3\,em, this lets the symbol `degree’ stick to the +% preceding (e.g., |45\degres|) or following character +% (e.g., |20~\degres C|). +% +% \changes{v2.6e}{2013/07/06}{Refrain from redefining \cs{textdegree} +% from latin1.def, applemac.def, etc. as \cs{degres} because it +% loops in hyperref’s bookmarks. Pointed out by Eddy Flas on fctt.} +% +% If \TeX{} Companion fonts are available (\file{textcomp.sty}), +% we pick up |\textdegree| from them instead of emulating `degrees’ +% from the |\r{}| accent. Otherwise we advise the user (once only) +% to use TS1-encoding. +% +% \changes{v2.1c}{2008/04/29}{Provide a temporary definition (hyperref +% safe) of \cs{degres} in case it has to be expanded in the preamble +% (by beamer’s \cs{title} command for instance).} +% +% \changes{v2.5h}{2012/03/21}{textcomp.sty has changed. The test +% about \cs{M@TS1} is no longer relevant, let’s change it.} +% +% \begin{macrocode} +\ifLaTeXe + \newcommand*{\degres}{\degre} + \ifFBunicode + \DeclareRobustCommand*{\degres}{\degre} + \else + \def\Warning@degree@TSone{\FBWarning + {Degrees would look better in TS1-encoding:% + \MessageBreak add \protect + \usepackage{textcomp} to the preamble.% + \MessageBreak Degrees used}} + \AtBeginDocument{\ifx\DeclareEncodingSubset\@undefined + \DeclareRobustCommand*{\degres}{% + \leavevmode\hbox to 0.3em{\hss\degre\hss}% + \Warning@degree@TSone + \global\let\Warning@degree@TSone\relax}% + \else + \DeclareRobustCommand*{\degres}{% + \hbox{\UseTextSymbol{TS1}{\textdegree}}}% + \fi + } + \fi +\else + \newcommand*{\degres}{% + \leavevmode\hbox to 0.3em{\hss\degre\hss}} +\fi +% \end{macrocode} +% \end{macro} +% +% \subsection{Formatting numbers} +% \label{ssec-numbers} +% +% \begin{macro}{\StandardMathComma} +% \begin{macro}{\DecimalMathComma} +% As mentioned in the \TeX{}book p.~134, the comma is of type +% |\mathpunct| in math mode: it is automatically followed by a +% thin space. This is convenient in lists and intervals but +% unpleasant when the comma is used as a decimal separator +% in French: it has to be entered as |{,}|. +% |\DecimalMathComma| makes the comma be an ordinary character +% (of type |\mathord|) in French \emph{only} (no space added); +% |\StandardMathComma| switches back to the standard behaviour +% of the comma. +% +% \changes{v3.2e}{2017/01/09}{\cs{DecimalMathComma} didn’t work +% with LuaTeX. Fixed now.} +% +% \changes{v3.2f}{2017/01/15}{Fixed conflict with the icomma +% package.} +% +% Unfortunately, |\newcount| inside |\if| breaks Plain formats. +% \begin{macrocode} +\newif\ifFB@icomma +\newcount\mc@charclass +\newcount\mc@charfam +\newcount\mc@charslot +\newcount\std@mcc +\newcount\dec@mcc +\ifFBLuaTeX + \mc@charclass=\Umathcharclass`\, + \newcommand*{\dec@math@comma}{% + \mc@charfam=\Umathcharfam`\, + \mc@charslot=\Umathcharslot`\, + \Umathcode`\,= 0 \mc@charfam \mc@charslot + } + \newcommand*{\std@math@comma}{% + \mc@charfam=\Umathcharfam`\, + \mc@charslot=\Umathcharslot`\, + \Umathcode`\,= \mc@charclass \mc@charfam \mc@charslot + } +\else + \std@mcc=\mathcode`\, + \dec@mcc=\std@mcc + \@tempcnta=\std@mcc + \divide\@tempcnta by "1000 + \multiply\@tempcnta by "1000 + \advance\dec@mcc by -\@tempcnta + \newcommand*{\dec@math@comma}{\mathcode`\,=\dec@mcc} + \newcommand*{\std@math@comma}{\mathcode`\,=\std@mcc} +\fi +\newcommand*{\DecimalMathComma}{% + \ifFBfrench\dec@math@comma\fi + \ifFB@icomma\else\addto\extrasfrench{\dec@math@comma}\fi +} +\newcommand*{\StandardMathComma}{% + \std@math@comma + \ifFB@icomma\else\addto\extrasfrench{\std@math@comma}\fi +} +\ifLaTeXe + \AtBeginDocument{\@ifpackageloaded{icomma}% + {\FB@icommatrue}% + {\addto\noextrasfrench{\std@math@comma}}% + } +\else + \addto\noextrasfrench{\std@math@comma} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\nombre} +% +% \changes{v2.0}{2006/11/06}{\cs{nombre} now requires numprint.sty.} +% +% The command |\nombre| is now borrowed from \file{numprint.sty} for +% LaTeX2e. There is no point to maintain the former tricky code +% when a package is dedicated to do the same job and more. +% For Plain based formats, |\nombre| no longer formats numbers, +% it prints them as is and issues a warning about the change. +% +% Fake command |\nombre| for Plain based formats, warning users of +% \frenchb{} v.~1.x.\ about the change: +% \begin{macrocode} +\newcommand*{\nombre}[1]{{#1}\fb@warning{*** \noexpand\nombre + no longer formats numbers\string! ***}} +% \end{macrocode} +% \end{macro} +% +% Let’s activate LuaTeX punctuation if necessary (LaTeX or Plain) +% so that |\FBsetspaces| commands can be used in the preamble, +% then cleanup and exit without loading any \file{.cfg} file +% in case of Plain formats. +% +% \begin{macrocode} +\ifFB@luatex@punct + \activate@luatexpunct +\fi +\let\FBstop@here\relax +\def\FBclean@on@exit{% + \let\ifLaTeXe\undefined + \let\LaTeXetrue\undefined + \let\LaTeXefalse\undefined + \let\FB@llc\loadlocalcfg + \let\loadlocalcfg\@gobble} +\ifx\magnification\@undefined +\else + \def\FBstop@here{% + \FBclean@on@exit + \ldf@finish\CurrentOption + \let\loadlocalcfg\FB@llc + \endinput} +\fi +\FBstop@here +% \end{macrocode} +% +% What follows is for LaTeX2e \emph{only}. +% We redefine |\nombre| for LaTeX2e. A warning is issued +% at the first call of |\nombre| if |\numprint| is not +% defined, suggesting what to do. The package \pkg{numprint} +% is \emph{not} loaded automatically by \frenchb{} because of +% possible options conflict. +% +% \changes{v3.1i}{2015/10/03}{\cs{nombre} command changed when +% numprint.sty is not loaded: only one warning, no error.} +% +% \begin{macrocode} +\renewcommand*{\nombre}[1]{\Warning@nombre{#1}} +\newcommand*{\Warning@nombre}[1]{% + \ifdefined\numprint + \numprint{#1}% + \else + \PackageWarning{french.ldf}{% + \protect\nombre\space now relies on package numprint.sty,% + \MessageBreak add \protect + \usepackage[autolanguage]{numprint},\MessageBreak + see file numprint.pdf for more options.\MessageBreak + \protect\nombre\space called}% + \global\let\Warning@nombre\relax + {#1}% + \fi +} +% \end{macrocode} +% +% \changes{v3.3c}{2017/08/10}{New command \cs{FBthousandsep} to +% customise numprint.} +% +% \changes{v3.4a}{2017/12/29}{Shrink/stretch removed in +% \cs{FBthousandsep}.} +% +% \begin{macrocode} +\newcommand*{\FBthousandsep}{\kern \fontdimen2\font \relax} +% \end{macrocode} +% +% \changes{v2.0c}{2007/06/25}{There is no need to define here +% numprint’s command \cs{npstylefrench}, it will be redefined +% `AtBeginDocument’ by \cs{FBprocess@options}.} +% +% \subsection{Caption names} +% \label{ssec-captions-name} +% +% The next step consists in defining the French equivalents for +% the LaTeX caption names. +% +% \begin{macro}{\captionsfrench} +% Let’s first define |\captionsfrench| which sets all strings used +% in the four standard document classes provided with LaTeX. +% +% \changes{v2.0}{2006/11/06}{`Fig.’ changed to `Figure’ and +% `Tab.’ to `Table’.} +% +% \changes{v2.5a}{2010/08/16}{\cs{emph} deleted in \cs{seename} +% and \cs{alsoname} to match what is done for the other languages. +% Suggested by Marc Baudoin.} +% +% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString} +% commands for captionnames.} +% +% \changes{v3.1b}{2014/09/15}{Change \cs{scshape} to customisable +% \cs{FBfigtabshape} for \cs{figurename} and \cs{tablename}.} +% +% \changes{v3.1g}{2015/05/10}{\cs{partname}’s definition depends now on +% flag PartNameFull. No need to redefine it in \cs{frenchbsetup}.} +% +% \changes{v3.3a}{2017/04/30}{Commands \cs{frenchpartfirst}, +% \cs{frenchpartsecond} and \cs{frenchpartnameord} added.} +% +% Let’s give a chance to a class or a package read before \frenchb{} +% to define |\FBfigtabshape| as |\relax|, otherwise |\FBfigtabshape| +% will be defined as |\scshape| (can be changed with +% \fbsetup{SmallCapsFigTabCaptions=false}). +% \begin{macrocode} +\providecommand*{\FBfigtabshape}{\scshape} +% \end{macrocode} +% +% New implementation for caption names( requires \babel’s~3.10 or +% newer). +% \begin{macrocode} +\StartBabelCommands*{\BabelLanguages}{captions} + [unicode, fontenc=TU EU1 EU2, charset=utf8] + \SetString{\refname}{Références} + \SetString{\abstractname}{Résumé} + \SetString{\prefacename}{Préface} + \SetString{\contentsname}{Table des matières} + \SetString{\ccname}{Copie à } + \SetString{\proofname}{Démonstration} + \SetString{\partfirst}{Première} + \SetString{\partsecond}{Deuxième} + \SetStringLoop{ordinal#1}{% + \frenchpartfirst,\frenchpartsecond,Troisième,Quatrième,% + Cinquième,Sixième,Septième,Huitième,Neuvième,Dixième,Onzième,% + Douzième,Treizième,Quatorzième,Quinzième,Seizième,% + Dix-septième,Dix-huitième,Dix-neuvième,Vingtième} +\StartBabelCommands*{\BabelLanguages}{captions} + \SetString{\refname}{R\'ef\'erences} + \SetString{\abstractname}{R\'esum\'e} + \SetString{\bibname}{Bibliographie} + \SetString{\prefacename}{Pr\'eface} + \SetString{\chaptername}{Chapitre} + \SetString{\appendixname}{Annexe} + \SetString{\contentsname}{Table des mati\`eres} + \SetString{\listfigurename}{Table des figures} + \SetString{\listtablename}{Liste des tableaux} + \SetString{\indexname}{Index} + \SetString{\figurename}{{\FBfigtabshape Figure}} + \SetString{\tablename}{{\FBfigtabshape Table}} + \SetString{\pagename}{page} + \SetString{\seename}{voir} + \SetString{\alsoname}{voir aussi} + \SetString{\enclname}{P.~J. } + \SetString{\ccname}{Copie \`a } + \SetString{\headtoname}{} + \SetString{\proofname}{D\'emonstration} + \SetString{\glossaryname}{Glossaire} +% \end{macrocode} +% When \fbo{PartNameFull=true} (default), |\part{}| is printed in +% French as ``Première partie’’ instead of ``Partie I’’. +% As logic is prohibited inside |\SetString|, let’s hide the test +% about \fbo{PartNameFull} in |\FB@partname|. +% \begin{macrocode} + \SetString{\partfirst}{Premi\`ere} + \SetString{\partsecond}{Deuxi\`eme} + \SetString{\partnameord}{partie} + \SetStringLoop{ordinal#1}{% + \partfirst,\partsecond,Troisi\`eme,Quatri\`eme,% + Cinqui\`eme,Sixi\`eme,Septi\`eme,Huiti\`eme,Neuvi\`eme,Dixi\`eme,% + Onzi\`eme,Douzi\`eme,Treizi\`eme,Quatorzi\`eme,Quinzi\`eme,% + Seizi\`eme,Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,% + Vingti\`eme} + \AfterBabelCommands{% + \DeclareRobustCommand*{\FB@emptypart}{\def\thepart{}}% + \DeclareRobustCommand*{\FB@partname}{% + \ifFBPartNameFull + \csname ordinal\romannumeral\value{part}\endcsname\space + \partnameord\FB@emptypart + \else + Partie% + \fi}% + } + \SetString{\partname}{\FB@partname} +\EndBabelCommands +% \end{macrocode} +% \end{macro} +% +% \changes{v3.0a}{2014/02/28}{Merging of \cs{captionsfrenchb}, +% \cs{captionsfrancais} with \cs{captionsfrench} deleted in favor +% of new babel 3.9 syntax.} +% +% \subsection{Figure and table captions} +% \label{ssec-captions-fig} +% +% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to +% \cs{FBWarning} (in case \cs{@makecaption} has been customised). +% \cs{FBWarning} is defined as \cs{PackageWarning} by default but +% can be made silent using \cs{frenchbsetup}, (suggested by MPG).} +% +% \begin{macro}{\FBWarning} +% |\FBWarning| is an alias of |\PackageWarning{french.ldf}| which +% can be made silent by option \fbo{SuppressWarning}. +% \begin{macrocode} +\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CaptionSeparator} +% Let’s consider now captions in figures and tables. +% In French, captions in figures and tables should never be printed +% as `Figure 1:~’ which is the default in standard LaTeX2e classes +% (a space should preceed the colon in French). This flaw may occur +% with pdfLaTeX as `:’ is made active too late. +% With LuaLaTeX and XeLaTeX, this glitch doesn’t occur, you get +% `Figure 1~:~’ which is correct in French. With pdfLaTeX \frenchb{} +% provides the following workaround. +% +% The standard definition of |\@makecaption| (e.g., the one provided +% in article.cls, report.cls, book.cls which is frozen for LaTeX2e +% according to Frank Mittelbach), is saved in |\STD@makecaption|. +% `AtBeginDocument’ we compare it to its current definition (some +% classes like \cls{memoir}, koma-script classes, AMS classes, +% ua-thesis.cls\dots change it). +% If they are identical, \frenchb{} just adds a hook called +% |\FBCaption@Separator| to |\@makecaption|; |\FBCaption@Separator| +% defaults to `:~’ as in the standard |\@makecaption| and will be +% changed to `~:~’ in French `AtBeginDocument’; it can be also set to +% |\CaptionSeparator| (` -- ’) using \fbo{CustomiseFigTabCaptions}. +% +% \changes{v2.6c}{2013/05/18}{Former \cs{CaptionSeparator} +% has been renamed as \cs{FBCaption@Separator}; +% Newif \cs{if@FBwarning@capsep} added.} +% +% \changes{v2.6h}{2014/01/03}{No active catcodes in +% \cs{STD@makecaption}’s definition.} +% +% \changes{v3.0a}{2014/02/28}{Remove \cs{FBCaption@SeparatorORI}, use +% \cs{babel@save} instead.} +% +% While saving the standard definition of |\@makecaption| we have to +% make sure that characters `:’ and `|>|’ have |\catcode| 12 +% (\frenchb{} makes `:’ active and \file{spanish.ldf} makes `|>|’ +% active). +% \begin{macrocode} +\bgroup + \catcode`:=12 \catcode`>=12 \relax + \long\gdef\STD@makecaption#1#2{% + \vskip\abovecaptionskip + \sbox\@tempboxa{#1: #2}% + \ifdim \wd\@tempboxa >\hsize + #1: #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} +\egroup +% \end{macrocode} +% +% No warning is issued for SMF, AMS and ACM classes as their layout +% of captions is compatible with French typographic standards. +% +% With \cls{memoir} and koma-script classes, \frenchb{} customises +% |\captiondelim| or |\captionformat| in French (unless option +% \fbo{CustomiseFigTabCaptions} is set to \fbo{false}) and issues +% no warning. +% +% When |\@makecaption| has been changed by another class +% or package, a warning is printed in the .log file. +% +% Enable the standard warning only if high punctuation is active. +% \begin{macrocode} +\newif\if@FBwarning@capsep +\ifFB@active@punct\@FBwarning@capseptrue\fi +\newcommand*{\CaptionSeparator}{\space\textendash\space} +\def\FBCaption@Separator{: } +\long\def\FB@makecaption#1#2{% + \vskip\abovecaptionskip + \sbox\@tempboxa{#1\FBCaption@Separator #2}% + \ifdim \wd\@tempboxa >\hsize + #1\FBCaption@Separator #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} +% \end{macrocode} +% \end{macro} +% +% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for +% AMS classes.} +% +% \changes{v3.0a}{2014/02/20}{No warning about \cs{@makecaption} for +% SMF classes.} +% +% Disable the standard warning with ACM, AMS and SMF classes. +% \begin{macrocode} +\@ifclassloaded{acmart}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{amsart}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{amsbook}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{amsdtx}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{amsldoc}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{amproc}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{smfart}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{smfbook}{\@FBwarning@capsepfalse}{} +% \end{macrocode} +% +% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for +% koma-script classes. \cs{captionformat} customised in French.} +% +% \changes{v2.6h}{2014/01/05}{If \cs{@makecaption} is undefined, no +% warning.} +% +% No warning with \cls{memoir} or koma-script classes: they change +% |\@makecaption| but we will manage to customise them in French +% later on (see below after executing |\FBprocess@options|) +% \hlabel{ifFB@koma}. +% \begin{macrocode} +\newif\ifFB@koma +\@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{} +\@ifclassloaded{scrartcl}{\@FBwarning@capsepfalse\FB@komatrue}{} +\@ifclassloaded{scrbook}{\@FBwarning@capsepfalse\FB@komatrue}{} +\@ifclassloaded{scrreprt}{\@FBwarning@capsepfalse\FB@komatrue}{} +% \end{macrocode} +% No warning with the \cls{beamer} class which defines +% |\beamer@makecaption| (customised below) instead of +% |\@makecaption|. No warning either if |\@makecaption| is +% undefined (i.e.\ \cls{letter}). +% \begin{macrocode} +\@ifclassloaded{beamer}{\@FBwarning@capsepfalse}{} +\ifdefined\@makecaption\else\@FBwarning@capsepfalse\fi +% \end{macrocode} +% +% \changes{v2.6c}{2013/05/18}{Warning added when the caption +% or floatrow package is loaded before babel/french.} +% +% \changes{v3.2b}{2016/03/30}{Warning added when the subcaption +% package is loaded before babel/french.} +% +% \changes{v3.3c}{2017/08/16}{Reorganise warnings when the caption, +% subcaption or floatrow packages are loaded before babel/french.} +% +% The \pkg{caption}, \pkg{subcaption} and \pkg{floatrow} packages are +% compatible with \frenchb{} if they are loaded after \babel{}. +% +% Check if packages \pkg{caption3} \pkg{subcaption} or \pkg{floatrow} +% are loaded now (before \frenchb) and step counter |FBcaption@count| +% accordingly; it’s value will be checked |\AtBeginDocument|. +% N.B.: \pkg{caption} loads \pkg{caption3}, \pkg{subcaption} loads +% \pkg{caption3} and \pkg{floatrow} loads \pkg{caption3}. +% \begin{macrocode} +\newcounter{FBcaption@count} +\@ifpackageloaded{caption3}{\addtocounter{FBcaption@count}{4}}{} +\@ifpackageloaded{subcaption}{\addtocounter{FBcaption@count}{2}}{} +\@ifpackageloaded{floatrow}{\stepcounter{FBcaption@count}}{} +% \end{macrocode} +% +% \changes{v3.0a}{2014/02/20}{More informative, less TeXnical warning +% about \cs{@makecaption}.} +% +% First check the definition of |\@makecaption|, change it or issue +% a warning in case it has been changed by a class or package not +% (yet) compatible with \frenchb; then change the definition of +% |\FBCaption@Separator|, taking care that the colon is typeset +% correctly in French (\emph{not} `Figure~1: légende’). +% +% \changes{v3.1f}{2015/05/31}{\cs{FBCaption@Separator} changed when +% option CustomiseFigTabCaptions is set to false.} +% +% \begin{macrocode} +\AtBeginDocument{% + \ifx\@makecaption\STD@makecaption + \global\let\@makecaption\FB@makecaption +% \end{macrocode} +% If \fbo{OldFigTabCaptions=true}, do not overwrite +% |\FBCaption@Separator| (already saved as `: ’ for other languages +% and set to |\CaptionSeparator| by |\extrasfrench| when French is +% the main language); otherwise add a space before the `:’ in French +% in order to avoid problems when \fbo{AutoSpacePunctuation=false}. +% \begin{macrocode} + \ifFBOldFigTabCaptions + \else + \def\FBCaption@Separator{\ifFBfrench\space\fi : }% + \fi + \ifFBCustomiseFigTabCaptions + \ifFB@mainlanguage@FR + \def\FBCaption@Separator{\CaptionSeparator}% + \fi + \fi + \@FBwarning@capsepfalse + \fi +% \end{macrocode} +% Cancel the warning if \file{caption3.sty} has been loaded +% \emph{after} \babel. +% \begin{macrocode} + \@ifpackageloaded{caption3}{% + \ifnum\value{FBcaption@count}=0 \@FBwarning@capsepfalse\fi + }{}% + \if@FBwarning@capsep + \ifnum\value{FBcaption@count}>0 +% \end{macrocode} +% \file{caption3.sty} has been loaded \emph{before} babel, maybe by +% the class\dots +% \begin{macrocode} + \FBWarning + {Figures' and tables' captions might look like\MessageBreak + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If you have loaded any of the packages caption,\MessageBreak + subcaption or floatrow BEFORE babel/french,\MessageBreak + please move them AFTER babel/french.\MessageBreak + If one of them is loaded by your class,\MessageBreak + you can still add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + ... live with it; reported}% + \else +% \end{macrocode} +% \file{caption3.sty} hasn’t been loaded at all. +% \begin{macrocode} + \FBWarning + {Figures' and tables' captions might look like\MessageBreak + `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak + If it happens, see your class documentation to\MessageBreak + fix this issue or add AFTER babel/french\MessageBreak + \protect\usepackage[labelsep=period]{caption} or\MessageBreak + \protect\usepackage[labelsep=endash]{caption} or\MessageBreak + or ... live with it; reported}% + \fi + \fi + \let\FB@makecaption\relax + \let\STD@makecaption\relax +} +% \end{macrocode} +% +% \subsection{Dots\dots} +% \label{ssec-dots} +% +% \begin{macro}{\FBtextellipsis} +% LaTeX’s standard definition of |\dots| in text-mode is +% |\textellipsis| which includes a |\kern| at the end; +% this space is not wanted in some cases (before a closing brace +% for instance) and |\kern| breaks hyphenation of the next word. +% We define |\FBtextellipsis| for French (in LaTeX only). +% +% The |\if| construction in the LaTeX definition of |\dots| +% doesn’t allow the use of |xspace| (|xspace| is always followed +% by a |\fi|), so we use the AMS-LaTeX construction of |\dots|; +% this has to be done `AtBeginDocument’ not to be overwritten +% when \file{amsmath.sty} is loaded after \babel. +% +% \changes{v2.0}{2006/11/06}{Added special case for LY1 encoding, +% see bug report from Bruno Voisin (2004/05/18).} +% +% \changes{v2.5f}{2011/06/18}{Unicode fonts also provide a ready made +% character for \cs{textellipsis}, let’s just use it! +% (reported by Maxime Chupin, 2011/06/04).} +% +% LY1 has a ready made character for |\textellipsis|, it should be +% used in French too. The same is true for Unicode fonts in use +% with XeTeX and LuaTeX. +% +% \begin{macrocode} +\ifFBunicode + \let\FBtextellipsis\textellipsis +\else + \DeclareTextSymbol{\FBtextellipsis}{LY1}{133} + \DeclareTextCommandDefault{\FBtextellipsis}{% + .\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace} +\fi +% \end{macrocode} +% |\Mdots@| and |\Tdots@| hold the definitions of |\dots| in +% Math and Text mode. They default to those of amsmath-2.0, and +% will revert to standard LaTeX definitions `AtBeginDocument’, +% if amsmath has not been loaded. |\Mdots@| doesn’t change when +% switching from/to French, while |\Tdots@| is redefined as +% |\FBtextellipsis| in French. +% \begin{macrocode} +\newcommand*{\Tdots@}{\@xp\textellipsis} +\newcommand*{\Mdots@}{\@xp\mdots@} +\AtBeginDocument{\DeclareRobustCommand*{\dots}{\relax + \csname\ifmmode M\else T\fi dots@\endcsname}% + \ifdefined\@xp\else\let\@xp\relax\fi + \ifdefined\mdots@\else\let\Mdots@\mathellipsis\fi + } +\def\bbl@frenchdots{\babel@save\Tdots@ \let\Tdots@\FBtextellipsis} +\addto\extrasfrench{\bbl@frenchdots} +% \end{macrocode} +% \end{macro} +% +% \subsection{More checks about packages’ loading order} +% \label{ssec-loading-order} +% +% \changes{v3.1d}{2015/04/06}{New section: issue warnings if packages +% listings, numprint and natbib are loaded too early or too late +% vs babel.} +% +% \changes{v3.1i}{2015/10/03}{Remove restriction about loading +% numprint.sty after babel.} +% +% Like packages \file{captions} and \file{floatrow} (see +% section~\ref{ssec-captions-fig}), package \file{listings} should +% be loaded after \frenchb{} due to active characters issues +% (pdfLaTeX only). +% +% \begin{macrocode} +\ifFB@active@punct + \@ifpackageloaded{listings} + {\AtBeginDocument{% + \FBWarning{Please load the "listings" package\MessageBreak + AFTER babel/french; reported}}% + }{} +\fi +% \end{macrocode} +% +% Package \file{natbib} should be loaded before \frenchb{} +% due to active characters issues (pdfLaTeX only). +% +% \begin{macrocode} +\newif\if@FBwarning@natbib +\ifFB@active@punct + \@ifpackageloaded{natbib}{}{\@FBwarning@natbibtrue} +\fi +\AtBeginDocument{% + \if@FBwarning@natbib + \@ifpackageloaded{natbib}{}{\@FBwarning@natbibfalse}% + \fi + \if@FBwarning@natbib + \FBWarning{Please load the "natbib" package\MessageBreak + BEFORE babel/french; reported}% + \fi +} +% \end{macrocode} +% +% \changes{v3.2g}{2017/01/30}{Issue a warning if beamerarticle.sty +% is loaded after babel.} +% +% Package \pkg{beamerarticle} should be loaded before \frenchb{} +% to avoid list’s conflicts, see p.~\pageref{beamerarticle}. +% +% \begin{macrocode} +\newif\if@FBwarning@beamerarticle +\@ifpackageloaded{beamerarticle}{}{\@FBwarning@beamerarticletrue} +\AtBeginDocument{% + \if@FBwarning@beamerarticle + \@ifpackageloaded{beamerarticle}{}% + {\@FBwarning@beamerarticlefalse}% + \fi + \if@FBwarning@beamerarticle + \FBWarning{Please load the "beamerarticle" package\MessageBreak + BEFORE babel/french; reported}% + \fi +} +% \end{macrocode} +% +% \subsection{Setup options: keyval stuff} +% \label{ssec-keyval} +% +% \changes{v2.0}{2006/11/06}{New command \cs{frenchbsetup} added +% for global customisation.} +% +% \changes{v3.0a}{2014/02/24}{Options processing completely +% reorganised, now \cs{babel@save} and\cs{babel@savevariable} are +% usable for French.} +% +% All setup options are handled by command \fbsetup{} using the +% keyval syntax. A list of flags is defined and set to a default +% value which will possibly be changed `AtEndOfPackage’ if French is +% the main language. After this, \fbsetup{} eventually modifies the +% preset values of these flags. +% +% Option processing can occur either in \fbsetup{}, but \emph{only +% for options explicitly set} by \fbsetup{}, or `AtBeginDocument’; +% any option affecting |\extrasfrench{}| \emph{must} be processed by +% \fbsetup{}: when French is the main language, |\extrasfrench{}| is +% executed by \babel{} when it switches the main language and this +% occurs \emph{before} reading the stuff postponed by \frenchb{} +% `AtBeginDocument’. Reexecuting |\extrasfrench{}| is an option +% which was used up to v2.6h, it has been dropped in v3.0a because +% of its side-effects (f.i.\ |\babel@save| and |\babel@savevariable| +% did not work for French). +% +% \begin{macro}{\frenchsetup} +% Let’s now define this command which reads and sets the options +% to be processed either immediately (i.e.\ just after setting the +% key) or later (at |\begin{document}|) by |\FBprocess@options|. +% \fbsetup{} can only be called in the preamble. +% +% \changes{v2.0c}{2007/06/25}{Option ThinSpaceInFrenchNumbers added.} +% +% \changes{v2.0d}{2007/07/15}{Options og and fg changed: limit +% the definition to French so that quote characters can be used +% in German.} +% +% \changes{v2.0e}{2007/10/05}{New option: StandardLists.} +% +% \changes{v2.0f}{2008/03/23}{Two typos corrected in +% option StandardLists.} +% +% \changes{v2.0f}{2008/03/23}{StandardLayout option had no +% effect on lists. Test moved to \cs{FBprocess@options}.} +% +% \changes{v2.0g}{2008/03/23}{Revert previous change to +% StandardLayout. This option must set the three flags +% \cs{FBReduceListSpacingfalse}, \cs{FBCompactItemizefalse}, +% and \cs{FBStandardItemLabeltrue} instead of +% \cs{FBStandardListstrue}, so that later options can still +% change their value before executing \cs{FBprocess@options}. +% Same thing for option StandardLists.} +% +% \changes{v2.1a}{2008/03/24}{New option: FrenchSuperscripts +% to define \cs{up} as \cs{fup} or as \cs{textsuperscript}.} +% +% \changes{v2.1a}{2008/03/30}{New option: LowercaseSuperscripts.} +% +% \changes{v2.2a}{2008/05/08}{The global layout of the document is +% no longer changed when frenchb is not the last option of babel +% (\cs{bbl@main@language}). Suggested by Ulrike Fischer.} +% +% \changes{v2.2a}{2008/05/08}{Default values of flags changed: +% default now means `StandardLayout’, they will be changed to +% `FrenchLayout’ AtEndOfPackage only if french is +% \cs{bbl@main@language}.} +% +% \changes{v2.2a}{2008/05/08}{When frenchb is babel’s last option, +% French becomes the document’s main language, so +% GlobalLayoutFrench applies.} +% +% \changes{v2.4a}{2009/11/23}{New option SuppressWarning.} +% +% \changes{v2.6a}{2013/01/30}{New options ListOldLayout, +% StandardItemizeEnv and StandardEnumerateEnv (CompactItemize is +% deprecated).} +% +% \changes{v3.0a}{2014/02/28}{New options OldFigTabCaptions and +% CustomiseFigTabCaptions.} +% +% \changes{v3.0c}{2014/04/18}{New option INGuillSpace.} +% +% \changes{v3.1a}{2014/05/20}{New options InnerGuillSingle, +% EveryParGuill and EveryLineGuill to control \cs{frquote}.} +% +% \changes{v3.1b}{2014/09/15}{New option SmallCapsFigTabCaptions.} +% +% \changes{v3.1e}{2015/04/10}{Corrected typo: SmallCapsFigTabcaptions +% instead of SmallCapsFigTabCaptions. Pointed out by Céline +% Chevalier.} +% +% \changes{v3.1g}{2015/05/10}{PartNameFull now just sets the flag, +% nothing to add to \cs{captionsfrench} when false.} +% +% \changes{v3.3a}{2017/04/30}{\cs{frenchbsetup} is now an alias for +% \cs{frenchsetup}.} +% +% \changes{v3.3a}{2017/04/30}{Options INGuillSpace, ThinColonSpace no +% longer delayed AtBeginDocument.} +% +% \changes{v3.5a}{2018/07/04}{New option ListItemsAsPar for displaying +% lists’ items ``as paragraphs’’.} +% +% \changes{v3.5d}{2019/01/24}{ReduceListSpacing option depreciated: see +% StandardListSpacing.} +% +% \begin{macrocode} +\newcommand*{\frenchsetup}[1]{% + \setkeys{FB}{#1}% +}% +\@onlypreamble\frenchsetup +% \end{macrocode} +% Keep the former name |\frenchbsetup| working for compatibility. +% \begin{macrocode} +\let\frenchbsetup\frenchsetup +\@onlypreamble\frenchbsetup +% \end{macrocode} +% +% We define a collection of conditionals with their defaults +% (true or false). +% +% \begin{macrocode} +\newif\ifFBShowOptions +\newif\ifFBStandardLayout \FBStandardLayouttrue +\newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue +\newif\ifFBReduceListSpacing +\newif\ifFBStandardListSpacing \FBStandardListSpacingtrue +\newif\ifFBListOldLayout +\newif\ifFBListItemsAsPar +\newif\ifFBCompactItemize +\newif\ifFBStandardItemizeEnv \FBStandardItemizeEnvtrue +\newif\ifFBStandardEnumerateEnv \FBStandardEnumerateEnvtrue +\newif\ifFBStandardItemLabels \FBStandardItemLabelstrue +\newif\ifFBStandardLists \FBStandardListstrue +\newif\ifFBIndentFirst +\newif\ifFBFrenchFootnotes +\newif\ifFBAutoSpaceFootnotes +\newif\ifFBOriginalTypewriter +\newif\ifFBThinColonSpace +\newif\ifFBThinSpaceInFrenchNumbers +\newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue +\newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue +\newif\ifFBPartNameFull \FBPartNameFulltrue +\newif\ifFBCustomiseFigTabCaptions +\newif\ifFBOldFigTabCaptions +\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue +\newif\ifFBSuppressWarning +\newif\ifFBINGuillSpace +% \end{macrocode} +% +% The defaults values of these flags have been choosen so that +% \frenchb{} does not change anything regarding the global layout. +% |\bbl@main@language|, set by the last option of \babel, controls +% the global layout of the document. `AtEndOfPackage’ we check the +% main language in |\bbl@main@language|; if it is French (or a +% French dialect) the values of some flags have to be changed to +% ensure a French looking layout for the whole document (even in +% parts written in languages other than French); the end-user will +% then be able to customise the values of all these flags with +% \fbsetup{}. +% +% \changes{v2.5b}{2010/10/30}{Do not use the +% test \cs{iflanguage}\{french\} to check whether French is the +% main language or not, as it might be be erroneously positive +% when English is the main language and no hyphenation patterns +% are available for French. +% In this case \cs{l@french} and \cs{l@english} are 0. +% Pointed out by Günter Milde.} +% +% \changes{v3.1g}{2015/05/10}{Bug fix for koma-scripts classes: +% a spurious dot was added by the \cs{partformat} command.} +% +% \changes{v3.4a}{2018/01/07}{Patch for koma-script classes moved here, +% after \cs{ifFBPartNameFull} is defined, so that it applies to +% \cs{extrasacadian} too: \cs{AtEndOfPackage} is too late.} +% +% The following patch is for koma-script classes: the |\partformat| +% command, defined as |\partname~\thepart\autodot|, is incompatible +% with our redefinition of |\partname|. +% \begin{macrocode} +\ifFB@koma + \ifdefined\partformat + \def\FB@partformat@fix{% + \ifFBPartNameFull + \babel@save\partformat + \renewcommand*{\partformat}{\partname}% + \fi} + \addto\extrasfrench{\FB@partformat@fix}% + \fi +\fi +% \end{macrocode} +% +% \changes{v3.0c}{2014/03/30}{No list customisation when beamer +% class is loaded.} +% +% \changes{v3.2g}{2017/01/30}{Minimal list customisation when +% beamerarticle.sty is loaded.} +% +% \changes{v3.2h}{2017/04/11}{Option GlobalLayoutFrench skipped +% when French is not the main language.} +% +% \changes{v3.5e}{2019/03/14}{StandardLayout and GlobalLayoutFrench +% options can no longer be toggled when French is not the main +% language.} +% +% Our list customisation conflicts with the \cls{beamer} class and +% with the \pkg{beamerarticle} package. The patch provided in +% \pkg{beamerbasecompatibility} solves the conflict except in case +% of language changes, so we provide our own patch. +% When the \cls{beamer} is loaded, lists are not customised at all +% to ensure compatibility.\hlabel{beamerarticle} +% The \pkg{beamerarticle} package needs to be loaded \emph{before} +% \babel, a warning is issued otherwise, see +% section~\ref{ssec-loading-order}; a light customisation is +% compatible with the \pkg{beamerarticle} package. +% +% \begin{macrocode} +\def\FB@french{french} +\def\FB@acadian{acadian} +\newif\ifFB@mainlanguage@FR +\AtEndOfPackage{% + \ifx\bbl@main@language\FB@french \FB@mainlanguage@FRtrue + \else \ifx\bbl@main@language\FB@acadian \FB@mainlanguage@FRtrue \fi + \fi + \ifFB@mainlanguage@FR + \FBGlobalLayoutFrenchtrue + \@ifclassloaded{beamer}% + {\PackageInfo{french.ldf}{% + No list customisation for the beamer class,% + \MessageBreak reported}}% + {\@ifpackageloaded{beamerarticle}% + {\FBStandardItemLabelsfalse + \FBStandardListSpacingfalse + \PackageInfo{french.ldf}{% + Minimal list customisation for the beamerarticle% + \MessageBreak package; reported}}% +% \end{macrocode} +% Otherwise customise lists ``à la française’’: +% \begin{macrocode} + {\FBStandardListSpacingfalse + \FBStandardItemizeEnvfalse + \FBStandardEnumerateEnvfalse + \FBStandardItemLabelsfalse}% + } + \FBIndentFirsttrue + \FBFrenchFootnotestrue + \FBAutoSpaceFootnotestrue + \FBCustomiseFigTabCaptionstrue + \else + \FBGlobalLayoutFrenchfalse + \fi +% \end{macrocode} +% \frenchb{} being an option of \babel, it cannot load a package +% (\pkg{keyval}) while \file{french.ldf} is read, so we defer the +% loading of \file{keyval} and the options setup at the end of +% \babel’s loading. +% \begin{macrocode} + \RequirePackage{keyval}% + \define@key{FB}{ShowOptions}[true]% + {\csname FBShowOptions#1\endcsname}% +% \end{macrocode} +% The next two keys can only be toggled when French is the main +% language. +% \begin{macrocode} + \define@key{FB}{StandardLayout}[true]% + {\ifFB@mainlanguage@FR + \csname FBStandardLayout#1\endcsname + \else + \PackageWarning{french.ldf}% + {Option `StandardlLayout' skipped:\MessageBreak + French is *not* babel's last option.\MessageBreak + Reported}% + \fi + \ifFBStandardLayout + \FBStandardListSpacingtrue + \FBStandardItemizeEnvtrue + \FBStandardItemLabelstrue + \FBStandardEnumerateEnvtrue + \FBIndentFirstfalse + \FBFrenchFootnotesfalse + \FBAutoSpaceFootnotesfalse + \FBGlobalLayoutFrenchfalse + \else + \FBStandardListSpacingfalse + \FBStandardItemizeEnvfalse + \FBStandardItemLabelsfalse + \FBStandardEnumerateEnvfalse + \FBIndentFirsttrue + \FBFrenchFootnotestrue + \FBAutoSpaceFootnotestrue + \fi}% + \define@key{FB}{GlobalLayoutFrench}[true]% + {\ifFB@mainlanguage@FR + \csname FBGlobalLayoutFrench#1\endcsname + \else + \PackageWarning{french.ldf}% + {Option `GlobalLayoutFrench' skipped:\MessageBreak + French is *not* babel's last option.\MessageBreak + Reported}% + \fi}% +% \end{macrocode} +% If this key is set to \fbo{true} when French is the main language, +% nothing to do: all flags keep their default value. +% If this key is set to \fbo{false}, nothing to do either: +% |\babel@save| will do the job. +% \begin{macrocode} + \define@key{FB}{ReduceListSpacing}[true]% + {\csname FBReduceListSpacing#1\endcsname + \ifFBReduceListSpacing \FBStandardListSpacingfalse + \else \FBStandardListSpacingtrue\fi + }% + \define@key{FB}{StandardListSpacing}[true]% + {\csname FBStandardListSpacing#1\endcsname}% + \define@key{FB}{ListOldLayout}[true]% + {\csname FBListOldLayout#1\endcsname + \ifFBListOldLayout + \FBStandardEnumerateEnvtrue + \renewcommand*{\FrenchLabelItem}{\textendash}% + \fi}% + \define@key{FB}{CompactItemize}[true]% + {\csname FBCompactItemize#1\endcsname + \ifFBCompactItemize + \FBStandardItemizeEnvfalse + \FBStandardEnumerateEnvfalse + \else + \FBStandardItemizeEnvtrue + \FBStandardEnumerateEnvtrue + \fi}% + \define@key{FB}{StandardItemizeEnv}[true]% + {\csname FBStandardItemizeEnv#1\endcsname}% + \define@key{FB}{StandardEnumerateEnv}[true]% + {\csname FBStandardEnumerateEnv#1\endcsname}% + \define@key{FB}{StandardItemLabels}[true]% + {\csname FBStandardItemLabels#1\endcsname}% + \define@key{FB}{ItemLabels}% + {\renewcommand*{\FrenchLabelItem}{#1}}% + \define@key{FB}{ItemLabeli}% + {\renewcommand*{\Frlabelitemi}{#1}}% + \define@key{FB}{ItemLabelii}% + {\renewcommand*{\Frlabelitemii}{#1}}% + \define@key{FB}{ItemLabeliii}% + {\renewcommand*{\Frlabelitemiii}{#1}}% + \define@key{FB}{ItemLabeliv}% + {\renewcommand*{\Frlabelitemiv}{#1}}% + \define@key{FB}{StandardLists}[true]% + {\csname FBStandardLists#1\endcsname + \ifFBStandardLists + \FBStandardListSpacingtrue + \FBStandardItemizeEnvtrue + \FBStandardEnumerateEnvtrue + \FBStandardItemLabelstrue + \else + \FBStandardListSpacingfalse + \FBStandardItemizeEnvfalse + \FBStandardEnumerateEnvfalse + \FBStandardItemLabelsfalse + \fi}% + \define@key{FB}{ListItemsAsPar}[true]% + {\csname FBListItemsAsPar#1\endcsname} + \define@key{FB}{IndentFirst}[true]% + {\csname FBIndentFirst#1\endcsname}% + \define@key{FB}{FrenchFootnotes}[true]% + {\csname FBFrenchFootnotes#1\endcsname}% + \define@key{FB}{AutoSpaceFootnotes}[true]% + {\csname FBAutoSpaceFootnotes#1\endcsname}% + \define@key{FB}{AutoSpacePunctuation}[true]% + {\csname FBAutoSpacePunctuation#1\endcsname}% + \define@key{FB}{OriginalTypewriter}[true]% + {\csname FBOriginalTypewriter#1\endcsname}% + \define@key{FB}{ThinColonSpace}[true]% + {\csname FBThinColonSpace#1\endcsname + \ifFBThinColonSpace + \renewcommand*{\FBcolonspace}{\FBthinspace}% + \fi}% + \define@key{FB}{ThinSpaceInFrenchNumbers}[true]% + {\csname FBThinSpaceInFrenchNumbers#1\endcsname}% + \define@key{FB}{FrenchSuperscripts}[true]% + {\csname FBFrenchSuperscripts#1\endcsname} + \define@key{FB}{LowercaseSuperscripts}[true]% + {\csname FBLowercaseSuperscripts#1\endcsname} + \define@key{FB}{PartNameFull}[true]% + {\csname FBPartNameFull#1\endcsname}% + \define@key{FB}{CustomiseFigTabCaptions}[true]% + {\csname FBCustomiseFigTabCaptions#1\endcsname}% + \define@key{FB}{OldFigTabCaptions}[true]% + {\csname FBOldFigTabCaptions#1\endcsname + \ifFBOldFigTabCaptions + \def\FB@capsep@fix{\babel@save\FBCaption@Separator + \def\FBCaption@Separator{\CaptionSeparator}}% + \addto\extrasfrench{\FB@capsep@fix}% + \ifdefined\extrasacadian + \addto\extrasacadian{\FB@capsep@fix}% + \fi + \fi}% + \define@key{FB}{SmallCapsFigTabCaptions}[true]% + {\csname FBSmallCapsFigTabCaptions#1\endcsname + \ifFBSmallCapsFigTabCaptions + \let\FBfigtabshape\scshape + \else + \let\FBfigtabshape\relax + \fi}% + \define@key{FB}{SuppressWarning}[true]% + {\csname FBSuppressWarning#1\endcsname + \ifFBSuppressWarning + \renewcommand{\FBWarning}[1]{}% + \fi}% +% \end{macrocode} +% Here are the options controlling French guillemets spacing +% and the output of |\frquote{}|. +% +% \changes{v3.2g}{2017/01/30}{Warn when wrong values are provided to +% options EveryParGuill or EveryLineGuill.} +% +% \begin{macrocode} + \define@key{FB}{INGuillSpace}[true]% + {\csname FBINGuillSpace#1\endcsname + \ifFBINGuillSpace + \renewcommand*{\FBguillspace}{\space}% + \fi}% + \define@key{FB}{InnerGuillSingle}[true]% + {\csname FBInnerGuillSingle#1\endcsname}% + \define@key{FB}{EveryParGuill}[open]% + {\expandafter\let\expandafter + \FBeveryparguill\csname FBguill#1\endcsname + \ifx\FBeveryparguill\FBguillopen + \else\ifx\FBeveryparguill\FBguillclose + \else\ifx\FBeveryparguill\FBguillnone + \else + \let\FBeveryparguill\FBguillopen + \FBWarning{Wrong value for `EveryParGuill': + try `open',\MessageBreak + `close' or `none'. Reported}% + \fi + \fi + \fi}% + \define@key{FB}{EveryLineGuill}[open]% + {\ifFB@luatex@punct + \expandafter\let\expandafter + \FBeverylineguill\csname FBguill#1\endcsname + \ifx\FBeverylineguill\FBguillopen + \else\ifx\FBeverylineguill\FBguillclose + \else\ifx\FBeverylineguill\FBguillnone + \else + \let\FBeverylineguill\FBguillnone + \FBWarning{Wrong value for `EveryLineGuill': + try `open',\MessageBreak + `close' or `none'. Reported}% + \fi + \fi + \fi + \else + \FBWarning{Option `EveryLineGuill' skipped:% + \MessageBreak this option is for + LuaTeX *only*.\MessageBreak Reported}% + \fi}% +% \end{macrocode} +% +% \changes{v3.3c}{2017/07/23}{New option `UnicodeNoBreakSpaces’ for +% html translators (LuaLaTeX only).} +% +% Option \fbo{UnicodeNoBreakSpaces} (LuaLaTeX only) is meant for +% HTML translators: when true, all non-breaking spaces added by +% \frenchb{} are coded in the PDF file as Unicode characters, namely +% U+A0 or U+202F, instead of penalties and glues. +% \begin{macrocode} + \define@key{FB}{UnicodeNoBreakSpaces}[true]% + {\ifFB@luatex@punct + \csname FBucsNBSP#1\endcsname + \ifFBucsNBSP \FB@ucsNBSP=1 \fi + \else + \FBWarning{Option `UnicodeNoBreakSpaces' skipped:% + \MessageBreak this option is for + LuaTeX *only*.\MessageBreak Reported}% + \fi + }% +% \end{macrocode} +% Inputing French quotes as \emph{single characters} when they are +% available on the keyboard (through a compose key for instance) +% is more comfortable than typing |\og| and |\fg|. +% +% Life is simple here with modern LuaTeX or XeTeX engines: we just +% have to activate the |\FB@addGUILspace| attribute for LuaTeX or +% set |\XeTeXcharclass| of quotes to the proper value for XeTeX. +% +%\changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel +% automatic spaces inside French guillemets coded as characters +% (see \cs{frenchbsetup}).} +% +% \changes{v2.5g}{2011/12/31}{When \cs{ifFB@xetex@punct} is true, +% `og’ and `fg’ options now set XeTeXcharclasses of these characters +% to \cs{FB@guilo} and \cs{FB@guilf}. Otherwise French +% quotes behave as normal characters (their XeTeXcharclass is 0).} +% +% \changes{v2.6h}{2014/01/03}{\cs{FG@og} and \cs{FG@fg} changed: +% former clumsy code removed.} +% +% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French +% quotes in T1-encoding. Support for older versions of LuaTeX and +% XeTeX dropped.} +% +% \changes{v3.2c}{2016/05/03}{Add a warning about options og/fg for old +% XeTeX or LuaTeX engines requiring active characters.} +% +% \changes{v3.4d}{2018/04/11}{New test for deciding about utf8 encoding +% for keys og and fg (the former one fails with LaTeX 2018 release).} +% +% With pdfTeX (or old LuaTeX and XeTeX engines), quote characters +% are made active and expand to |\og\ignorespaces| and |{\fg}| +% respectively if the current language is French, and to +% |\guillemotleft| and |\guillemotright| otherwise (think of German +% quotes), this is done by |\FB@@og| and |\FB@@fg|; thus correct +% non-breaking spaces will be added automatically to French quotes. +% The quote characters typed in depend on the input encoding, +% it can be single-byte (latin1, latin9, applemac,\dots) or +% multi-bytes (utf-8, utf8x); the next command is meant for checking +% whether a character is single-byte (|\FB@second| is empty) or not. +% \begin{macrocode} + \def\FB@parse#1#2\endparse{\def\FB@second{#2}}% +% \end{macrocode} +% +% \begin{macrocode} + \define@key{FB}{og}% + {\ifFBunicode +% \end{macrocode} +% LuaTeX or XeTeX in use, first try modern LuaTeX: we just need +% to set LuaTeX’s attribute |\FB@addGUILspace| to 1, +% \begin{macrocode} + \ifFB@luatex@punct + \FB@addGUILspace=1 \relax + \fi +% \end{macrocode} +% then with XeTeX it is a bit more tricky: +% \begin{macrocode} + \ifFB@xetex@punct +% \end{macrocode} +% |\XeTeXinterchartokenstate| is defined, we just need to set +% |\XeTeXcharclass| to |\FB@guilo| for the French opening quote +% in T1 and Unicode encoding (see subsection~\ref{ssec-punct}). +% \begin{macrocode} + \XeTeXcharclass"13 = \FB@guilo + \XeTeXcharclass"AB = \FB@guilo + \XeTeXcharclass"A0 = \FB@guilnul + \XeTeXcharclass"202F = \FB@guilnul + \fi +% \end{macrocode} +% Issue a warning with older Unicode engines requiring active +% characters. +% \begin{macrocode} + \ifFB@active@punct + \FBWarning{Option og=« not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% + \fi + \else +% \end{macrocode} +% This is for conventional TeX engines: +% \begin{macrocode} + \newcommand*{\FB@@og}{% + \ifFBfrench + \ifFB@spacing\FB@og\ignorespaces + \else\guillemotleft + \fi + \else\guillemotleft\fi}% + \AtBeginDocument{% + \ifdefined\uc@dclc +% \end{macrocode} +% Package \pkg{inputenc} with utf8x (ucs) encoding loaded, +% use |\uc@dclc|: +% \begin{macrocode} + \uc@dclc{171}{default}{\FB@@og}% + \else +% \end{macrocode} +% if encoding is not utf8x, check if the argument of |og| +% is a single-byte character: +% \begin{macrocode} + \FB@parse#1\endparse + \ifx\FB@second\@empty +% \end{macrocode} +% This means 8-bit character encoding. +% Package \pkg{MULEenc} (from CJK) defines |\mule@def| +% to map characters to control sequences. +% \begin{macrocode} + \ifdefined\mule@def + \mule@def{11}{\FB@@og}% + \else + \ifdefined\DeclareInputText + \@tempcnta`#1\relax + \DeclareInputText{\the\@tempcnta}{\FB@@og}% + \else +% \end{macrocode} +% Package \pkg{inputenc} not loaded, no way\dots{} +% \begin{macrocode} + \FBWarning{Option `og' requires package + inputenc;\MessageBreak reported}% + \fi + \fi + \else +% \end{macrocode} +% This means multi-byte character encoding, we assume UTF-8 +% \begin{macrocode} + \DeclareUnicodeCharacter{00AB}{\FB@@og}% + \fi + \fi}% + \fi + }% +% \end{macrocode} +% +% Same code for the closing quote. +% \begin{macrocode} + \define@key{FB}{fg}% + {\ifFBunicode + \ifFB@luatex@punct + \FB@addGUILspace=1 \relax + \fi + \ifFB@xetex@punct + \XeTeXcharclass"14 = \FB@guilf + \XeTeXcharclass"BB = \FB@guilf + \XeTeXcharclass"A0 = \FB@guilnul + \XeTeXcharclass"202F = \FB@guilnul + \fi + \ifFB@active@punct + \FBWarning{Option fg=» not supported with this version + of\MessageBreak LuaTeX/XeTeX; reported}% + \fi + \else + \newcommand*{\FB@@fg}{% + \ifFBfrench + \ifFB@spacing\FB@fg + \else\guillemotright + \fi + \else\guillemotright\fi}% + \AtBeginDocument{% + \ifdefined\uc@dclc + \uc@dclc{187}{default}{\FB@@fg}% + \else + \FB@parse#1\endparse + \ifx\FB@second\@empty + \ifdefined\mule@def + \mule@def{27}{{\FB@@fg}}% + \else + \ifdefined\DeclareInputText + \@tempcnta`#1\relax + \DeclareInputText{\the\@tempcnta}{\FB@@fg}% + \else + \FBWarning{Option `fg' requires package + inputenc;\MessageBreak reported}% + \fi + \fi + \else + \DeclareUnicodeCharacter{00BB}{\FB@@fg}% + \fi + \fi}% + \fi + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\FBprocess@options} +% |\FBprocess@options| will be executed at |\begin{document}|: +% it first checks about packages loaded in the preamble (possibly +% after \babel) which customise lists: currently \pkg{enumitem}, +% \pkg{paralist} and \pkg{enumerate}; then it processes the options +% as set by \fbsetup{} or forced for compatibility with packages +% loaded in the preamble. +% +% When French is the main language, |\extrasfrench| and +% |\captionsfrench| \emph{have already been processed} by \babel{} +% at |\begin{document}| \emph{before} |\FBprocess@options|. +% \begin{macrocode} +\newcommand*{\FBprocess@options}{% +% \end{macrocode} +% Update flags if a package customising lists has been loaded, +% currently: \pkg{enumitem}, \pkg{paralist}, \pkg{enumerate}. +% \begin{macrocode} + \@ifpackageloaded{enumitem}{% + \ifFBStandardItemizeEnv + \else + \FBStandardItemizeEnvtrue + \PackageInfo{french.ldf}% + {Setting StandardItemizeEnv=true for\MessageBreak + compatibility with enumitem package,\MessageBreak + reported}% + \fi + \ifFBStandardEnumerateEnv + \else + \FBStandardEnumerateEnvtrue + \PackageInfo{french.ldf}% + {Setting StandardEnumerateEnv=true for\MessageBreak + compatibility with enumitem package,\MessageBreak + reported}% + \fi}{}% + \@ifpackageloaded{paralist}{% + \ifFBStandardItemizeEnv + \else + \FBStandardItemizeEnvtrue + \PackageInfo{french.ldf}% + {Setting StandardItemizeEnv=true for\MessageBreak + compatibility with paralist package,\MessageBreak + reported}% + \fi + \ifFBStandardEnumerateEnv + \else + \FBStandardEnumerateEnvtrue + \PackageInfo{french.ldf}% + {Setting StandardEnumerateEnv=true for\MessageBreak + compatibility with paralist package,\MessageBreak + reported}% + \fi}{}% + \@ifpackageloaded{enumerate}{% + \ifFBStandardEnumerateEnv + \else + \FBStandardEnumerateEnvtrue + \PackageInfo{french.ldf}% + {Setting StandardEnumerateEnv=true for\MessageBreak + compatibility with enumerate package,\MessageBreak + reported}% + \fi}{}% +% \end{macrocode} +% Reset |\FB@ufl|’s normal meaning and update lists’ settings +% now in case French is the main language: \hlabel{FB@ufl} +% \begin{macrocode} + \def\FB@ufl{\update@frenchlists} + \ifFB@mainlanguage@FR + \update@frenchlists + \fi +% \end{macrocode} +% The layout of footnotes is handled at the |\begin{document}| +% depending on the values of flags \fbo{FrenchFootnotes} +% and \fbo{AutoSpaceFootnotes} (see section~\ref{ssec-footnotes}), +% nothing has to be done here for footnotes. +% +% \fbo{AutoSpacePunctuation} adds a non-breaking space (in French +% only) before the four active characters (:;!?) even if none has +% been typed before them. +% \begin{macrocode} + \ifFBAutoSpacePunctuation + \autospace@beforeFDP + \else + \noautospace@beforeFDP + \fi +% \end{macrocode} +% When \fbo{OriginalTypewriter} is set to \fbo{false} (the default), +% |\ttfamily|, |\rmfamily| and |\sffamily| are redefined as +% |\ttfamilyFB|, |\rmfamilyFB| and |\sffamilyFB| respectively +% to prevent addition of automatic spaces before the four active +% characters in computer code. +% \begin{macrocode} + \ifFBOriginalTypewriter + \else + \let\ttfamilyORI\ttfamily + \let\rmfamilyORI\rmfamily + \let\sffamilyORI\sffamily + \let\ttfamily\ttfamilyFB + \let\rmfamily\rmfamilyFB + \let\sffamily\sffamilyFB + \fi +% \end{macrocode} +% +% When package \pkg{numprint} is loaded with option +% \opt{autolanguage}, \pkg{numprint}’s command |\npstylefrench| has +% to be redefined differently according to the value of flag +% \fbo{ThinSpaceInFrenchNumbers}. +% As |\npstylefrench| was undefined in old versions of +% \pkg{numprint}, we provide this command. +% \begin{macrocode} + \@ifpackageloaded{numprint}% + {\ifnprt@autolanguage + \providecommand*{\npstylefrench}{}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\,}% + \fi + \g@addto@macro\npstylefrench{\npthousandsep{\FBthousandsep}}% + \fi + }{}% +% \end{macrocode} +% \fbo{FrenchSuperscripts}: if \fbo{true} |\up=\fup|, else +% |\up=\textsuperscript|. Anyway |\up*=\FB@up@fake|. The star-form +% |\up*{}| is provided for fonts that lack some superior letters: +% Adobe Jenson Pro and Utopia Expert have no ``g superior’’ for +% instance. +% \begin{macrocode} + \ifFBFrenchSuperscripts + \DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}{\fup}}% + \else + \DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}% + {\textsuperscript}}% + \fi +% \end{macrocode} +% \fbo{LowercaseSuperscripts}: if \fbo{false} |\FB@lc| is redefined +% to do nothing. +% \begin{macrocode} + \ifFBLowercaseSuperscripts + \else + \renewcommand*{\FB@lc}[1]{##1}% + \fi +% \end{macrocode} +% +% \changes{v3.0a}{2014/02/20}{With koma-script and memoir class, +% customise \cs{captionformat} and \cs{captiondelim}.} +% +% \changes{v3.1f}{2015/05/31}{Definition of \cs{captionformat} and +% \cs{captiondelim} changed when option CustomiseFigTabCaptions +% is set to false.} +% +% \changes{v3.1f}{2015/05/31}{Bug fix for the beamer class: +% figure and table captions are now consistent with babel-french’s +% documentation. Pointed out by Denis Bitouzé.} +% +% Unless \fbo{CustomiseFigTabCaptions} has been set to \fbo{false}, +% use |\CaptionSeparator| for koma-script, \cls{memoir} and +% \cls{beamer} classes. +% \begin{macrocode} + \ifFBCustomiseFigTabCaptions + \ifFB@koma + \renewcommand*{\captionformat}{\CaptionSeparator}% + \fi + \@ifclassloaded{memoir}% + {\captiondelim{\CaptionSeparator}}{}% + \@ifclassloaded{beamer}% + {\defbeamertemplate{caption label separator}{FBcustom}{% + \CaptionSeparator}% + \setbeamertemplate{caption label separator}[FBcustom]}{}% + \else +% \end{macrocode} +% When \fbo{CustomiseFigTabCaptions} is \fbo{false}, have the colon +% behave properly in French: locally force |\autospace@beforeFDP| in +% case of \fbo{AutoSpacePunctuation=false}. +% \begin{macrocode} + \ifFB@koma + \renewcommand*{\captionformat}{{\autospace@beforeFDP : }}% + \fi + \@ifclassloaded{memoir}% + {\captiondelim{{\autospace@beforeFDP : }}% + }{}% + \@ifclassloaded{beamer}% + {\defbeamertemplate{caption label separator}{FBcolon}{% + {\autospace@beforeFDP : }}% + \setbeamertemplate{caption label separator}[FBcolon]% + }{}% + \fi +% \end{macrocode} +% \fbo{ShowOptions}: if \fbo{true}, print the list of all options +% to the \file{.log} file. +% \begin{macrocode} + \ifFBShowOptions + \GenericWarning{* }{% + ***** List of possible options for babel-french ****\MessageBreak + [Default values between brackets when french is loaded *LAST*]% + \MessageBreak + ShowOptions=true [false]\MessageBreak + StandardLayout=true [false]\MessageBreak + GlobalLayoutFrench=false [true]\MessageBreak + PartNameFull=false [true]\MessageBreak + IndentFirst=false [true]\MessageBreak + ListItemsAsPar=true [false]\MessageBreak + StandardListSpacing=true [false]\MessageBreak + StandardItemizeEnv=true [false]\MessageBreak + StandardEnumerateEnv=true [false]\MessageBreak + StandardItemLabels=true [false]\MessageBreak + ItemLabels=\textemdash, \textbullet, + \protect\ding{43},... [\textendash]\MessageBreak + ItemLabeli=\textemdash, \textbullet, + \protect\ding{43},... [\textendash]\MessageBreak + ItemLabelii=\textemdash, \textbullet, + \protect\ding{43},... [\textendash]\MessageBreak + ItemLabeliii=\textemdash, \textbullet, + \protect\ding{43},... [\textendash]\MessageBreak + ItemLabeliv=\textemdash, \textbullet, + \protect\ding{43},... [\textendash]\MessageBreak + StandardLists=true [false]\MessageBreak + ListOldLayout=true [false]\MessageBreak + FrenchFootnotes=false [true]\MessageBreak + AutoSpaceFootnotes=false [true]\MessageBreak + AutoSpacePunctuation=false [true]\MessageBreak + ThinColonSpace=true [false]\MessageBreak + OriginalTypewriter=true [false]\MessageBreak + UnicodeNoBreakSpaces=true [false]\MessageBreak + og= <left quote character>, fg= <right quote character>% + INGuillSpace=true [false]\MessageBreak + EveryParGuill=open, close, none [open]\MessageBreak + EveryLineGuill=open, close, none + [open in LuaTeX, none otherwise]\MessageBreak + InnerGuillSingle=true [false]\MessageBreak + ThinSpaceInFrenchNumbers=true [false]\MessageBreak + SmallCapsFigTabCaptions=false [true]\MessageBreak + CustomiseFigTabCaptions=false [true]\MessageBreak + OldFigTabCaptions=true [false]\MessageBreak + FrenchSuperscripts=false [true]\MessageBreak + LowercaseSuperscripts=false [true]\MessageBreak + SuppressWarning=true [false]\MessageBreak + \MessageBreak + *********************************************% + \MessageBreak\protect\frenchsetup{ShowOptions}} + \fi +} +% \end{macrocode} +% \end{macro} +% +% \changes{v2.0}{2006/12/06}{Added warning for OT1 encoding.} +% +% \changes{v2.1b}{2008/04/07}{Disable some commands in bookmarks.} +% +% \changes{v2.5e}{2011/04/03}{\cs{pdfstringdefDisableCommands} should +% redefine \cs{FB@og} and \cs{FB@fg} instead of \cs{og} and \cs{fg} +% so that it works also when quotes are entered as characters. +% Reported by Sébastien Gouezel.} +% +% At |\begin{document}|, we have to provide an |\xspace| command +% in case the \pkg{xspace} package is not loaded, do some setup for +% \file{hyperref}’s bookmarks, execute |\FBprocess@options|, switch +% LuaTeX punctuation on and issue some warnings if necessary. +% \begin{macrocode} +\AtBeginDocument{% + \providecommand*{\xspace}{\relax}% +% \end{macrocode} +% +% \changes{v2.5g}{2011/11/13}{Redefine \cs{degre}, \cs{degres} \cs{at} +% \cs{circonflexe} and \cs{tild} for bookmarks. Add \cs{fup} also.} +% +% \changes{v3.2g}{2017/01/24}{Add \cs{boi} to redefinitions for +% bookmarks.} +% +% \changes{v3.5d}{2018/12/16}{Add \cs{frquote} to redefinitions for +% bookmarks.} +% +% Let’s redefine some commands in \file{hyperref}’s bookmarks. +% \begin{macrocode} + \ifdefined\pdfstringdefDisableCommands + \pdfstringdefDisableCommands{% + \let\up\relax + \let\fup\relax + \let\degre\textdegree + \let\degres\textdegree + \def\ieme{e\xspace}% + \def\iemes{es\xspace}% + \def\ier{er\xspace}% + \def\iers{ers\xspace}% + \def\iere{re\xspace}% + \def\ieres{res\xspace}% + \def\FrenchEnumerate#1{#1\degre\space}% + \def\FrenchPopularEnumerate#1{#1\degre)\space}% + \def\No{N\degre\space}% + \def\no{n\degre\space}% + \def\Nos{N\degre\space}% + \def\nos{n\degre\space}% + \def\FB@og{\guillemotleft\space}% + \def\FB@fg{\space\guillemotright}% + \def\frquote#1{\FB@og #1\FB@fg}% + \def\at{@}% + \def\circonflexe{\string^}% + \def\tild{\string~}% + \def\boi{\textbackslash}% + \let\bsc\textsc + }% + \fi +% \end{macrocode} +% Let’s now process the remaining options, either not explicitly +% set by \fbsetup{} or possibly modified by packages loaded after +% \frenchb. +% \begin{macrocode} + \FBprocess@options +% \end{macrocode} +% When option \fbo{UnicodeNoBreakSpaces} is \fbo{true} +% (LuaLaTeX only) we need to redefine |\FBmedkern|, |\FBthickkern| +% and |\FBthousandsep| as Unicode characters. +% \begin{macrocode} + \ifFBucsNBSP + \renewcommand*{\FBmedkern}{\char"202F\relax}% + \renewcommand*{\FBthickkern}{\char"A0\relax}% + \ifFBThinSpaceInFrenchNumbers + \renewcommand*{\FBthousandsep}{\char"202F\relax}% + \else + \renewcommand*{\FBthousandsep}{\char"A0\relax}% + \fi + \fi +% \end{macrocode} +% +% \changes{v3.0a}{2014/01/28}{Test \cs{ifXeTeX} changed to +% \cs{ifFBunicode} and `xltxtra’ changed to `fontspec’.} +% +% \changes{v3.1a}{2014/06/14}{fontspec is not required for T1 fonts +% used with the luainputenc.sty package.} +% +% \changes{v3.2g}{2017/01/24}{fontspec defines TU encoding now and +% no longer loads xunicode.sty. Test changed.} +% +% \changes{v3.3c}{2017/09/06}{LaTeX 2017-04-15 defines TU encoding +% for Unicode engines, fontspec is no longer required.} +% +% Finally, a warning is issued with pdfLaTeX when OT1 encoding +% is in use at the |\begin{document}|; mind that |\encodingdefault| +% is defined as `long’, the test would fail if |\FBOTone| was +% defined with |\newcommand*|! +% \begin{macrocode} + \begingroup + \newcommand{\FBOTone}{OT1}% + \ifx\encodingdefault\FBOTone + \FBWarning{OT1 encoding should not be used for French.% + \MessageBreak + Add \protect\usepackage[T1]{fontenc} to the + preamble\MessageBreak of your document; reported}% + \fi + \endgroup +} +% \end{macrocode} +% +% \subsection{French lists} +% \label{ssec-lists} +% +% \changes{v2.6a}{2013/01/30}{Bug correction: changing \cs{leftmargin} +% cannot be done only for itemize-lists: it messes up +% embedded enumerate lists. Pointed out by Denis Bitouzé. +% Lists have been completely redesigned in frenchb v.~2.6a. +% An option for backward compatibility is provided.} +% +% \begin{macro}{\listFB} +% \begin{macro}{\listORI} +% \begin{macro}{\FB@listVsettings} +% Vertical spacing in lists should be shorter in French texts than +% the defaults provided by LaTeX. +% Note that the easy way, just changing values of vertical spacing +% parameters when entering French and restoring them to their +% defaults on exit would not work; so we define the command +% |\FB@listVsettings| to hold the settings to be used by +% the French variant |\listFB| of |\list|. Note that switching +% to |\listFB| reduces vertical spacing in \emph{all} environments +% built on |\list|: |itemize|, |enumerate|, |description|, but also +% |abstract|, |quotation|, |quote| and |verse|\dots{} +% +% The amount of vertical space before and after a list is given by +% |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new +% paragraph). IMHO, |\parskip| should be added \emph{only} when +% the list starts a new paragraph, so I subtract |\parskip| from +% |\topsep| and add it back to |\partopsep|; this will normally +% make no difference because |\parskip|’s default value is 0pt, but +% will be noticeable when |\parskip| is \emph{not} null. +% +% \begin{macrocode} +\let\listORI\list +\let\endlistORI\endlist +\def\FB@listVsettings{% + \setlength{\itemsep}{0.4ex plus 0.2ex minus 0.2ex}% + \setlength{\parsep}{0.4ex plus 0.2ex minus 0.2ex}% + \setlength{\topsep}{0.8ex plus 0.4ex minus 0.4ex}% + \setlength{\partopsep}{0.4ex plus 0.2ex minus 0.2ex}% +% \end{macrocode} +% |\parskip| is of type `skip’, its mean value only (\emph{not +% the glue}) should be subtracted from |\topsep| and added to +% |\partopsep|, so convert |\parskip| to a `dimen’ using +% |\@tempdima|. +% \begin{macrocode} + \@tempdima=\parskip + \addtolength{\topsep}{-\@tempdima}% + \addtolength{\partopsep}{\@tempdima}% +} +\def\listFB#1#2{\listORI{#1}{\FB@listVsettings #2}} +\let\endlistFB\endlist +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Let’s now consider French itemize-lists. They differ from those +% provided by the standard LaTeX classes: +% \begin{itemize} +% \item The `\textbullet’ is never used in French itemize-lists, +% an emdash `---’ or an endash `--’ is preferred for all +% levels. The item label to be used in French is stored in +% |\FrenchLabelItem}|, it defaults to `---’ and can be changed +% using \fbsetup{} (see section~\ref{ssec-keyval}). +% \item Vertical spacing between items, before and after +% the list, should be \emph{null} with \emph{no glue} added; +% \item In French the labels of itemize-lists are vertically +% aligned as shown p.~\pageref{ListAsPar}. +% \end{itemize} +% +% \begin{macro}{\FrenchLabelItem} +% \changes{v2.6a}{2013/01/30}{default changed from \cs{textendash} to +% \cs{textemdash}.} +% \begin{macro}{\Frlabelitemi} +% \begin{macro}{\Frlabelitemii} +% \begin{macro}{\Frlabelitemiii} +% \begin{macro}{\Frlabelitemiv} +% Default labels for French itemize-lists (same label for all levels): +% \begin{macrocode} +\newcommand*{\FrenchLabelItem}{\textemdash} +\newcommand*{\Frlabelitemi}{\FrenchLabelItem} +\newcommand*{\Frlabelitemii}{\FrenchLabelItem} +\newcommand*{\Frlabelitemiii}{\FrenchLabelItem} +\newcommand*{\Frlabelitemiv}{\FrenchLabelItem} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\listindentFB} +% \begin{macro}{\descindentFB} +% \begin{macro}{\labelindentFB} +% \begin{macro}{\labelwidthFB} +% Let’s define four dimens |\listindentFB|, |\descindentFB|, +% |\labelindentFB| and |\labelwidthFB| to customise lists’ horizontal +% indentations. +% They are given silly negative values here in order to eventually +% enable their customisation in the preamble. They will get +% reasonnable defaults later when entering French (see +% |\setlabelitemsFB| and |\setlistindentFB|) unless they have been +% customised. +% \begin{macrocode} +\newdimen\listindentFB +\setlength{\listindentFB}{-1pt} +\newdimen\descindentFB +\setlength{\descindentFB}{-1pt} +\newdimen\labelindentFB +\setlength{\labelindentFB}{-1pt} +\newdimen\labelwidthFB +\setlength{\labelwidthFB}{-1pt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \changes{v3.2e}{2016/10/28}{Add missing redefinitions for +% \cs{leftmarginv}, \cs{leftmarginvi}. Suggested by J.F. Burnol.} +% +% \changes{v3.5a}{2018/07/04}{New optional layout for lists: +% lists’ items can be typeset as paragraphs with indented labels +% while the default leaves the labels hanging into the left margin.} +% +% \begin{macro}{\leftmarginFB} +% \begin{macro}{\FB@listHsettings} +% |\FB@listHsettings| holds the new horizontal settings chosen for +% French lists \env{itemize}, \env{enumerate} and \env{description} +% (two possible layouts). +% \begin{macrocode} +\newdimen\leftmarginFB +\def\FB@listHsettings{% + \ifFBListItemsAsPar +% \end{macrocode} +% Optional layout: lists’ items are typeset as paragraphs with +% indented labels. +% \begin{macrocode} + \itemindent=\labelindentFB + \advance\itemindent by \labelwidthFB + \advance\itemindent by \labelsep + \leftmargini\z@ + \bbl@for\FB@dp {2, 3, 4, 5, 6}% + {\csname leftmargin\romannumeral\FB@dp\endcsname=\labelindentFB}% + \else +% \end{macrocode} +% Default layout: labels hanging into the left margin. +% \begin{macrocode} + \leftmarginFB=\labelwidthFB + \advance\leftmarginFB by \labelsep + \bbl@for\FB@dp {1, 2, 3, 4, 5, 6}% + {\csname leftmargin\romannumeral\FB@dp\endcsname=\leftmarginFB}% + \advance\leftmargini by \listindentFB + \fi + \leftmargin=\csname leftmargin\ifnum\@listdepth=\@ne i\else + ii\fi\endcsname +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\itemizeFB} +% \begin{macro}{\FB@itemizesettings} +% +% \changes{v2.6f}{2013/11/25}{\cs{labelwidth} must be reset, f.i. when +% an itemize list occurs inside environments based on trivlist which +% set \cs{labelwidth} to 0 (see proof environment in amsthm.sty). +% Bug pointed out by Julien Hauseux.} +% +% \changes{v2.6g}{2013/12/30}{Suppress all vertical spaces only if +% ReduceListSpacing is true. Pointed out by Pierre Willaime.} +% +% New environment for French itemize-lists.\\ |\FB@itemizesettings| +% does two things: first suppress all vertical spaces including glue +% unless option \fbo{StandardListSpacing} is set, then set horizontal +% indentations according to |\FB@listHsettings| unless option +% \fbo{ListOldLayout} is \fbo{true} (compatibility with lists +% up to v.~2.5k). +% \begin{macrocode} +\def\FB@itemizesettings{% + \ifFBStandardListSpacing + \else + \setlength{\itemsep}{\z@}% + \setlength{\parsep}{\z@}% + \setlength{\topsep}{\z@}% + \setlength{\partopsep}{\z@}% + \@tempdima=\parskip + \addtolength{\topsep}{-\@tempdima}% + \addtolength{\partopsep}{\@tempdima}% + \fi + \settowidth{\labelwidth}{\csname\@itemitem\endcsname}% + \ifFBListOldLayout + \setlength{\leftmargin}{\labelwidth}% + \addtolength{\leftmargin}{\labelsep}% + \addtolength{\leftmargin}{\parindent}% + \else + \FB@listHsettings + \fi +} +% \end{macrocode} +% The definition of |\itemizeFB| follows the one of |\itemize| +% in standard LaTeX classes (see \file{ltlists.dtx}), +% spaces are customised by |\FB@itemizesettings|. +% +% \begin{macrocode} +\def\itemizeFB{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth by \@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \listORI + \csname\@itemitem\endcsname + \FB@itemizesettings + \fi +} +\let\enditemizeFB\endlistORI +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +\def\setlabelitemsFB{% + \let\labelitemi\Frlabelitemi + \let\labelitemii\Frlabelitemii + \let\labelitemiii\Frlabelitemiii + \let\labelitemiv\Frlabelitemiv + \ifdim\labelwidthFB<\z@ + \settowidth{\labelwidthFB}{\FrenchLabelItem}% + \fi +} +\def\setlistindentFB{% + \ifdim\labelindentFB<\z@ + \ifdim\parindent=\z@ + \setlength{\labelindentFB}{1.5em}% + \else + \setlength{\labelindentFB}{\parindent}% + \fi + \fi + \ifdim\listindentFB<\z@ + \ifdim\parindent=\z@ + \setlength{\listindentFB}{1.5em}% + \else + \setlength{\listindentFB}{\parindent}% + \fi + \fi + \ifdim\descindentFB<\z@ + \ifFBListItemsAsPar + \setlength{\descindentFB}{\labelindentFB}% + \else + \setlength{\descindentFB}{\listindentFB}% + \fi + \fi +} +% \end{macrocode} +% +% \begin{macro}{\enumerateFB} +% The definition of |\enumerateFB|, new to version~2.6a, follows +% the one of |\enumerate| in standard LaTeX classes (see +% \file{ltlists.dtx}), vertical spaces are customised (or not) +% via |\list| (=|\listFB| or |\listORI|) and horizontal spaces +% (leftmargins) are borrowed from |itemize| lists via +% |\FB@listHsettings|. +% +% \begin{macrocode} +\def\enumerateFB{% + \ifnum \@enumdepth >\thr@@\@toodeep\else + \advance\@enumdepth by \@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \expandafter + \list + \csname label\@enumctr\endcsname + {\FB@listHsettings + \usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% + \fi +} +\let\endenumerateFB\endlistORI +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\descriptionFB} +% \changes{v2.6b}{2013/02/10}{Settings of \cs{FB@listHsettings} should +% apply to description lists too.} +% +% \changes{v3.0a}{2014/02/28}{Added \cs{listindentFB} to +% \cs{itemindent}. Suggested by Denis Bitouzé.} +% +% \changes{v3.2d}{2014/07/01}{Changed \cs{listindentFB} to +% \cs{descindentFB} which defaults to \cs{listindentFB}. +% \cs{leftmargini} reduced when \cs{descindentFB} is null.} +% +% \changes{v3.5a}{2018/07/04}{ListItemsAsPar option taken into account +% for description lists.} +% +% Same tuning for the \env{description} environment (see +% \file{classes.dtx} for the original definition). +% Customisable dimen |\descindentFB|, which defaults to +% |\listindentFB|, is added to |\itemindent| (first level only). +% When |\descindentFB=0pt| (1rst level labels start at the left +% margin), |\leftmargini| is reduced to |\listindentFB| instead +% of |\listindentFB| + |\leftmarginFB|. +% +% When option \fbo{ListItemsAsPar} is turned to \fbo{true}, the +% \env{description} items are also displayed as paragraphs; +% |\descindentFB=0pt| can be used to push labels to the left margin. +% \begin{macrocode} +\def\descriptionFB{% + \list{}{\FB@listHsettings + \labelwidth=\z@ + \ifFBListItemsAsPar + \itemindent=\descindentFB + \else + \itemindent=-\leftmargin + \ifnum\@listdepth=1 + \ifdim\descindentFB=\z@ + \ifdim\listindentFB>\z@ + \leftmargini=\listindentFB + \leftmargin=\leftmargini + \itemindent=-\leftmargin + \fi + \else + \advance\itemindent by \descindentFB + \fi + \fi + \fi + \let\makelabel\descriptionlabel}% +} +\let\enddescriptionFB\endlistORI +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\update@frenchlists} +% \begin{macro}{\bbl@frenchlistlayout} +% |\update@frenchlists| will set up lists according to the final +% options (default or part of \fbsetup{} eventually overruled in +% |\FBprocess@options|). +% \begin{macrocode} +\def\update@frenchlists{% + \setlistindentFB + \ifFBStandardListSpacing + \else \let\list\listFB \fi + \ifFBStandardItemizeEnv + \else \let\itemize\itemizeFB \fi + \ifFBStandardItemLabels + \else \setlabelitemsFB \fi + \ifFBStandardEnumerateEnv + \else \let\enumerate\enumerateFB \let\description\descriptionFB \fi +} +% \end{macrocode} +% +% \changes{v3.2h}{2017/02/03}{Execute \cs{update@frenchlists} only +% if GlobalLayoutFrench is false. +% Delete stuff for lists in \cs{noextrasfrench}.} +% +% If \fbo{GlobalLayoutFrench=true}, nothing has to be done at +% language’s switches regarding lists. Otherwise, |\extrasfrench| +% saves the standard settings for lists and then executes +% |\update@frenchlists|. In both cases, there is nothing to do for +% lists in |\noextrasfrench|. +% +% In order to ensure compatibility with packages customising lists, +% the command |\update@frenchlists| should not be included in the +% first call to |\extrasfrench| which occurs \emph{before} the +% relevant flags are finally set, so we define |\FB@ufl| as +% |\relax|, it will be redefined later `AtBeginDocument’ by +% |\FBprocess@options| as |\update@frenchlists|, +% see p.~\pageref{FB@ufl}. +% \begin{macrocode} +\def\FB@ufl{\relax} +\def\bbl@frenchlistlayout{% + \ifFBGlobalLayoutFrench + \else + \babel@save\list \babel@save\itemize + \babel@save\enumerate \babel@save\description + \babel@save\labelitemi \babel@save\labelitemii + \babel@save\labelitemiii \babel@save\labelitemiv + \FB@ufl + \fi +} +\addto\extrasfrench{\bbl@frenchlistlayout} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{French indentation of sections} +% \label{ssec-indent} +% +% \begin{macro}{\bbl@frenchindent} +% \begin{macro}{\bbl@nonfrenchindent} +% In French the first paragraph of each section should be indented, +% this is another difference with US-English. This is controlled +% by the flag |\if@afterindent|. +% +% \changes{v2.3d}{2009/03/16}{Bug correction: previous versions of +% frenchb set the flag \cs{if@afterindent} to false outside +% French which is correct for English but wrong for some languages +% like Spanish. Pointed out by Juan José Torrens.} +% +% We will need to save the value of the flag |\if@afterindent| +% `AtBeginDocument’ before eventually changing its value. +% +% \begin{macrocode} +\def\bbl@frenchindent{% + \ifFBGlobalLayoutFrench + \else + \babel@save\@afterindentfalse + \fi + \ifFBIndentFirst + \let\@afterindentfalse\@afterindenttrue + \@afterindenttrue + \fi} +\def\bbl@nonfrenchindent{% + \ifFBGlobalLayoutFrench + \ifFBIndentFirst + \@afterindenttrue + \fi + \fi} +\addto\extrasfrench{\bbl@frenchindent} +\addto\noextrasfrench{\bbl@nonfrenchindent} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Formatting footnotes} +% \label{ssec-footnotes} +% +% \changes{v2.0}{2006/11/06}{Footnotes are now printed +% by default `à la française’ for the whole document.} +% +% \changes{v2.0b}{2007/04/18}{Footnotes: Just do nothing +% (except warning) when the bigfoot package is loaded.} +% +% The \pkg{bigfoot} package deeply changes the way footnotes are +% handled. When \file{bigfoot} is loaded, we just warn the user +% that \frenchb{} will drop the customisation of footnotes. +% +% The layout of footnotes is controlled by two flags +% |\ifFBAutoSpaceFootnotes| and |\ifFBFrenchFootnotes| which are +% set by options of \fbsetup{} (see section~\ref{ssec-keyval}). +% The layout of footnotes \emph{does not depend} on the current +% language (just think of two footnotes on the same page looking +% different because one was called in a French part, the other one +% in English!). +% +% We save the original definition of |\@footnotemark| at the +% |\begin{document}| in order to include any customisation that +% packages might have done; we define a variant |\@footnotemarkFB| +% which just adds a thin space before the number or symbol calling +% a footnote (any space typed in is removed first). The choice +% between the two definitions (valid for the whole document) is +% controlled by flag |\ifFBAutoSpaceFootnotes|. +% +% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to +% \cs{PackageInfo} (when bigfoot package in use).} +% +% \begin{macrocode} +\AtBeginDocument{\@ifpackageloaded{bigfoot}% + {\PackageInfo{french.ldf}% + {bigfoot package in use.\MessageBreak + babel-french will NOT customise footnotes;% + \MessageBreak reported}}% + {\let\@footnotemarkORI\@footnotemark + \def\@footnotemarkFB{\leavevmode\unskip\unkern + \,\@footnotemarkORI}% + \ifFBAutoSpaceFootnotes + \let\@footnotemark\@footnotemarkFB + \fi}% + } +% \end{macrocode} +% +% \begin{macro}{\@makefntextFB} +% We then define |\@makefntextFB|, a variant of |\@makefntext| +% which is responsible for the layout of footnotes, to match the +% specifications of the French `Imprimerie Nationale’: footnotes +% will be indented by |\parindentFFN|, numbers (if any) typeset on +% the baseline (instead of superscripts), right aligned on +% |\parindentFFN| and followed by a dot and an half quad kern. +% Whenever symbols are used to number footnotes (as in |\thanks| +% for instance), we switch back to the standard layout (the French +% layout of footnotes is meant for footnotes numbered by arabic or +% roman digits). +% +% \changes{v2.0}{2006/11/06}{\cs{parindentFFN} not changed if +% already defined (required by JA for cah-gut.cls).} +% +% \changes{v2.3b}{2008/12/06}{New commands \cs{dotFFN} and +% \cs{kernFFN} for more flexibility (suggested by JA).} +% +% \changes{v3.2a}{2016/03/14}{beamer.cls requires a specific +% definition of \cs{@makefntextFB} (pointed out by DB). +% The same is true for memoir and koma-script classes (done).} +% +% The value of |\parindentFFN| will be redefined at the +% |\begin{document}|, as the maximum of |\parindent| and 1.5em +% \emph{unless} it has been set in the preamble (the weird value +% 10in is just for testing whether |\parindentFFN| has been set +% or not). +% \begin{macrocode} +\newdimen\parindentFFN +\parindentFFN=10in +% \end{macrocode} +% |\FBfnindent| will be set `AtBeginDocument’ to the width of +% the box holding the footnote mark, |\dotFFN| and |\kernFFN| +% (flushed right). It is used by \cls{memoir} and koma-script +% classes. +% \begin{macrocode} +\newcommand*{\dotFFN}{.} +\newcommand*{\kernFFN}{\kern .5em} +\newdimen\FBfnindent +% \end{macrocode} +% |\@makefntextFB|’s definition is now tuned according to the +% document’s class for better compatibility. +% +% Koma-script classes provide |\deffootnote|, a handy command +% to customise the footnotes’ layout (see English manual +% \file{scrguien.pdf}); it redefines |\@makefntext| and +% |\@@makefnmark|. First, save the original definitions. +% \begin{macrocode} +\ifFB@koma + \let\@makefntextORI\@makefntext + \let\@@makefnmarkORI\@@makefnmark +% \end{macrocode} +% |\@makefntextFB| and |\@@makefnmarkFB| will be used when option +% \fbo{FrenchFootnotes} is \fbo{true}. +% \begin{macrocode} + \deffootnote[\FBfnindent]{0pt}{\parindentFFN}% + {\thefootnotemark\dotFFN\kernFFN} + \let\@makefntextFB\@makefntext + \let\@@makefnmarkFB\@@makefnmark +% \end{macrocode} +% |\@makefntextTH| and |\@@makefnmarkTH| are meant for the +% |\thanks| command used by |\maketitle| when \fbo{FrenchFootnotes} +% is \fbo{true}. +% \begin{macrocode} + \deffootnote[\parindentFFN]{0pt}{\parindentFFN}% + {\textsuperscript{\thefootnotemark}} + \let\@makefntextTH\@makefntext + \let\@@makefnmarkTH\@@makefnmark +% \end{macrocode} +% Restore the original definitions. +% \begin{macrocode} + \let\@makefntext\@makefntextORI + \let\@@makefnmark\@@makefnmarkORI +\fi +% \end{macrocode} +% Definitions for the \cls{memoir} class: +% \begin{macrocode} +\@ifclassloaded{memoir} +% \end{macrocode} +% (see original definition in \file{memman.pdf}) +% \begin{macrocode} + {\newcommand{\@makefntextFB}[1]{% + \def\footscript##1{##1\dotFFN\kernFFN}% + \setlength{\footmarkwidth}{\FBfnindent}% + \setlength{\footmarksep}{-\footmarkwidth}% + \setlength{\footparindent}{\parindentFFN}% + \makefootmark #1}% + }{} +% \end{macrocode} +% Definitions for the \cls{beamer} class: +% \begin{macrocode} +\@ifclassloaded{beamer} +% \end{macrocode} +% (see original definition in \file{beamerbaseframecomponents.sty}), +% note that for the \cls{beamer} class footnotes are LR-boxes, not +% paragraphs, so |\parindentFFN| is irrelevant. +% class. +% +% \changes{v3.2h}{2016/04/09}{With beamer.cls, add \cs{llap} to +% \cs{@thefnmark} for notes numbered over 99.} +% +% \begin{macrocode} + {\def\@makefntextFB#1{% + \def\insertfootnotetext{#1}% + \def\insertfootnotemark{\insertfootnotemarkFB}% + \usebeamertemplate***{footnote}}% + \def\insertfootnotemarkFB{% + \usebeamercolor[fg]{footnote mark}% + \usebeamerfont*{footnote mark}% + \llap{\@thefnmark}\dotFFN\kernFFN}% + }{} +% \end{macrocode} +% Now the default definition of |\@makefntextFB| for standard LaTeX +% and AMS classes. +% +% The next command prints the footnote mark according to the +% specifications of the French `Imprimerie Nationale’. +% Keep in mind that |\@thefnmark| might be empty (i.e.\ in +% AMS classes’ titles)! +% \begin{macrocode} +\providecommand*{\insertfootnotemarkFB}{% + \parindent=\parindentFFN + \rule\z@\footnotesep + \setbox\@tempboxa\hbox{\@thefnmark}% + \ifdim\wd\@tempboxa>\z@ + \llap{\@thefnmark}\dotFFN\kernFFN + \fi} +\providecommand\@makefntextFB[1]{\insertfootnotemarkFB #1} +% \end{macrocode} +% \end{macro} +% +% The rest of |\@makefntext|’s customisation is done at the +% |\begin{document}|. We save the original definition of +% |\@makefntext|, and then redefine |\@makefntext| according +% to the value of flag |\ifFBFrenchFootnotes| (true or false). +% Koma-script classes require a special treatment. +% +% \changes{v3.3c}{2017/07/28}{Reset \cs{localleftbox} locally +% inside \cs{@makefntext}. Needed by \cs{frquote} with LuaTeX.} +% +% \changes{v3.5b}{2018/07/17}{Reset \cs{FBeverypar@quote} locally +% inside \cs{@makefntext}. Needed by \cs{frquote}.} +% +% \changes{v3.5c}{2018/09/13}{Remove grouping inside \cs{@makefntext}, +% \cs{localleftbox} and \cs{FBeverypar@quote} saved and restored +% instead.} +% +% The LuaTeX command |\localleftbox| and |\FBeverypar@quote| used +% by |\frquote{}| have to be reset inside footnotes; done for LaTeX +% based formats only. +% \begin{macrocode} +\providecommand\localleftbox[1]{} +\AtBeginDocument{% + \@ifpackageloaded{bigfoot}{}% + {\ifdim\parindentFFN<10in + \else + \parindentFFN=\parindent + \ifdim\parindentFFN<1.5em \parindentFFN=1.5em \fi + \fi + \settowidth{\FBfnindent}{\dotFFN\kernFFN}% + \addtolength{\FBfnindent}{\parindentFFN}% + \let\@makefntextORI\@makefntext + \ifFB@koma +% \end{macrocode} +% Definition of |\@makefntext| for koma-script classes: running +% \@makefntextORI inside a group to reset |\localleftbox{}| and +% |\FBeverypar@quote| would mess up the layout of footnotes whenever +% the first manadatory argument of |\deffootnote{}| (used as +% |\leftskip|) is non-nil (default is 1em, 0pt in French). +% \begin{macrocode} + \let\@@makefnmarkORI\@@makefnmark + \long\def\@makefntext#1{% + \localleftbox{}% + \let\FBeverypar@save\FBeverypar@quote + \let\FBeverypar@quote\relax + \ifFBFrenchFootnotes + \ifx\footnote\thanks + \let\@@makefnmark\@@makefnmarkTH + \@makefntextTH{#1} + \else + \let\@@makefnmark\@@makefnmarkFB + \@makefntextFB{#1} + \fi + \else + \let\@@makefnmark\@@makefnmarkORI + \@makefntextORI{#1}% + \fi + \let\FBeverypar@quote\FBeverypar@save + \localleftbox{\FBeveryline@quote}}% + \else +% \end{macrocode} +% Special add-on for the \cls{memoir} class: |\maketitle| redefines +% |\@makefntext| as |\makethanksmark| which is customised as follows +% to match the other notes’ vertical alignment. +% \begin{macrocode} + \@ifclassloaded{memoir}% + {\ifFBFrenchFootnotes + \setlength{\thanksmarkwidth}{\parindentFFN}% + \setlength{\thanksmarksep}{-\thanksmarkwidth}% + \fi + }{}% +% \end{macrocode} +% Special add-on for the \cls{beamer} class: issue a warning +% in case |\parindentFFN| has been changed. +% \begin{macrocode} + \@ifclassloaded{beamer}% + {\ifFBFrenchFootnotes + \ifdim\parindentFFN=1.5em\else + \FBWarning{% + \protect\parindentFFN\space is ineffective% + \MessageBreak within the beamer class.% + \MessageBreak Reported}% + \fi + \fi + }{}% +% \end{macrocode} +% Definition of |\@makefntext| for all other classes: +% \begin{macrocode} + \long\def\@makefntext#1{% + \localleftbox{}% + \let\FBeverypar@save\FBeverypar@quote + \let\FBeverypar@quote\relax + \ifFBFrenchFootnotes + \@makefntextFB{#1}% + \else + \@makefntextORI{#1}% + \fi + \let\FBeverypar@quote\FBeverypar@save + \localleftbox{\FBeveryline@quote}}% + \fi + }% +} +% \end{macrocode} +% +% For compatibility reasons, we provide definitions for the commands +% dealing with the layout of footnotes in \frenchb{} version~1.6. +% \fbsetup{} (see in section \ref{ssec-keyval}) should be +% preferred for setting these options. |\StandardFootnotes| may +% still be used locally (in minipages for instance), that’s why the +% test |\ifFBFrenchFootnotes| is done inside |\@makefntext|. +% \begin{macrocode} +\newcommand*{\AddThinSpaceBeforeFootnotes}{\FBAutoSpaceFootnotestrue} +\newcommand*{\FrenchFootnotes}{\FBFrenchFootnotestrue} +\newcommand*{\StandardFootnotes}{\FBFrenchFootnotesfalse} +% \end{macrocode} +% +% \subsection{Clean up and exit} +% +% \changes{v3.0a}{2014/02/20}{french.cfg will be loaded (if found) +% instead of frenchb.cfg. NO NEED for .cfg files in French anyway.} +% +% \changes{v3.1h}{2015/08/19}{french.cfg from e-french conflicts with +% babel-french. Do NOT load it (no need for .cfg files with +% babel-french anyway).} +% +% Final cleaning. +% The macro |\ldf@finish| takes care for setting the main language +% to be switched on at |\begin{document}| and resetting the +% category code of \texttt{@} to its original value. |\loadlocalcfg| +% is redefined locally in order not to load any \file{.cfg} file for +% French. +% \begin{macrocode} +\FBclean@on@exit +\ldf@finish\CurrentOption +\let\loadlocalcfg\FB@llc +%</french> +% \end{macrocode} +% +% \subsection[Files \file{frenchb.ldf}, \file{francais.ldf}, +% \file{canadien.ldf} and \file{acadian.ldf}]% +% {Files \file{frenchb.ldf}, \file{francais.ldf}, +% \file{canadien.ldf} and\\ \file{acadian.ldf}} +% +% \changes{v3.3b}{2017/06/28}{Generate portmanteau files +% \file{acadian.ldf}, \file{canadien.ldf}, \file{frenchb.ldf}, +% and \file{francais.ldf} and warn about deprecated options.} +% +% Babel now expects a \file{\meta{lang}.ldf} file for each +% \meta{lang}. +% So we create portmanteau \file{.ldf} files for options +% \texttt{canadien}, \texttt{francais}, \texttt{frenchb} and +% \texttt{acadian}. These files themselves only load +% \file{french.ldf} which does the real work. +% Warn users about options \opt{canadien}, \opt{frenchb} and +% \opt{francais} being deprecated and force recommended options +% \opt{acadian} or \opt{french}. +% \begin{macrocode} +%<*acadian> +\PackageInfo{acadian.ldf}% + {`acadian' dialect is currently\MessageBreak + *absolutely identical* to the\MessageBreak + `french' language; reported} +%</acadian> +%<*canadien> +\PackageWarning{canadien.ldf}% + {Option `canadien' for Babel is *deprecated*,\MessageBreak + it might be removed sooner or later. Please\MessageBreak + use `acadian' instead; reported}% +\let\l@canadien\l@acadian +\def\CurrentOption{acadian} +%</canadien> +%<*francais> +\PackageWarning{francais.ldf}% + {Option `francais' for Babel is *deprecated*,\MessageBreak + it might be removed sooner or later. Please\MessageBreak + use `french' instead; reported}% +\let\l@francais\l@french +\def\CurrentOption{french} +%</francais> +% \end{macrocode} +% Compatibility code for \babel{} pre-3.13: \file{frenchb.ldf} +% could be loaded with options \opt{acadian}, \opt{canadien}, +% \opt{frenchb} or \opt{francais}. +% \begin{macrocode} +%<*frenchb> +\def\bbl@tempa{frenchb} +\ifx\CurrentOption\bbl@tempa + \let\l@frenchb\l@french + \def\CurrentOption{french} + \PackageWarning{babel-french}% + {Option `frenchb' for Babel is *deprecated*,\MessageBreak + it might be removed sooner or later. Please\MessageBreak + use `french' instead; reported} +\else + \def\bbl@tempa{francais} + \ifx\CurrentOption\bbl@tempa + \let\l@francais\l@french + \def\CurrentOption{french} +% \end{macrocode} +% Plain formats: no warning when \file{francais.sty} loads +% \file{frenchb.ldf} (\babel{} pre-3.13). +% \begin{macrocode} + \ifx\magnification\@undefined + \PackageWarning{babel-french}% + {Option `francais' for Babel is *deprecated*,\MessageBreak + it might be removed sooner or later. Please\MessageBreak + use `french' instead; reported}% + \fi + \else + \def\bbl@tempa{canadien} + \ifx\CurrentOption\bbl@tempa + \let\l@canadien\l@acadian + \def\CurrentOption{acadian} + \PackageWarning{babel-french}% + {Option `canadien' for Babel is *deprecated*,\MessageBreak + it might be removed sooner or later. Please\MessageBreak + use `acadian' instead; reported} + \fi + \fi +\fi +%</frenchb> +%<acadian|canadien|frenchb|francais>\input french.ldf\relax +%<acadian|canadien>\let\extrasacadian\extrasfrench +%<acadian|canadien>\let\noextrasacadian\noextrasfrench +% \end{macrocode} +% +% \Finale +% \iffalse +%<*!lua> +% \fi +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% \iffalse +%</!lua> +% \fi +\endinput + +%%% Local Variables: +%%% fill-column: 72 +%%% coding: utf-8 +%%% End: diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.ins b/macros/latex/contrib/babel-contrib/french/frenchb.ins new file mode 100644 index 0000000000..203ea2a6cc --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/frenchb.ins @@ -0,0 +1,98 @@ +%% +%% This file will generate fast loadable files and documentation driver +%% files from the doc files in this package when run through LuaTeX. +%% +%% Copyright 2001-2019 Daniel Flipo. All rights reserved. +%% +%% This is a generated file part of the the babel-french bundle +%% to be used with the Babel system. +%% ------------------------------------------------------------- +%% +%% It may be distributed under the terms of the LaTeX Project Public +%% License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.3 or, at your option, any later version. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2017/07/06} +\def\batchfile{frenchb.ins} +\input docstrip.tex + +{\ifx\generate\undefined +\Msg{**********************************************} +\Msg{*} +\Msg{* This installation requires docstrip} +\Msg{* version 2.4e or later.} +\Msg{*} +\Msg{* An older version of docstrip has been input} +\Msg{*} +\Msg{**********************************************} +\errhelp{Move or rename old docstrip.tex.} +\errmessage{Old docstrip in input path} +\batchmode +\csname @@end\endcsname +\fi} + +\declarepreamble\mainpreamble +This is a generated file part of the babel-french bundle +to be used with the Babel system. +------------------------------------------------------------- + +It may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2003/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainer of this work is Daniel Flipo. + +Please report errors to: <daniel (dot) flipo (at) free (dot) fr> + +\endpreamble + +\keepsilent +\askforoverwritefalse + +\usedir{tex/generic/babel-french} + +\usepreamble\mainpreamble +\generate{\file{french.ldf}{\from{frenchb.dtx}{french}} + \file{acadian.ldf}{\from{frenchb.dtx}{acadian}} + \file{canadien.ldf}{\from{frenchb.dtx}{canadien}} + \file{frenchb.ldf}{\from{frenchb.dtx}{frenchb}} + \file{francais.ldf}{\from{frenchb.dtx}{francais}} + } + +\def\MetaPrefix{-- } + +\def\luapostamble{% + \MetaPrefix\space End of File frenchb.lua.% +} + +\nopreamble +\usepostamble\luapostamble + +\generate{\file{frenchb.lua}{\from{frenchb.dtx}{lua}}} + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space frenchb.lua\space\space french.ldf} +\Msg{* \space\space frenchb.ldf\space\space francais.ldf} +\Msg{* \space\space canadian.ldf\space\space and acadian.ldf} +\Msg{*} +\Msg{* To produce the documentation run the file frenchb.dtx} +\Msg{* through pdfLaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endbatchfile diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.pdf b/macros/latex/contrib/babel-contrib/french/frenchb.pdf Binary files differnew file mode 100644 index 0000000000..829b2314f4 --- /dev/null +++ b/macros/latex/contrib/babel-contrib/french/frenchb.pdf |