From e5db423bac837a15f88a6ed1f46540d852b4ce46 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 2 Apr 2019 21:11:24 +0000 Subject: babel-french (2apr19) git-svn-id: svn://tug.org/texlive/trunk@50711 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/generic/babel-french/frenchb.dtx | 137 +++++++++++++-------- 1 file changed, 89 insertions(+), 48 deletions(-) (limited to 'Master/texmf-dist/source/generic/babel-french') diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx index 6d45a57fd25..d916f838aca 100644 --- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx +++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx @@ -1,4 +1,4 @@ -%\CheckSum{3724} +%\CheckSum{3769} % %\iffalse % Tell the LaTeX system who we are and write an entry on the @@ -13,7 +13,7 @@ %\ProvidesLanguage{frenchb} %--[[ % File `frenchb.lua’ generated from frenchb.dtx - [2019/01/30 v3.5d French support from the babel system] + [2019/03/30 v3.5e French support from the babel system] %<*internal> \iffalse % @@ -227,12 +227,17 @@ % 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. 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}.\hlabel{frquote} +% 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. @@ -362,19 +367,16 @@ % \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. This option can be used to avoid -% conflicts with classes or packages which customise lists or -% footnotes.\par -% When French is not the main language, \fbo{StandardLayout=false} -% can be misused to ensure French typography (in French only). -% This is a \emph{bad practice}: the document layout should not -% be altered by language switches. -% \item [GlobalLayoutFrench=false (true*)] should no longer be -% used; it was intended to emulate, when French is the main -% language, what prior versions of \frenchb{} (pre-2.2) did: -% lists, and first paragraphs of sections would be displayed +% 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. Note that the layout of footnotes is +% 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} @@ -748,9 +750,14 @@ % |\frquote{}|; it showed up when |\frquote{}| immediately followed % a sectionning command. % -% Starting with version 3.5d, a new option \fbo{StandarListSpacing} +% 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 @@ -2800,8 +2807,12 @@ return french_punctuation % \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: % @@ -2878,7 +2889,7 @@ return french_punctuation \def\FBeverypar@quote{\FBeveryparguill\FB@guillspace}% \FB@addquote@everypar \fi - \ogi #1\fgi + \@ogi #1\@fgi \or % \end{macrocode} % This for level 2 (inner) quotations: Omega’s command @@ -2891,18 +2902,23 @@ return french_punctuation % \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{\guillemotleft\FB@guillspace}% + \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotleft + \FB@guillspace}% \localleftbox{\FBeveryline@quote}% \let\FBeverypar@quote\relax - \ogi #1\ifFBcloseguill\fgi\fi + \@ogi #1\ifFBcloseguill\@fgi\fi \else \ifx\FBeverylineguill\FBguillclose - \def\FBeveryline@quote{\guillemotright\FB@guillspace}% + \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotright + \FB@guillspace}% \localleftbox{\FBeveryline@quote}% \let\FBeverypar@quote\relax - \ogi #1\ifFBcloseguill\fgi\fi + \@ogi #1\ifFBcloseguill\@fgi\fi \else % \end{macrocode} % otherwise we need to redefine |\FBeverypar@quote| (and eventually @@ -2921,7 +2937,7 @@ return french_punctuation \def\FBeverypar@quote{\guilsinglright\FB@guillspace}% \fi \fi - \ogii #1\ifFBcloseguill \fgii \fi + \@ogii #1\ifFBcloseguill \@fgii \fi \fi \fi \else @@ -2938,16 +2954,29 @@ return french_punctuation \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} - \advance\FBguill@level by \m@ne - \ifcase\FBguill@level \let\FBeverypar@quote\relax - \or \def\FBeverypar@quote{\FBeveryparguill\FB@guillspace}% - \let\FBeveryline@quote\empty + \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} @@ -4111,7 +4140,7 @@ return french_punctuation % lists’ items ``as paragraphs’’.} % % \changes{v3.5d}{2019/01/24}{ReduceListSpacing option depreciated: see -% StandarListSpacing.} +% StandardListSpacing.} % % \begin{macrocode} \newcommand*{\frenchsetup}[1]{% @@ -4208,6 +4237,10 @@ return french_punctuation % \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 @@ -4263,8 +4296,19 @@ return french_punctuation \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]% - {\csname FBStandardLayout#1\endcsname + {\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 @@ -4284,24 +4328,20 @@ return french_punctuation \FBAutoSpaceFootnotestrue \fi}% \define@key{FB}{GlobalLayoutFrench}[true]% - {\csname FBGlobalLayoutFrench#1\endcsname + {\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. Warn and reset in case this key -% is set to true while the main language is \emph{not} French. +% |\babel@save| will do the job. % \begin{macrocode} - \ifFBGlobalLayoutFrench - \ifFB@mainlanguage@FR - \else - \FBGlobalLayoutFrenchfalse - \PackageWarning{french.ldf}% - {Option `GlobalLayoutFrench' skipped:\MessageBreak - French is *not* babel's last option.\MessageBreak - Reported}% - \fi - \fi}% \define@key{FB}{ReduceListSpacing}[true]% {\csname FBReduceListSpacing#1\endcsname \ifFBReduceListSpacing \FBStandardListSpacingfalse @@ -5127,10 +5167,11 @@ return french_punctuation % lists’ items can be typeset as paragraphs with indented labels % while the default leaves the labels hanging into the left margin.} % -%\begin{macro}{\FB@listHsettings} % \begin{macro}{\leftmarginFB} +% \begin{macro}{\FB@listHsettings} % |\FB@listHsettings| holds the new horizontal settings chosen for -% French lists itemize and enumerate (two possible layouts). +% French lists \env{itemize}, \env{enumerate} and \env{description} +% (two possible layouts). % \begin{macrocode} \newdimen\leftmarginFB \def\FB@listHsettings{% -- cgit v1.2.3