From 0e85a1501dd8b23f1debab0ed20d89b11146ad34 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 19 Apr 2020 03:02:39 +0000 Subject: CTAN sync 202004190302 --- .../latex/contrib/babel-contrib/french/README.md | 12 +- .../contrib/babel-contrib/french/frenchb-doc.pdf | Bin 156507 -> 153525 bytes .../contrib/babel-contrib/french/frenchb-doc.tex | 144 ++--- .../latex/contrib/babel-contrib/french/frenchb.dtx | 602 ++++++++++++--------- .../latex/contrib/babel-contrib/french/frenchb.pdf | Bin 246075 -> 308091 bytes 5 files changed, 421 insertions(+), 337 deletions(-) (limited to 'macros/latex/contrib/babel-contrib') diff --git a/macros/latex/contrib/babel-contrib/french/README.md b/macros/latex/contrib/babel-contrib/french/README.md index 103c7cc15a..50845e3684 100644 --- a/macros/latex/contrib/babel-contrib/french/README.md +++ b/macros/latex/contrib/babel-contrib/french/README.md @@ -1,7 +1,8 @@ The babel-french package (formerly known as `frenchb') ====================================================== -## Description +Description +----------- This package provides support for the French language for the babel multilingual system. @@ -20,7 +21,8 @@ The bundle consists of the following files: * frenchb-doc.tex: source file of frenchb-doc.pdf, * README.md (this file). -## License +License +------- Released under the LaTeX Project Public License v1.3 or later See http://www.latex-project.org/lppl.txt @@ -36,12 +38,14 @@ distribution, do the following: (default location: $TEXMF/tex/generic/babel-french/); * rebuild the database (mktexlsr or so). -## Documentation +Documentation +------------- See the included manuals for usage instructions: frenchb.pdf in English or the French documentation frenchb-doc.pdf. -## Changes +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 index f97bf7df85..bf2992cf94 100644 Binary files a/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf and b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf differ diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex index 4b639840da..8fd5aa56d5 100644 --- a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex +++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex @@ -11,26 +11,26 @@ \usepackage{url,alltt,shortvrb} \usepackage{graphics} \usepackage[dvipsnames]{xcolor} -\usepackage{luatexbase} %%% Provisoire : pour microtype %%% Fontes OpenType avec moteur LuaTeX : Erewhon/Cabin/Inconsolata -\usepackage{fourier-otf} +\usepackage[no-math]{fontspec} \usepackage{realscripts} -\setsansfont{Cabin}[Scale=MatchLowercase] +\setmainfont{erewhon} +%\setsansfont{Cabin}[Scale=MatchLowercase] \setmonofont{Inconsolatazi4}% voir inconsolata-doc.pdf - [Scale=MatchLowercase, HyphenChar=None, StylisticSet={2,3}, - ItalicFont = *-Regular, ItalicFeatures={FakeSlant=0.225}, % 13° - SlantedFont= *-Regular, SlantedFeatures={FakeSlant=0.225}, - BoldItalicFont = *-Bold, BoldItalicFeatures={FakeSlant=0.225}, - BoldSlantedFont= *-Bold, BoldSlantedFeatures={FakeSlant=0.225}, - ] + [Scale=MatchLowercase, HyphenChar=None, StylisticSet={2,3}, + ItalicFont = *-Regular, ItalicFeatures={FakeSlant=0.225}, % 13° + SlantedFont= *-Regular, SlantedFeatures={FakeSlant=0.225}, + BoldItalicFont = *-Bold, BoldItalicFeatures={FakeSlant=0.225}, + BoldSlantedFont= *-Bold, BoldSlantedFeatures={FakeSlant=0.225}, + ] %%% *** APRÈS fontspec *** \usepackage{babel} \frenchbsetup{og=«, fg=», AutoSpacePunctuation=false} \frenchbsetup{ListItemsAsPar} -\usepackage[babel=true,expansion=true,protrusion=true]{microtype} +\usepackage{microtype} % Mise en page \usepackage[textwidth=160mm,textheight=247mm,hmarginratio=1:1 @@ -58,8 +58,7 @@ \def\verbatim@font{\ColorVerb\verbatim@fontORI} \makeatother % options de frenchb : - \def\ColorArg{\color{Sepia}} -% N.B. URL color = ForestGreen +\def\ColorArg{\color{Sepia}} % \newcommand*{\file}[1]{\texttt{\ColorVerb #1}} \newcommand*{\cls}[1]{\texttt{\ColorVerb #1}} @@ -72,12 +71,13 @@ \newcommand*{\lang}[1]{\texttt{\ColorVerb #1}} \newcommand*{\code}[1]{\texttt{\ColorVerb #1}} \newcommand*{\argum}[1]{\textit{#1}} -\newcommand*{\meta}[1]{\textit{\ColorArg #1}} +\newcommand*{\meta}[1]{\textit{< #1 >}} +\newcommand*{\LEFTmargin}{\texttt{<=}} \providecommand\marg[1]{% % from ltxdoc.cls - {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} + {\ttfamily\char`\{}\textit{\ColorArg #1}{\ttfamily\char`\}}} \providecommand\oarg[1]{% - {\ttfamily[}\meta{#1}{\ttfamily]}} + {\ttfamily[}\textit{\ColorArg #1}{\ttfamily]}} \DeclareRobustCommand\cs[1]{\texttt{\ColorVerb \char`\\#1}}% from ltxdoc.cls \newcommand*\fbo[1]{\texttt{\ColorArg #1}} @@ -113,8 +113,8 @@ unicode, bookmarksopen, colorlinks, - urlcolor=ForestGreen, - linkcolor=black, % appel note bas de page en noir + urlcolor=PineGreen, + linkcolor=Blue, } \newcommand*{\hlabel}[1]{\phantomsection\label{#1}} % notes bas de page consécutives avec le même numéro @@ -125,11 +125,11 @@ % \title{Documentation sur le module \ext{babel-french}} \author{\href{mailto:daniel.flipo@free.fr}{Daniel \textsc{Flipo}}} -\newcommand*{\latestversion}{3.5g} +\newcommand*{\latestversion}{3.5h} \date{Version {\latestversion} -- \today} \begin{document} -\def\today{30 janvier 2020} +\def\today{18 avril 2020} \maketitle \thispagestyle{empty} @@ -198,7 +198,8 @@ \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}. + de préférence à \fbo{ReduceListSpacing=false}, + voir p.~\pageref{listspacing}. \item[14 mars 2019] Nouvelle commande |\NoEveryParQuote|, voir p.~\pageref{frquote}. \end{description} @@ -213,7 +214,7 @@ \newpage \section{Appel de l’extension Babel} -Babel est installé en standard dans toutes distributions \LaTeXe, +Babel est installé en standard dans toutes distributions LaTeX, 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 ».}, @@ -257,11 +258,11 @@ par exemple |\selectlanguage{british}| et pour revenir en français Pour passer \emph{localement} dans une autre langue on peut utiliser l’environnement \\ |\begin{otherlanguage}{|\argum{langue}|}|\\ -\hspace*{1em}\argum{texte\dots}\\ +\hspace*{1em}\argum{texte…}\\ |\end{otherlanguage}|\\ ou pour une courte citation dans un paragraphe\\ |\foreignlanguage{|\argum{langue}% -|}{|\argum{texte\dots}|}|. +|}{|\argum{texte…}|}|. 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 @@ -341,7 +342,8 @@ 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 +\goodbreak +Lorsque le français est la langue principale, la présentation 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}.} : @@ -441,7 +443,9 @@ produit les effets suivants : 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}).}. + sans espace) à «\dots» (codé \cs{dots}). Le mieux est d’utiliser + directement le caractère … dans le texte source dès lors que celui-ci est + codé en utf-8.}. \item La commande |\today| retourne la date en français. @@ -481,6 +485,11 @@ Des commandes ont été prévues pour faciliter la saisie : au début de chaque paragraphe, sauf si \fbo{EveryParGuill=close} (guillemet fermant dans ce cas) ou si \fbo{EveryParGuill=none} (aucun ajout). + 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. + Pour les citations imbriquées, plusieurs présentations sont proposées selon les options choisies : \begin{itemize} @@ -503,6 +512,7 @@ Des commandes ont été prévues pour faciliter la saisie : ce faire, il suffit de coder la citation interne avec |\frquote*{}| au lieu de |\frquote{}|. +\pagebreak Exemple de citation imbriquée : \vspace{0.5\baselineskip} @@ -546,11 +556,6 @@ 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 ; @@ -654,7 +659,7 @@ vertical des lettres supérieures simulées par |\fup| En ajoutant |\usepackage{xspace}| dans le préambule, les espaces suivant les commandes -|\ier|,\dots, |\ieres|, +|\ier|,…, |\ieres|, |\ieme|, |\iemes|, |\fg| et |\dots| sont respectés sans avoir à les forcer par des |{}| ou @@ -677,8 +682,7 @@ 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$}}} +\subsection[\textbackslash frenchsetup{}]{\fbsetup{\meta{options}}} \label{ssec:frenchbsetup} La commande \fbsetup{ShowOptions} affiche dans le fichier \file{.log} la liste @@ -700,6 +704,7 @@ La liste étant longue, les options sont regroupées par thèmes. \subsubsection*{Inventaire des options} \begin{description} + \setlength{\labelsep}{0.1666em} \item [ShowOptions=true (false)] affiche dans le fichier \file{.log} toutes les options disponibles, ce qui permet de retrouver leurs noms facilement. @@ -756,7 +761,7 @@ La liste étant longue, les options sont regroupées par thèmes. 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}.} + et \cs{partopsep}.} \label{listspacing} 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}, @@ -882,11 +887,12 @@ La liste étant longue, les options sont regroupées par thèmes. 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 «:»). + 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), les horaires (10:55) et les ratios (1:1). + Avec XeTeX ou pdfTeX |http://truc| et |1:1| donnent http~://truc et 1~:1 + (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} @@ -997,7 +1003,7 @@ La liste étant longue, les options sont regroupées par thèmes. 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 + latin9, ansinew, applemac,…) 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). @@ -1164,7 +1170,7 @@ Commande Babel & Commande pour le français & Intitulé par défaut en français \name{part} & Première partie, Deuxième partie…\\ \name{encl} & P.~J.\\ \name{cc} & Copie à \\ -\name{headto} & $\langle$\textit{vide}$\rangle$\\ +\name{headto} & \meta{vide}\\ \name{page} & page\\ \name{see} & voir\\ \name{also} & voir aussi\\* @@ -1185,7 +1191,7 @@ fonctionne toujours.\hlabel{captionsfrench} \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 +|\acadianabstractname|, …, |\acadianproofname| sont, elles, définies (comme leurs homologues françaises) et personnalisables pour le français du Canada (option \lang{acadian}). \par} @@ -1225,15 +1231,15 @@ 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 + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{itemize} - \item Premier élément sur plus d’une ligne\dots{} + \item Premier élément sur plus d’une ligne… \begin{itemize} \item Un élément niveau 2, \item Second élément niveau 2, \end{itemize} - \item Second élément\dots + \item Second élément… \end{itemize} \end{minipage}}\par } @@ -1265,15 +1271,15 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \begin{minipage}[t]{.45\textwidth} \fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright \FBListItemsAsParfalse \parindent=0pt \listindentFB=1.5em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{itemize} - \item Premier élément sur plus d’une ligne\dots{} + \item Premier élément sur plus d’une ligne… \begin{itemize} \item Un élément niveau 2, \item Second élément niveau 2, \end{itemize} - \item Second élément\dots + \item Second élément… \end{itemize} \end{minipage} }\\ @@ -1284,15 +1290,15 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \hspace*{\fill} \fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 \FBListItemsAsParfalse \parindent=0em \listindentFB=0em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{itemize} - \item Premier élément sur plus d’une ligne\dots{} + \item Premier élément sur plus d’une ligne… \begin{itemize} \item Un élément niveau 2, \item Second élément niveau 2, \end{itemize} - \item Second élément\dots + \item Second élément… \end{itemize} \end{minipage} }\hspace*{\fill}\\ @@ -1312,15 +1318,15 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \begin{minipage}[t]{.45\textwidth} \fbox{\begin{minipage}[t]{.9\textwidth}\raggedright \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{enumerate} - \item Premier élément sur plus d’une ligne\dots{} + \item Premier élément sur plus d’une ligne… \begin{enumerate} \item Un élément niveau 2, \item Second élément niveau 2, \end{enumerate} - \item Second élément\dots + \item Second élément… \end{enumerate} \end{minipage} }\\ @@ -1334,16 +1340,16 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \hspace*{\fill} \fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{enumerate} - \item Premier élément sur plus d’une ligne\dots{} + \item Premier élément sur plus d’une ligne… \settowidth{\labelwidthFB}{(a)}% \begin{enumerate} \item Un élément niveau 2, \item Second élément niveau 2, \end{enumerate} - \item Second élément\dots + \item Second élément… \end{enumerate} \end{minipage} }\hspace*{\fill}\\ @@ -1367,15 +1373,15 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright \FBListItemsAsParfalse \parindent=0pt \listindentFB=1.5em \descindentFB=1.5em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{description} - \item [Premier] élément occupant plus d’une ligne\dots{} + \item [Premier] élément occupant plus d’une ligne… \begin{itemize} \item Un élément niveau 2, \item Second élément niveau 2, \end{itemize} - \item [Second] élément\dots + \item [Second] élément… \end{description} \end{minipage} }\\ @@ -1387,15 +1393,15 @@ listes \env{itemize}, \env{enumerate} et \env{description} : \fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 \FBListItemsAsParfalse \parindent=0pt \listindentFB=1.5em \descindentFB=0pt - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} Marge gauche\par Paragraphe précédant la liste \begin{description} - \item [Premier] élément occupant plus d’une ligne\dots{} + \item [Premier] élément occupant plus d’une ligne… \begin{itemize} \item Un élément niveau 2, \item Second élément niveau 2, \end{itemize} - \item [Second] élément\dots + \item [Second] élément… \end{description} \end{minipage} }\hspace*{\fill}\\ @@ -1424,7 +1430,7 @@ sections~\ref{sec:description} (listes \env{itemize}) et \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 + \noindent\LEFTmargin{} 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… @@ -1432,7 +1438,7 @@ sections~\ref{sec:description} (listes \env{itemize}) et \item Un élément niveau 2, \item Second élément niveau 2 sur plus d’une ligne… \end{itemize} - \item Second élément\dots + \item Second élément… \end{itemize} \end{minipage} }\\ @@ -1443,7 +1449,7 @@ sections~\ref{sec:description} (listes \env{itemize}) et \hspace*{\fill} \fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72 \FBListItemsAsPartrue \parindent=1.5em \listindentFB=1.5em - \noindent$\Leftarrow$ Marge gauche\par + \noindent\LEFTmargin{} 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… @@ -1451,7 +1457,7 @@ sections~\ref{sec:description} (listes \env{itemize}) et \item Un élément niveau 2, \item Second élément niveau 2 sur plus d’une ligne… \end{itemize} - \item Second élément\dots + \item Second élément… \end{itemize} \end{minipage} }\hspace*{\fill}\\ @@ -1515,7 +1521,7 @@ 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 +voir p.~\pageref{listspacing}. 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 @@ -1751,7 +1757,7 @@ avec ces moteurs% 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 +actifs ne perturbent pas les autres extensions… 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 diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.dtx b/macros/latex/contrib/babel-contrib/french/frenchb.dtx index 4f9697f12d..4941b1cea7 100644 --- a/macros/latex/contrib/babel-contrib/french/frenchb.dtx +++ b/macros/latex/contrib/babel-contrib/french/frenchb.dtx @@ -13,12 +13,12 @@ %\ProvidesLanguage{frenchb} %--[[ % File `frenchb.lua’ generated from frenchb.dtx - [2020/01/30 v3.5g French support from the babel system] + [2020/04/18 v3.5h French support from the babel system] %<*internal> \iffalse % %<*lua> - Copyright © 2014-2019 Daniel Flipo + Copyright © 2014-2020 Daniel Flipo License LPPL: see french.ldf. --]] @@ -32,7 +32,7 @@ %<*dtx|french> %% %% Babel package for LaTeX version 2e -%% Copyright © 1996-2019 +%% Copyright © 1996-2020 %% by Daniel Flipo %% % @@ -43,22 +43,38 @@ % %<*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[left=38mm,right=38mm,top=30mm,bottom=50mm]{geometry} \usepackage[dvipsnames]{xcolor} +\usepackage[no-math]{fontspec} +\usepackage{realscripts} +\setmainfont{FiraSans}[ + Extension = .otf , + UprightFont = *-Book, + ItalicFont = *-BookItalic, + BoldFont = *-Medium, + BoldItalicFont = *-MediumItalic, + SmallCapsFont = FiraSans-Book, + SmallCapsFeatures = {Letters=SmallCaps}, + ] +\setmonofont{FiraMono}[ + Extension = .otf , + UprightFont = *-Regular, + ItalicFont = *-Oblique, + BoldFont = *-Medium, + BoldItalicFont = *-MediumOblique, + Scale = MatchLowercase, + ] +% \def\PrintMacroName#1{% \strut\MacroFont\color{Sepia}\normalsize\string#1} +\def\ColorArg{\color{Sepia}} \usepackage[expansion=true,protrusion=true]{microtype} -\def\ColorArg{\color{PineGreen}} -\usepackage{url} +\usepackage{array,url} \usepackage[numbered]{hypdoc} -\hypersetup{colorlinks,urlcolor=blue,unicode} +\hypersetup{colorlinks,urlcolor=Blue,linkcolor=Blue,unicode} \newcommand*{\hlabel}[1]{\phantomsection\label{#1}} -\newcommand*\babel{\textsf{babel}} -\newcommand*\frenchb{\textsf{babel-french}} +\newcommand*\babel{\texttt{Babel}} +\newcommand*\frenchb{\texttt{babel-french}} \newcommand*\file[1]{\texttt{#1}} \newcommand*\cls[1]{\texttt{#1}} \newcommand*\pkg[1]{\texttt{#1}} @@ -70,7 +86,7 @@ \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}} + \hspace{\labelsep}\normalfont \fbo{#1}} \let\up\textsuperscript \newcommand*{\FRguillspace}{\penalty 10000 \hskip.8\fontdimen2\font @@ -331,7 +347,7 @@ % \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 +% like |\fg|, |\ier|, |\ieme|, |\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|). @@ -370,12 +386,14 @@ % \frenchb{} is loaded as the \emph{last} option of \babel{} % ---\babel’s \emph{main language}---, and is toggled otherwise. % \begin{description} +% \setlength{\labelsep}{0.1666em} % \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: @@ -385,10 +403,12 @@ % 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 @@ -411,12 +431,12 @@ % \noindent<= Leftmargin\par % \textemdash{} first item running on two % \hspace*{\parindent}\hspace*{\labelwidth} -% lines or more\dots{}\par +% lines or more…\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 +% item \hspace*{\parindent}\hspace*{\labelwidth}% +% \hspace*{\labelwidth} on two lines…\par +% \hspace*{\labelwidth} \textemdash{} next one…\par +% \textemdash{} second item… % }} % \hfill \hlabel{ListAsPar}% % \fbox{\parbox[t]{.4\textwidth}{\raggedright @@ -426,14 +446,15 @@ % Text starting at `parindent’ \\ % \noindent<= Leftmargin\par % \textemdash{} first item running on two -% lines or more\dots{}\par +% lines or more…\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 +% item \hspace*{\parindent}on two lines…\par +% \hspace*{\labelwidth} \textemdash{} next one…\par +% \textemdash{} second item… % }}\par -% Default French layout% -% \hspace{\fill}With \fbo{ListItemsAsPar=true}% +% \hspace*{3em} Default French layout% +% \hspace{\fill}With \fbo{ListItemsAsPar=true} \hspace*{1em} +% % \item [StandardListSpacing=true (false*)]% % \footnote{This option should be used instead of former option % \fbo{ReduceListSpacing} (kept for backward compatibility) which @@ -449,35 +470,43 @@ % 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 [StandardEnumerateEnv=true (false*)]; \frenchb{} redefines +% \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}*)];\\ +% \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}|. +% one for a specific level only. Note that \fbo{\cs{ding\{43\}}} +% requires loading the \pkg{pifont} package. +% % \item [ItemLabeli=\cs{textbullet}, \cs{textendash}, -% \cs{ding\{43\}},...(\cs{textemdash}*)] +% \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}*)] +% \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}*)] +% \cs{ding\{43\}} (\cs{textemdash}*)]\hfill +% % \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 @@ -485,6 +514,7 @@ % 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). @@ -500,6 +530,7 @@ % 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} @@ -538,17 +569,20 @@ % 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 +% +% \item [ThinColonSpace=true (false)] changes the % 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. @@ -568,13 +602,15 @@ % 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 +% 8-bits encoding (latin1, latin9, ansinew, applemac,…) 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 @@ -592,6 +628,7 @@ % 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 @@ -615,11 +652,14 @@ % \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 +% +% \item [OldFigTabCaptions=true (false)] is to be used \emph{only} +% 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. @@ -629,10 +669,12 @@ % 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 @@ -664,6 +706,7 @@ % \subsubsection{Figure and table captions} % \label{sssec-captions-fig} % +% \enlargethispage{-\baselineskip} % 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), @@ -923,7 +966,7 @@ % generated from frenchb.dtx.} % % \clearpage -% \newgeometry{left=53mm,right=25mm} +% \newgeometry{left=50mm,right=23mm} % % \section{The code} % @@ -1404,8 +1447,8 @@ \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 +% When first entering French, we have to set the LuaTeX +% tables for French (|\FB@dialect=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! @@ -1695,6 +1738,7 @@ local GLYPH = node_id("glyph") local PENALTY = node_id("penalty") local nobreak = new_node(PENALTY) nobreak.penalty = 10000 +local nbspace = new_node(GLYPH) local insert_node_before = node.insert_before local insert_node_after = node.insert_after local remove_node = node.remove @@ -1829,7 +1873,15 @@ local has_attribute = node.has_attribute % adding code with add\_to\_callback actually deletes the legacy % kerning as pointed out by Marcel Krüger on SE.} % +% \changes{v3.5h}{2020/03/28}{Added glues and penalties should inherit +% attributes from the related punctuation character; this is +% mandatory for Lua-UL to underline and highlight them. +% Thanks to Marcel Krüger for providing the fix.} +% +% \changes{v3.5h}{2020/04/10}{Code reorganised for better efficiency.} +% % \begin{macrocode} +-- Main function (to be added to the kerning callback). local function french_punctuation (head) % \end{macrocode} % Restore the built-in kerning for 8-bits fonts. @@ -1838,29 +1890,32 @@ 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} +% Skip glyphs not concerned by French kernings. +% \begin{macrocode} + if (lang == FR_fr or lang == FR_ca) and + (FB_punct_left[char] or FB_punct_right[char]) then + local fid = item.font + local attr = item.attr + 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 FRspacing and fid > 0 then + if FB_punct_left[char] 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 @@ -1875,12 +1930,12 @@ local function french_punctuation (head) % 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 + 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 @@ -1909,63 +1964,66 @@ local function french_punctuation (head) % 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) + 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 + if (realglue or auto) and fbglue then + if realglue then + head = remove_node(head,prev,true) + end + if (FRucsNBSP) then + nbspace.font = fid + nbspace.attr = attr + insert_node_before(head,item,copy_node(nbspace)) + else + nobreak.attr = attr + fbglue.attr = attr + 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} @@ -1987,40 +2045,45 @@ local function french_punctuation (head) % `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) - ) + 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)) + 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 + nbspace.attr = attr + insert_node_before(head,item,copy_node(nbspace)) + else + nobreak.attr = attr + fbglue.attr = attr + insert_node_before(head,item,copy_node(nobreak)) + insert_node_before(head,item,copy_node(fbglue)) + end + end 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 @@ -2038,66 +2101,70 @@ local function french_punctuation (head) % 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 + elseif 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 + 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 - 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) + 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)) + 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 + nbspace.attr = attr + insert_node_after(head, item, copy_node(nbspace)) + else + nobreak.attr = attr + fbglue.attr = attr + insert_node_after(head, item, copy_node(fbglue)) + insert_node_after(head, item, copy_node(nobreak)) + end + end end end end @@ -2132,9 +2199,10 @@ return french_punctuation 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}% + \PackageWarning{french.ldf}{\protect\shorthandoff{;:!?} + is helpless with LuaTeX,\MessageBreak + use \protect\NoAutoSpacing \space *inside a group* + instead;\MessageBreak reported}% \fi}% \def\shorthandon##1{}% } @@ -2215,9 +2283,9 @@ return french_punctuation % \begin{macrocode} \ifFB@xetex@punct \ifLaTeXe - \PackageInfo{french.ldf}{No need for active punctuation characters% - \MessageBreak with this version of XeTeX!% - \MessageBreak reported} + \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!} @@ -2332,9 +2400,10 @@ return french_punctuation 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}% + \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} @@ -2354,7 +2423,7 @@ return french_punctuation % 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 +% when \fbo{AutoSpacePunctuation} is true: % |\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. @@ -2509,7 +2578,6 @@ return french_punctuation \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. @@ -2552,14 +2620,15 @@ return french_punctuation % 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{}. +% {\sloppypar |\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{}.\par} +% % Set the default now for Plain (done later for LaTeX). % \begin{macrocode} \def\autospace@beforeFDP{% @@ -2668,7 +2737,7 @@ return french_punctuation % \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 +% encodings (T1, LY1,…) 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 @@ -2821,7 +2890,8 @@ return french_punctuation % use \cs{babel@save} instead.} % % \begin{macrocode} -\addto\extrasfrench{\babel@save\og \babel@save\fg \bbl@frenchguillemets} +\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 @@ -2831,7 +2901,7 @@ return french_punctuation % 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{} +% or two of quotes… % \begin{macrocode} \newcommand*{\ogi}{\FB@og} \newcommand*{\fgi}{\FB@fg} @@ -3102,7 +3172,7 @@ return french_punctuation % % \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} +% characters in encodings like applemac, utf-8,…} % % |\up| eases the typesetting of superscripts like % `1\up{er}’. Up to version 2.0 of \frenchb{} |\up| was just a @@ -3162,7 +3232,7 @@ return french_punctuation % 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 +% Palatino, …) stored in |\FB@firstthree| and the rest stored % in |\FB@suffix| which is expected to be `|x|’ or `|j|’ for expert % fonts. % \begin{macrocode} @@ -3272,7 +3342,7 @@ return french_punctuation % \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 +% of \cs{FrenchEnumerate}, … \cs{No} and co: \cs{up} already % does the conversion.} % % And some more macros relying on |\up| for numbering, @@ -3542,7 +3612,7 @@ return french_punctuation % \frenchb{} v.~1.x.\ about the change: % \begin{macrocode} \newcommand*{\nombre}[1]{{#1}\fb@warning{*** \noexpand\nombre - no longer formats numbers\string! ***}} + no longer formats numbers\string! ***}} % \end{macrocode} % \end{macro} % @@ -3644,10 +3714,10 @@ return french_punctuation % \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}). +% |\figurename| and |\tablename| are printed in small caps in French, +% unless either \fbo{SmallCapsFigTabCaptions} is set to \fbo{false} +% or a class or package loaded before \frenchb{} defines +% |\FBfigtabshape| as |\relax|. % \begin{macrocode} \providecommand*{\FBfigtabshape}{\scshape} % \end{macrocode} @@ -3701,8 +3771,8 @@ return french_punctuation \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,% + \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} @@ -3756,7 +3826,7 @@ return french_punctuation % 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). +% ua-thesis.cls… 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 @@ -3936,7 +4006,7 @@ return french_punctuation \ifnum\value{FBcaption@count}>0 % \end{macrocode} % \file{caption3.sty} has been loaded \emph{before} babel, maybe by -% the class\dots +% the class… % \begin{macrocode} \FBWarning {Figures' and tables' captions might look like\MessageBreak @@ -3968,7 +4038,7 @@ return french_punctuation } % \end{macrocode} % -% \subsection{Dots\dots} +% \subsection{Dots…} % \label{ssec-dots} % % \begin{macro}{\FBtextellipsis} @@ -4104,16 +4174,17 @@ return french_punctuation % 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). +% {\sloppypar 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).\par} % % \begin{macro}{\frenchsetup} % Let’s now define this command which reads and sets the options @@ -4603,7 +4674,7 @@ return french_punctuation % 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 +% it can be single-byte (latin1, latin9, applemac,…) 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} @@ -4679,7 +4750,7 @@ return french_punctuation \DeclareInputText{\the\@tempcnta}{\FB@@og}% \else % \end{macrocode} -% Package \pkg{inputenc} not loaded, no way\dots{} +% Package \pkg{inputenc} not loaded, no way… % \begin{macrocode} \FBWarning{Option `og' requires package inputenc;\MessageBreak reported}% @@ -4936,7 +5007,7 @@ return french_punctuation % \begin{macrocode} \ifFBShowOptions \GenericWarning{* }{% - ***** List of possible options for babel-french ****\MessageBreak + *** List of possible options for babel-french ***\MessageBreak [Default values between brackets when french is loaded *LAST*]% \MessageBreak ShowOptions [false]\MessageBreak @@ -5079,9 +5150,9 @@ return french_punctuation % \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 +% Finally, with pdfLaTeX, when OT1 encoding is in use at the +% |\begin{document}| a warning is issued; |\encodingdefault| +% being defined as `long’, the test would fail if |\FBOTone| was % defined with |\newcommand*|! % \begin{macrocode} \begingroup @@ -5117,7 +5188,7 @@ return french_punctuation % 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{} +% |abstract|, |quotation|, |quote| and |verse|… % % The amount of vertical space before and after a list is given by % |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new @@ -5157,8 +5228,8 @@ return french_punctuation % \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 +% levels. The item label to be used in French, stored in +% |\FrenchLabelItem}|, 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; @@ -5239,7 +5310,8 @@ return french_punctuation \advance\itemindent by \labelsep \leftmargini\z@ \bbl@for\FB@dp {2, 3, 4, 5, 6}% - {\csname leftmargin\romannumeral\FB@dp\endcsname=\labelindentFB}% + {\csname leftmargin\romannumeral\FB@dp\endcsname = + \labelindentFB}% \else % \end{macrocode} % Default layout: labels hanging into the left margin. @@ -5247,11 +5319,12 @@ return french_punctuation \leftmarginFB=\labelwidthFB \advance\leftmarginFB by \labelsep \bbl@for\FB@dp {1, 2, 3, 4, 5, 6}% - {\csname leftmargin\romannumeral\FB@dp\endcsname=\leftmarginFB}% + {\csname leftmargin\romannumeral\FB@dp\endcsname = + \leftmarginFB}% \advance\leftmargini by \listindentFB \fi - \leftmargin=\csname leftmargin\ifnum\@listdepth=\@ne i\else - ii\fi\endcsname + \leftmargin=\csname leftmargin% + \ifnum\@listdepth=\@ne i\else ii\fi\endcsname } % \end{macrocode} % \end{macro} @@ -5617,7 +5690,7 @@ return french_punctuation \let\@makefntextORI\@makefntext \let\@@makefnmarkORI\@@makefnmark % \end{macrocode} -% |\@makefntextFB| and |\@@makefnmarkFB| will be used when option +% |\@makefntextFB| and |\@@makefnmarkFB| are used when option % \fbo{FrenchFootnotes} is \fbo{true}. % \begin{macrocode} \deffootnote[\FBfnindent]{0pt}{\parindentFFN}% @@ -5956,4 +6029,5 @@ return french_punctuation %%% Local Variables: %%% fill-column: 72 %%% coding: utf-8 +%%% TeX-engine: luatex %%% End: diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.pdf b/macros/latex/contrib/babel-contrib/french/frenchb.pdf index c1454ccc36..f6b1da437c 100644 Binary files a/macros/latex/contrib/babel-contrib/french/frenchb.pdf and b/macros/latex/contrib/babel-contrib/french/frenchb.pdf differ -- cgit v1.2.3