summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/babel/frenchb.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/generic/babel/frenchb.dtx')
-rw-r--r--Master/texmf-dist/source/generic/babel/frenchb.dtx3489
1 files changed, 1572 insertions, 1917 deletions
diff --git a/Master/texmf-dist/source/generic/babel/frenchb.dtx b/Master/texmf-dist/source/generic/babel/frenchb.dtx
index 2ec83b51865..803f3dcd3df 100644
--- a/Master/texmf-dist/source/generic/babel/frenchb.dtx
+++ b/Master/texmf-dist/source/generic/babel/frenchb.dtx
@@ -1,9 +1,6 @@
% \iffalse meta-comment
%
-% Patched by Heiko Oberdiek for project latex-tds:
-% * 2006/06/02: Documentation bug: "!" cannot be used inside \changes.
-%
-% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
% listed elsewhere in this file. All rights reserved.
%
% This file is part of the Babel system.
@@ -29,7 +26,7 @@
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
-% \CheckSum{1985}
+% \CheckSum{1809}
%
% \iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
@@ -40,7 +37,7 @@
%<code>\ProvidesLanguage{french}
%\ProvidesFile{frenchb.dtx}
%<*!cfg>
- [2005/02/06 v1.6g French support from the babel system]
+ [2007/10/05 v2.0e French support from the babel system]
%</!cfg>
%<*cfg>
%% frenchb.cfg: configuration file for frenchb.ldf
@@ -48,12 +45,12 @@
%</cfg>
%% File `frenchb.dtx'
%% Babel package for LaTeX version 2e
-%% Copyright (C) 1989 - 2005
+%% Copyright (C) 1989 - 2007
%% by Johannes Braams, TeXniek
%
%<*!cfg>
%% Frenchb language Definition File
-%% Copyright (C) 1989 - 2005
+%% Copyright (C) 1989 - 2007
%% by Johannes Braams, TeXniek
%% Daniel Flipo, GUTenberg
%
@@ -63,12 +60,15 @@
%
% This file is part of the babel system, it provides the source
% code for the French language definition file.
-% For differences with francais.sty (author J. Braams) and with
-% french.sty (author B. Gaulle), see documentation printed by
-% |latex frenchb.dtx|.
%
%<*filedriver>
\documentclass[a4paper]{ltxdoc}
+\DeclareFontEncoding{T1}{}{}
+\DeclareFontSubstitution{T1}{lmr}{m}{n}
+\DeclareTextCommand{\guillemotleft}{OT1}{%
+ {\fontencoding{T1}\fontfamily{lmr}\selectfont\char19}}
+\DeclareTextCommand{\guillemotright}{OT1}{%
+ {\fontencoding{T1}\fontfamily{lmr}\selectfont\char20}}
\newcommand*\TeXhax{\TeX hax}
\newcommand*\babel{\textsf{babel}}
\newcommand*\langvar{$\langle \mathit lang \rangle$}
@@ -88,34 +88,34 @@
%\fi
% \GetFileInfo{frenchb.dtx}
%
-% \changes{frenchb-1.1}{1995/12/23}{Added a hook to insert space or
-% not before `double punctuation'.}
-%
-% \changes{frenchb-1.1b}{1996/08/07}{Replaced \cs{undefined} with
-% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
-% with \LaTeX}
-%
-% \changes{frenchb-1.1b}{1996/10/10}{Moved the definition of
-% \cs{atcatcode} right to the beginning.}
-%
-% \changes{frenchb-1.3f}{1999/04/11}{Deleted sectioning command
-% \cs{section}\{About French Typography\}.}
-%
% \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.}, derived from \file{frenchy.sty}, defines all
-% the language definition macros for the French language.
+% \filedate.}, defines all the language definition macros for the
+% French language.
%
-% Customization for the French language is achieved following the
+% Customisation for the French language is achieved following the
% book ``Lexique des r\`egles typographiques en usage \`a
% l'Imprimerie nationale'' troisi\`eme \'edition (1994),
% ISBN-2-11-081075-0.
%
-% This file has been designed to be used with \LaTeXe, \LaTeX-2.09
-% and Plain\TeX{} formats. If you are still using \LaTeX-2.09, you
-% \emph{should} consider switching to \LaTeXe!
+% First version released: 1.1 (1996/05/31) as part of
+% \babel-3.6beta.
+%
+% |frenchb| has been improved using helpful suggestions from many
+% people, mainly from Jacques Andr\'e, Michel Bovani, Thierry Bouche,
+% and Vincent Jalby. Thanks to all of them!
+%
+% This new version (2.0) has been designed to be used with \LaTeXe{}
+% and Plain\TeX{} formats only. \LaTeX-2.09 is no longer supported.
+% Changes between version 1.6 and 2.0 are listed in
+% subsection~\ref{ssec-changes} p.~\pageref{ssec-changes}.
+%
+% An extensive documentation is available in French here:\\
+% |http://daniel.flipo.free.fr/frenchb|
+%
+% \subsection{Basic interface}
%
% The command |\selectlanguage{french}| switches to the French
% language%
@@ -125,29 +125,20 @@
% with the following effects:
% \begin{enumerate}
% \item French hyphenation patterns are made active;
-% \item `double punctuation' is made active for correct spacing
-% in French;
+% \item `double punctuation' (|:| |;| |!| |?|) is made active for
+% correct spacing in French;
% \item |\today| prints the date in French;
% \item the caption names are translated into French
% (\LaTeX{} only);
% \item the default items in itemize environment are set to `--'
-% instead of \textbullet, and all vertical spacing and glue
-% is deleted, a hook to reset standard \LaTeX{} spacing
-% is provided (|\FrenchItemizeSpacingfalse|);
+% instead of `\textbullet', and all vertical spacing and glue
+% is deleted, hooks to reset standard \LaTeX{} settings
+% are provided (see |\frenchbsetup{}|);
% it is possible to change `--' to something else (`---'
-% for instance) by redefining |\FrenchLabelItem|;
-% apart from the global hook |\FrenchLabelItem|, it is
-% also possible to change the `labelitems' at any level
-% (1 to 4) in French, using the standard \LaTeX{} syntax,
-% for instance: |\renewcommand{\labelitemii}{\textbullet}|;
-% in order to be effective in French, the redefinitions
-% have to be made when French is the current language
-% (i.e.\ \emph{after} the |\begin{document}|), the changes are
-% saved when switching to another language and will be
-% remembered of, when switching back to French;
+% for instance) using |\frenchbsetup{}|;
% \item vertical spacing in general \LaTeX{} lists is
% shortened, a hook to reset standard \LaTeX{} settings
-% is provided (|\FrenchListSpacingfalse|) ;
+% is provided (see |\frenchbsetup{}|);
% \item the first paragraph of each section is indented
% (\LaTeX{} only);
% \item the space after |\dots| is removed in French.
@@ -157,23 +148,25 @@
% easier:
% \begin{enumerate}
% \item French quotation marks can be entered using the commands
-% |\og| and |\fg| which work in \LaTeXe, \LaTeX-2.09 and
-% Plain\TeX{}, their appearance depending on what is
-% available to draw them; if you use \LaTeXe{} \emph{and}
-% |T1|-encoding you can also enter them as
-% |<<~French quotation marks~>>| but then
-% \emph{don't forget} the unbreakable spaces, (|\og| and
-% |\fg| provide for correct line breaks and better
-% horizontal spacing).
-% |\og| and |\fg| can be used outside French, they provide
+% |\og| and |\fg| which work in \LaTeXe and Plain\TeX,
+% their appearance depending on what is available to draw
+% them; even if you use \LaTeXe{} \emph{and} |T1|-encoding,
+% you should refrain from entering them as
+% |<<~French quotation marks~>>|: |\og| and |\fg| provide
+% better horizontal spacing.
+% |\og| and |\fg| can be used outside French, they typeset
% then English quotes `` and ''.
% \item A command |\up| is provided to typeset superscripts like
% |M\up{me}| (abbreviation for ``Madame''), |1\up{er}| (for
-% ``premier'').
+% ``premier''). Other commands are also provided for
+% ordinals: |\ier|, |\iere|, |\iers|, |\ieres|, |\ieme|,
+% |\iemes| (|3\iemes| prints 3\textsuperscript{es}).
% \item Family names should be typeset in small capitals and never
% be hyphenated, the macro |\bsc| (boxed small caps) does
% this, e.g., |Leslie~\bsc{Lamport}| will produce
-% Leslie~\mbox{\textsc{Lamport}}.
+% Leslie~\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|
% may be used to enumerate in lists.
% \item Abbreviations for ``Num\'ero'' and ``num\'ero'' are
@@ -193,17 +186,11 @@
% explicit space has to be added in lists and intervals:
% |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches back
% to the standard behaviour of the comma.
-% \item A command |\nombre| is provided to easily typeset numbers:
-% it works both in text and in math mode: inputting
-% |\nombre{3141,592653}| will format this number properly
-% according to the current language (French or non-French):
-% each slice of three digits will be separated either with
-% a comma in English or with a space in French (if you prefer
-% a thin space instead of a normal space, just add the command
-% |\ThinSpaceInFrenchNumbers| to the preamble of your document,
-% or to |frenchb.cfg|).
-% The command |\nombre| is a contribution of Vincent Jalby
-% using ideas of David Carlisle in comma.sty.
+% \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 |xspace|
% package if present: adding |\usepackage{xspace}| in the
% preamble will force macros like |\fg|, |\ier|, |\ieme|,
@@ -211,110 +198,154 @@
% for instance typing `|1\ier juin|' will print
% `1\textsuperscript{er} juin' (no need for a forced space
% after |1\ier|).
-% \item Two commands, |\FrenchLayout| and |\StandardLayout| (to be
-% used \emph{only in the preamble}) are provided to unify the
-% layout of multilingual documents (it mainly concerns lists)
-% regardless the current language (see section~\ref{sec-global}
-% for details).
-% \item Two commands |\AddThinSpaceBeforeFootnotes| and
-% |\FrenchFootnotes| enable to customize the layout of
-% footnotes following the French IN's specifications;
-% the first one, which can only be used \emph{before} the
-% |\begin{document}|, adds a thinspace in the running text
-% before the number or symbol calling the footnote; the
-% second one modifies the footnote's layout: it typesets
-% leading numbers as `1.\hspace{.5em}' instead of
-% `$\hbox{}^1$'. |\FrenchFootnotes| has no effect on footnotes
-% numbered with symbols (as in the |\thanks| command).
-%
-% None of these commands are active by default, both can
-% be best added to |frenchb.cfg| or to the preamble of the
-% document. |\FrenchFootnotes| and |\StandardFootnotes|,
-% which cancels the effect of |\FrenchFootnotes| for the
-% text coming next, can be used anywhere in the document.
-% The command |\StandardFootnotes| may be useful when
-% some footnotes are numbered with letters (inside minipages
-% for instance).
-%
-% |\AddThinSpaceBeforeFootnotes| and |\FrenchFootnotes| act
-% on \emph{all} footnotes whatever the current language is.
% \end{enumerate}
%
-% \vspace{\baselineskip}
-% All commands previously available in |francais.ldf| have been
-% included in |frenchb.ldf| for compatibility, sometimes with
-% updated definitions.
-%
-% The |french| package, by Bernard~\textsc{Gaulle}, was not
-% designed to run with \babel\ (although the latest versions claim
-% to be \babel\ compatible), but rather as a stand-alone package
-% for the French language.
-% It provides many more functionalities (like |\lettrine|,
-% |\sommaire|\dots) not available in |frenchb|,
-% at the cost of a much greater complexity and possible
-% incompatibilities with other languages.
-%
-% As |french| is known to produce the best layout available for
-% French typography, I have borrowed many ideas from Bernard's file.
-% I did my best to help users of both packages (|french| and
-% |frenchb|) to exchange their sources files easily (see the example
-% configuration file below in section~\ref{sec-cfg}), with one
-% exception which affects the way French quotation marks are
-% entered: |frenchb| uses \emph{macros} (|\og| and |\fg|) while
-% |french| uses active characters (|<<| and |>>|).
-%
-% \vspace{\baselineskip}
-% French typographic rules specify that some white space should be
-% present before `double punctuation' characters. These characters
-% are |;| |!| |?| and |:|.
-% In order to get this white space automatically, the category code
-% of these characters is made |\active|. In French, the user
-% \emph{should} input these four characters preceded with a space,
-% but as many people forget about it (even among native French
-% writers!), the default behaviour of |frenchb| is to automatically
-% add a |\thinspace| before `|;|' `|!|' `|?|' and a normal
-% (unbreakable) space before~`|:|' (this is the rule in French
-% typography). It's up to the user to add or not a space
-% \emph{after} `double punctuation' characters: usually a space is
-% necessary, but not always (before a full point or a closing brace
-% for instance), so this cannot done automatically.
-%
-% In (rare) cases where no space should be added before a `double
-% punctuation', either use |\string;| |\string:| |\string!|
-% |\string?| instead of |;| |:| |!| |?|, or switch locally to
-% English. For instance you can type |C\string:TEX| or
-% |\begin{otherlanguage}{english}{C:TEX}\end{otherlanguage}| to
-% avoid the space before~|:| in a MS-DOS path.
-%
-% Some users dislike this automatic insertion of a space before
-% `double punctuation', and prefer to decide themselves whether a
-% space should be added or not; so a hook |\NoAutoSpaceBeforeFDP|
-% is provided: if this command is added (in file |frenchb.cfg|, or
-% anywhere in a document) |frenchb| will respect your typing, and
-% introduce a suitable space before `double punctuation' \emph{if
-% and only if} a space is typed in the source file before those
-% signs.
-%
-% The command |\AutoSpaceBeforeFDP| switches back to the
-% default behaviour of |frenchb|.
-%
-% \vspace{\baselineskip}
+% \subsection{Customisation}
+% \label{ssec-custom}
+%
+% Up to version 1.6, customisation of |frenchb| was achieved
+% by entering commands in \file{frenchb.cfg}. This possibility
+% remains for compatibility, but \emph{should not longer be used}.
+% Version 2.0 introduces a new command |\frenchbsetup{}| using
+% the \file{keyval} syntax which should make it easier to choose
+% among the many options available. The command |\frenchbsetup{}|
+% is to appear in the preamble only (after loading \babel).
+%
+% \vspace{.5\baselineskip}
+% |\frenchbsetup{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 |ShowOptions|) can be entered as
+% |ShowOptions=true| or just |ShowOptions|, the `|=true|' part
+% can be omitted.
+%
+% \vspace{.5\baselineskip}
+% The other options are (their default value is shown between
+% brackets):
+% \begin{itemize}
+% \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 replaces the former
+% command |\StandardLayout|. It can be used either for unifying
+% the layout of a document so that it is no longer language
+% dependent or to avoid conflicts with classes or packages which
+% customise lists or footnotes.
+% \item |GlobalLayoutFrench=true [false]| is also meant for unifying
+% the layout of a document: lists typeset in other languages than
+% French look the same as in French and first paragraphs of
+% sections are all indented. Note that the layout of footnotes is
+% language independent anyway (see below |FrenchFootnotes| and
+% |AutoSpaceFootnotes|). This option replaces the former
+% command |\FrenchLayout|.
+% \item |AutoSpacePunctuation=false [true]|; in French, the user
+% \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 add a |\thinspace| before `|;|' `|!|' `|?|' and a
+% normal (unbreakable) space before~`|:|' (recommended by the
+% French Imprimerie nationale). This is convenient in most cases
+% but can lead to addition of spurious spaces in URLs or in MS-DOS
+% paths. Choosing |AutoSpacePunctuation=false| will ensure that
+% a proper space will be added before `|:;!?|' \emph{if and only
+% if} a (normal) space has been typed in. Those who are unsure
+% about their typing in this area should stick to the default
+% option and type |\string;| |\string:| |\string!| |\string?|
+% instead of |;| |:| |!| |?| whenever no space should be added
+% before them (mostly in URLs and MS-DOS paths).
+% \item |ThinColonSpace=true [false]| changes the normal
+% (unbreakable) space added before the colon `:' to a thin space,
+% so that the same amount of space is added before any of the
+% four double punctuation characters. The default setting is
+% supported by the French Imprimerie nationale.
+% \item |ReduceListSpacing=false [true]|; |frenchb| normally
+% reduces the values of the vertical spaces used in the
+% environment |list| in French; setting this option to |false|
+% reverts to the standard settings of |list|. This option
+% replaces the former command |\FrenchListSpacingfalse|.
+% \item |CompactItemize=false [true]|; |frenchb| normally
+% suppresses any vertical space between items of |itemize| lists
+% in French; setting this option to |false| reverts to the
+% standard settings of |itemize| lists. This option replaces
+% the former command |\FrenchItemizeSpacingfalse|.
+% \item |StandardItemLabels=true [false]| when set to |true| this
+% option stops |frenchb| from changing the labels in |itemize|
+% lists in French.
+% \item |ItemLabels=\textemdash|, |\textbullet|, |\ding{43}|,
+% \dots, |[\textendash]|; when |StandardItemLabels=false| (the
+% default), this option enables to choose the label used in
+% |itemize| lists for all levels. The next three options do
+% the same but each one for one level only. Note that the
+% example |\ding{43}| requires |\usepackage{pifont}|.
+% \item |ItemLabeli=\textemdash|, |\textbullet|, |\ding{43}|,
+% \dots,|[\textendash]|
+% \item |ItemLabelii=\textemdash|, |\textbullet|, |\ding{43}|,
+% \dots, |[\textendash]|
+% \item |ItemLabeliii=\textemdash|, |\textbullet|, |\ding{43}|,
+% \dots, |[\textendash]|
+% \item |ItemLabeliv=\textemdash|, |\textbullet|, |\ding{43}|,
+% \dots, |[\textendash]|
+% \item |StandardLists=true [false]| forbids |frenchb| to
+% customize any kind of list. Do activate the option
+% |StandardLists| when using classes or packages that customise
+% lists too (|enumitem|, |paralist|, \dots{}) to avoid conflicts.
+% This option is just a shorthand for |ReduceListSpacing=false|
+% and |CompactItemize=false| and |StandardItemLabels=true|.
+% \item |IndentFirst=false [true]|; |frenchb| normally forces
+% indentation of the first paragraph of sections (in French only).
+% When this option is set to |false|, the first paragraph of
+% will look the same in French and in English (not indented).
+% \item |FrenchFootnotes=false [true]| reverts to the standard
+% layout of footnotes. By default |frenchb| typesets leading
+% numbers as `1.\hspace{.5em}' instead of `$\hbox{}^1$', but
+% has no effect on footnotes numbered with symbols (as in the
+% |\thanks| command). The former commands |\StandardFootnotes|
+% and |\FrenchFootnotes| are still there, |\StandardFootnotes|
+% can be useful 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 |false| reverts
+% to the standard setting (no space added).
+% \item |PartNameFull=false [true]|; when true, |frenchb| numbers
+% the title of |\part{}| commands as ``Premi\`ere partie'',
+% ``Deuxi\`eme partie'' and so on. With some classes which change
+% the|\part{}| command (AMS and SMF classes do so), you will get
+% ``Premi\`ere partie~I'', ``Deuxi\`eme partie~II'' instead;
+% when this occurs, this option should be set to |false|,
+% part titles will then be printed as ``Partie I'', ``Partie II''.
+% \item |og=|\texttt{\guillemotleft}, |fg=|\texttt{\guillemotright};
+% 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
+% \texttt{\guillemotleft{} guillemets \guillemotright}, or
+% \texttt{\guillemotleft{}guillemets\guillemotright} (with or
+% without spaces), to get properly typeset French quotes.
+% This option requires \file{inputenc} to be loaded with the
+% proper encoding, it works with 8-bits encodings (latin1,
+% latin9, ansinew, applemac,\dots) and multi-byte encodings
+% (utf8 and utf8x).
+% \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
% \LaTeXe{} I suggest this:
% \begin{itemize}
% \item run the following file, with the encoding suitable for
% your machine (\textit{my-encoding} will be |latin1| for
-% \textsc{unix} machines and PCs running~Windows, |applemac|
-% for Macintoshs, or |cp850| for PCs running~DOS). \\[3mm]^^A\]
+% \textsc{unix} machines, |ansinew| for PCs running~Windows,
+% |applemac| or |latin1| for Macintoshs, or |utf8|\dots\\[3mm]^^A\]
% |%%% Test file for French hyphenation.|\\
% |\documentclass{article}|\\
% |\usepackage[|\textit{my-encoding}|]{inputenc}|\\
-% |\usepackage[T1]{fontenc} % Use EC fonts for French|\\
-% |%\usepackage{aeguill} % Uncomment this line and|\\
-% | % comment out the preceeding one|\\
-% | % to use AE virtual fonts.|\\
-% |\usepackage[francais]{babel}|\\
+% |\usepackage[T1]{fontenc} % Use LM fonts|\\
+% |\usepackage{lmodern} % for French|\\
+% |\usepackage[frenchb]{babel}|\\
% |\begin{document}|\\
% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
% |\showhyphens{|\texttt{signal container \'ev\'enement
@@ -339,335 +370,91 @@
% \item you get no hyphen at all in \texttt{\'ev\'e-ne-ment}, this
% probably means that you are using CM fonts and the macro
% |\accent| to produce accented characters.
-% Using EC fonts with built-in accented characters or Ml\TeX{}
-% with CM fonts avoids this type of mismatch.
+% Using 8-bits fonts with built-in accented characters avoids
+% this kind of mismatch.
% \end{itemize}
%
-% \vspace{\baselineskip}
-% |frenchb| has been improved using helpful suggestions from many
-% people, the main contributions came from Vincent~Jalby.
-% Thanks to all of them!
-%
-% \subsection*{Changes}
+% \textbf{Options' order} -- Please remember that options are read
+% in the order they appear inside the |\frenchbsetup| command.
+% Someone wishing that |frenchb| leaves the layout of lists
+% and footnotes untouched but caring for indentation of first
+% paragraph of sections could choose
+% |\frenchbsetup{StandardLayout,IndentFirst}| and get the expected
+% layout. Choosing |\frenchbsetup{IndentFirst,StandardLayout}|
+% would not lead to the expected result: option |IndentFirst| would
+% be overwritten by |StandardLayout|.
%
-% First version released: 1.1 as of 1996/05/31 part of
-% \babel-3.6beta.
-%
-% \textbf{Changes in version 1.1b}: update for \babel-3.6.
-%
-% \textbf{Changes in version 1.2}: new command |\nombre| to
-% format numbers; removed command |\fup| borrowed from the
-% |french| package (|\up| does a better job in \LaTeXe);
-% also removed aliases |\french| and |\english| (frenchb.cfg
-% is a better place for these).
-%
-% \textbf{Changes in version 1.3}:
-% \begin{itemize}
-% \item The `xspace' package, when present, now controls
-% spacing after all (sensible) macros, formerly `xspace'
-% worked on |\fg| (suggested by Vincent~Jalby);
-% \item spacing after opening and before closing guillemets
-% improved as suggested by Thierry~Bouche;
-% \item a replacement for poor looking guillemets in OT1 encoding
-% (\emph{math} fonts are used to emulate them) is provided
-% if the file |ot2wncyr.fd| is found: this file defines an
-% OT2 encoding using AMS Cyrillic fonts; these
-% have built-in guillemets, they are \emph{text} fonts,
-% are free, and are distributed as METAFONT and Type1 fonts
-% (good for pdftex!), the replacement was suggested by
-% G\'erard~Degrez; if the files |ot2wncyr.fd|, |wncy*.mf|,
-% |wncy*.tfm|, and |wncy*.pfb| aren't available on your
-% system, you \emph{should} get them from \mbox{CTAN};
-% if your system complains about missing |wncy*.tfm| fonts,
-% it means your \TeX{} system is \emph{incomplete}, as a
-% quick fix, you can either remove |ot2wncyr.fd| or add the
-% command |\LasyGuillemets| to the preamble of your document
-% or to |frenchb.cfg|, then |frenchb| will behave as it did
-% in the previous versions.\\
-% In case Cyrillic guillemets do not fit, it is possible
-% to pick French guillemets from any font using the
-% command |\FrenchGuillemetsFrom| which requires 4 arguments
-% |\FrenchGuillemetsFrom{|{\it coding}|}{|{\it font}\relax
-% |}{|{\it char-left}|}{|{\it char-right}|}|, for instance,
-% add |\FrenchGuillemetsFrom{T1}{ppl}{19}{20}| to the
-% preamble of your document or to |frenchb.cfg|, to pick
-% French guillemets from Palatino (fontname=ppl, char 19
-% and 20 are left and right guillemets in T1-encoding).
-% This was suggested by Michel~Bovani.
-% \item the environment `itemize' has been redesigned in French
-% according to specifications from Jacques~Andr\'e
-% and Thierry~Bouche; it is possible to switch back to the
-% settings of version~1.2: add |\FrenchItemizeSpacingfalse|
-% \emph{after} loading |frenchb| in the preamble (this can
-% be useful to process old documents);
-% \item two switches have been added to go back to standard
-% \LaTeX{} list spacing |\FrenchItemizeSpacingfalse|
-% and |\FrenchListSpacingfalse|;
-% \item |\nombre| now properly handles signs in \LaTeXe;
-% \item definition of |\dots| changed in French;
-% \item in French, with the standard \LaTeX{} classes, captions
-% in figures and tables are printed with an endash instead
-% of a colon.
-% \end{itemize}
-%
-% \textbf{Changes in version 1.4}:
-% \begin{itemize}
-% \item the redefinition of|\@makecaption| is changed not to
-% overwrite the changes made by some classes (koma-script,
-% amsart, ua-thesis\dots) as pointed out by Werner~Lemberg;
-% \item a hook, |\FrenchGuillemetsFrom|, is provided to pick
-% French guillemets from any font (suggested by
-% Michel~Bovani, works \emph{only} in OT1-encoding);
-% \item a hook, |\FrenchLabelItem|, is provided to enable marks
-% other than `--' (|\textendash|) in French lists
-% (also suggested by Michel~Bovani);
-% \item |\DecimalMathComma|, |\StandardMathComma|,
-% |\ThinSpaceInFrenchNumbers| added;
-% \item |\FrenchLayout| and |\StandardLayout| added;
-% \item an example of customization file |frenchb.cfg| is
-% included in |frenchb.dtx|.
-% \end{itemize}
+% \subsection{Changes}
+% \label{ssec-changes}
%
-% \textbf{Changes in version 1.5}:
-% \begin{itemize}
-% \item The settings for spacing in French lists are no longer
-% tuned at the |\@trivlist| level but within |\list|; this
-% enables the users to provide their own settings for the
-% lists they define with |\list| (suggested by P. Pichaureau).
-% Although the layout of the standard lists
-% \emph{has not changed}, some lists, based directly on
-% |\@trivlist| or |\trivlist|, could possibly be typeset
-% differently when upgrading from version 1.4 to 1.5.
-% The command |\FrenchOldTrivlisttrue| could then, be useful
-% to process older documents.
-% \item Apart from the global hook |\FrenchLabelItem|, it is
-% now also possible to change the `labelitems' at any level
-% (1 to 4) in French, using the standard \LaTeX{} syntax,
-% for instance: |\renewcommand{\labelitemii}{\textbullet}|.
-% \item The internal name for the French language has been
-% changed from |frenchb| to |french|, it means that
-% |\captionsfrench|, |\datefrench|, |\extrasfrench|,
-% |\noextrasfrench|, are to be used now instead of
-% |\captionsfrenchb|, |\datefrenchb|, |\extrasfrenchb|,
-% |\noextrasfrenchb|.
-% \item From version 1.5f on, it is possible to customize
-% the space inserted before a colon in French; its default
-% value is |\space| (as in previous versions of |frenchb|),
-% but it can now be changed to |\thinspace| by redefining
-% |\Fcolonspace|.
-% \end{itemize}
+% \subsubsection*{What's new in version 2.0?}
%
-% \textbf{Changes in version 1.6}:
+% Here is the list of all changes:
% \begin{itemize}
-% \item Two new commands are provided:
-% |\AddThinSpaceBeforeFootnotes| and |\FrenchFootnotes|;
-% they enable to typeset footnotes according to the
-% French IN's specifications (suggested by Jacques~Andr\'e).
-% \item |frenchb| will make use of |\textdegree| (TS1 encoding)
-% to typeset degrees whenever possible.
-% \item Default guillemets have been changed \emph{in OT1
-% encoding only} in version~1.6c: the former ones were picked
-% up in the wncyr fonts, which forced the cyrillic encoding to
-% OT2 when \babel{} was loaded with option |frenchb| before a
-% cyrillic language (|russian|, |ukrainian| or |bulgarian|).
-% Now, LM fonts for T1-encoding are available, we pick up the
-% guillemets from them, for OT1-encoding.
-% \item The config file |frenchb.cfg| is now loaded only when
-% \LaTeXe{} is used (from version~1.6g).
-% \item The command |\degres| now works also in math mode (from
-% version~1.6g), but not in bold versions (it is a text
-% character basically).
+% \item Support for \LaTeX-2.09 and for \LaTeXe{} in compatibility
+% mode has been dropped. This version is meant for \LaTeXe{} and
+% Plain based formats (like \file{bplain}). \LaTeXe{} formats
+% based on ml\TeX{} are no longer supported either (plenty of
+% good 8-bits fonts are available now, so T1 encoding should
+% be preferred for typesetting in French). A warning is issued
+% when OT1 encoding is in use at the |\begin{document}|.
+% \item Customisation should now be handled by command
+% |\frenchbsetup{}|, \file{frenchb.cfg} (kept for compatibility)
+% should no longer be used. See section~\ref{ssec-custom} for
+% the list of available options.
+% \item Captions in figures and table have changed in French: former
+% abbreviations ``Fig.'' and ``Tab.'' have been replaced by full
+% names ``Figure'' and ``Table''. If this leads to formatting
+% problems in captions, you can add the following two commands to
+% your preamble (after loading \babel) to get the former captions\\
+% |\addto\captionsfrench{\def\figurename{{\scshape Fig.}}}|\\
+% |\addto\captionsfrench{\def\tablename{{\scshape Tab.}}}|.
+% \item The |\nombre| command is now provided by the \file{numprint}
+% package which has to be loaded \emph{after} \babel{} with the
+% option |autolanguage| if number formatting should depend on the
+% current language.
+% \item The |\bsc| command no longer uses an |\hbox| to stop
+% hyphenation of names but a |\kern0pt| instead. This change
+% enables \file{microtype} to fine tune the length of the
+% argument of |\bsc|; as a side-effect, compound names like
+% Dupont-Durand can now be hyphenated on explicit hyphens.
+% You can get back to the former behaviour of |\bsc| by adding\\
+% |\renewcommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}|\\
+% to the preamble of your document.
+% \item Footnotes are now displayed ``\`a la fran\c caise'' for the
+% whole document, except with an explicit\\
+% |\frenchbsetup{AutoSpaceFootnotes=false,FrenchFootnotes=false}|.\\
+% Add this command if you want standard footnotes. It is still
+% possible to revert locally to the standard layout of footnotes
+% by adding |\StandardFootnotes| (inside a |minipage| environment
+% for instance).
% \end{itemize}
%
% \StopEventually{}
%
-% \subsection*{Customizing frenchb: an example of configuration file}
+% \subsection{File frenchb.cfg}
% \label{sec-cfg}
%
-% \changes{frenchb-1.4d}{1999/12/19}{Do NOT set catcodes of French
-% quotes to 12 before launching \cs{initiate@active@char} in
-% frenchb.cfg, (problem on Mac reported by M.Bovani).}
+% \file{frenchb.cfg} is now a dummy file just kept for
+% compatibility with previous versions.
%
-% \begin{macrocode}
+% \iffalse
%<*cfg>
+% \fi
+% \begin{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% If you want to customize frenchb, please DO NOT hack into the code,
-%% copy this file into a directory searched by TeX, preferably a
-%% personal one on multi-user systems, and customize it as you like.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% WARNING: If you exchange your documents with colleagues using
-%% a different TeX installation, it is best NOT TO HAVE a frenchb.cfg
-%% file, and add instead the customization commands to the preamble
-%% of your documents after babel and frenchb have been loaded.
+%%%%%%%%% WARNING: THIS FILE SHOULD NO LONGER BE USED %%%%%%%%%
+%% If you want to customise frenchb, please DO NOT hack into the code!
+%% Do no put any code in this file either, please use the new command
+%% \frenchbsetup{} with the proper options to customise frenchb.
+%%
+%% Add \frenchbsetup{ShowOptions} to your preamble to see the list of
+%% available options and/or read the documentation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%% Uncomment the following line if you dislike frenchb automatically
-%% adding a space before French double punctuation (see frenchb.dtx
-%% for more information).
-%%
-%%\NoAutoSpaceBeforeFDP
-%%
-%% frenchb inserts a normal space before a colon in French (following
-%% I.N. specifications), but some people prefer a thinspace instead;
-%% uncomment the following line if you prefer a thinspace.
-%%
-%%\renewcommand{\Fcolonspace}{\thinspace}
-%%
-%% Uncomment the following line to force lasy font emulation for
-%% French guillemets in OT1 encoding; Polish guillemets are
-%% FAR BETTER LOOKING, you should normally leave this line commented out.
-%%
-%%\LasyGuillemets
-%%
-%% The following option is for backward compatibility ONLY
-%% (it might conflict with the russian option of babel).
-%% Uncomment the following line if you want to get back to
-%% the default guillemets used in versions $<$ 1.6b for OT1-encoding
-%% (no effect in T1-encoding).
-%%
-%%\CyrillicGuillemets
-%%
-%% If you dislike Polish guillemets in OT1-encoding, you can easily
-%% pick up yours from other fonts, examples below: Palatino or
-%% cyrillic CMR T2A encoded font.
-%% The four arguments are: encoding, font name, character codes of
-%% the opening and closing guillemets in the selected font.
-%%
-%%\FrenchGuillemetsFrom{T1}{ppl}{19}{20}
-%%\FrenchGuillemetsFrom{T2A}{cmr}{190}{191}
-%%
-%% Uncomment the following line if you don't want frenchb to change
-%% LaTeX standard settings for vertical spacing in 'itemize' lists.
-%% LaTeX standard settings were used by frenchb in versions < 1.3,
-%% so you may want to uncomment the following line to process older
-%% documents.
-%%
-%%\FrenchItemizeSpacingfalse
-%%
-%% frenchb tunes vertical spaces in all lists (at \list level),
-%% uncomment the following line if you prefer LaTeX standard settings
-%% (this flag is new in version 1.3). When \ifFrenchItemizeSpacing is
-%% `true' (default setting), this flag has no effect on itemize lists.
-%%
-%%\FrenchListSpacingfalse
-%%
-%% The command \FrenchLabelItem can be used to set the `labelitems'
-%% for all levels in French. For instance, to get long dashes, use:
-%%
-%%\renewcommand{\FrenchLabelItem}{\textemdash}
-%%
-%% You can also have different `labelitems' for each level in French:
-%%
-%%\renewcommand{\Frlabelitemi}{\textemdash}
-%%\renewcommand{\Frlabelitemii}{\bfseries\textendash}
-%%\renewcommand{\Frlabelitemiii}{\textbullet}
-%%\renewcommand{\Frlabelitemiv}{}
-%%
-%% Uncomment the following line if you want a thinspace to be added
-%% in the running text before the footnote number or symbol.
-%%
-%%\AddThinSpaceBeforeFootnotes
-%%
-%% Uncomment the following line if you want footnotes to be typeset
-%% according the specifications of the French `Imprimerie Nationale'.
-%%
-%%\FrenchFootnotes
-%%
-%% Uncomment the following line if you want the command \nombre to
-%% insert thin spaces (1/6em) instead of normal spaces (0.3em)
-%% between slices of 3 digits when typesetting numbers in French.
-%%
-%%\ThinSpaceInFrenchNumbers
-%%
-%% If you are bored to type {,} every time you want a decimal comma in
-%% math mode, uncomment the following line (and don't forget to add a
-%% forced space after the comma in lists and intervals: $(x,\ y)$ and
-%% $[0,\ 1]$). I suggest NOT TO UNCOMMENT the following line,
-%% and to switch between the decimal comma and the standard comma
-%% using \DecimalMathComma and \StandardMathComma inside the document.
-%%
-%%\DecimalMathComma
-%%
-%% If you do not want the appearance of lists to depend on the current
-%% language, add ONE of these two commands: \FrenchLayout (for a
-%% document mainly in French) or \StandardLayout (for a document
-%% mainly in English).
-%%
-%%\FrenchLayout
-%%\StandardLayout
-%%
-%% With the standard LaTeX classes (article.cls, report.cls, book.cls)
-%% you can change the separator used in figure and table captions in
-%% French with \CaptionSeparator, for instance (the default value of
-%% \CaptionSeparator in French is '\space\textendash\space'):
-%%
-%%\addto\captionsfrench{\def\CaptionSeparator{\space\textemdash\space}}
-%%
-%% You might want to change some of the translations of caption names,
-%% you can do it this way, for instance:
-%%
-%%\addto\captionsfrench{\def\figurename{{\scshape Figure}}}
-%%\addto\captionsfrench{\def\tablename{{\scshape Table}}}
-%%\addto\captionsfrench{\def\proofname{Preuve}}
-%%
-%% If French guillemets are available on your keyboard, you can use
-%% them instead of the commands \og and \fg: REPLACE << and >> in
-%% the following code by your ready-made guillemets (2 occurrences
-%% for each) AND uncomment the resulting code.
-%% WARNINGS:
-%% 1) This will reduce the portability of your source files!
-%% 2) This adds two active characters.
-%% 3) If you add this stuff to the preamble of a document, you'll
-%% need to wrap it in \makeatletter ... \makeatother.
-%%
-%% \ifx\mule@def\undefined
-%% \initiate@active@char{<<}
-%% \initiate@active@char{>>}
-%% \AtBeginDocument{%
-%% \def<<{\og\ignorespaces}%
-%% \def>>{{\fg}}%
-%% }%
-%% \else %%% For the CJK package, see MULEenc.sty.
-%% \mule@def{11}{\og\ignorespaces}
-%% \mule@def{27}{{\fg}}
-%% \fi
-%%
-%% The rest is for compatibility with Bernard Gaulle's french.sty:
-%% if you want to typeset with babel/frenchb files originally written
-%% for french.sty, you will probably want to uncomment these lines.
-%%
-%% Uncomment these lines if you want the aliases \numero and \Numero
-%% (as in french.sty) for \no and \No.
-%%
-%%\let\numero=\no
-%%\let\Numero=\No
-%%
-%% Uncomment the following lines if you want to substitute `\bsc' to
-%% either (or both) of french.sty macros `\fsc' and `\lsc'.
-%%
-%%\let\fsc=\bsc
-%%\let\lsc=\bsc
-%%
-%% Uncomment the following line if you want to substitute `\up' to
-%% french.sty macro `\fup'.
-%%
-%%\let\fup=\up
-%%
-%% Uncomment the following lines if you intend to use commands \french
-%% and \english to switch between languages, as in french.sty.
-%%
-%%\def\french{\leavevmode\selectlanguage{french}}
-%%\def\english{\leavevmode\selectlanguage{english}}
-%%
-%% Uncomment the following lines if you intend to use the command
-%% \AllTeX to refer to all flavours of TeX, (this command has been
-%% made popular by french.sty).
-%%
-%%\newcommand*{\AllTeX}{%
-%% (L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)%
-%% T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}
-%</cfg>
% \end{macrocode}
+% \iffalse
+%</cfg>
+% \fi
%
% \section{\TeX{}nical details}
%
@@ -677,74 +464,38 @@
% loaded more than once, checking the category code of the
% \texttt{@} sign, etc.
%
-% \changes{frenchb-1.1b}{1996/11/02}{Now use \cs{LdfInit} to perform
-% initial checks}
-%
-% \changes{frenchb-1.5g}{2001/09/09}{Let \cs{LdfInit} check for
-% \cs{datefrench} instead of \cs{NoAutoSpaceBeforeFDP},
-% as the later is also defined by russianb.ldf}
+% \iffalse
+%<*code>
+% \fi
%
% \begin{macrocode}
-%<*code>
-%%
\LdfInit\CurrentOption\datefrench
% \end{macrocode}
%
-% \begin{macro}{\ifLaTeX}
% \begin{macro}{\ifLaTeXe}
-% \changes{frenchb-1.1}{1996/02/12}{Use \cs{fmtname} to check
-% the format instead of \cs{newcommand}; define \cs{PlainFmtName}
-% and \cs{LaTeXeFmtName}.}
-%
-% \changes{frenchb-1.3f}{1999/04/11}{Use \cs{magnification} to check
-% if the format is plain (i.e \emph{not} \LaTeX). Checking the
-% format's name was not reliable: plain-like formats may not be
-% called just `plain' but `babel-plain'.}
-%
-% To check the format in use (plain, \LaTeX{} or \LaTeXe),
-% we'll need two new `if'.
+% 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\ifLaTeX
-\ifx\magnification\@undefined\LaTeXtrue\fi
\newif\ifLaTeXe
-\ifx\@compatibilitytrue\@undefined\else\LaTeXetrue\fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\if@Two@E}
-% \changes{frenchb-1.1}{1996/03/01}{New test \cs{if@Two@E}.}
-%
-% We will need another `if' : |\if@Two@E| is true if and only if
-% \LaTeXe{} is running \emph{not} in compatibility mode. It is
-% used in the definitions of the command |\nombre| and |\up|.
-% The definition is somewhat complicated, due to the fact that
-% |\if@compatibility| is not recognized as a |\if| in
-% \LaTeX-2.09 based formats.
-% \begin{macrocode}
-\newif\if@Two@E \@Two@Etrue
-\def\@FI@{\fi}
-\ifx\@compatibilitytrue\@undefined
- \@Two@Efalse \def\@FI@{\relax}
-\else
- \if@compatibility \@Two@Efalse \fi
-\@FI@
+\ifx\magnification\@undefined
+ \ifx\@compatibilitytrue\@undefined
+ \PackageError{frenchb.ldf}%
+ {LaTeX-2.09 format is no longer supported.\MessageBreak
+ Aborting here.}%
+ \endinput
+ \else
+ \LaTeXetrue
+ \fi
+\fi
% \end{macrocode}
% \end{macro}
%
-% \changes{frenchb-1.1b}{1996/11/07}{Removed test for \cs{l@english}}
-%
-% \changes{frenchb-1.2}{1997/01/05}{Check for hyphenation patterns}
-%
% Check if hyphenation patterns for the French language have been
% loaded in language.dat; we allow for the names `french',
% `francais', `canadien' or `acadian'. The latter two are both
% names used in Canada for variants of French that are in use in
% that country.
%
-% \changes{frenchb-1.5b}{2001/02/09}{Added support for canadien and
-% acadian}
-%
% \begin{macrocode}
\ifx\l@french\@undefined
\ifx\l@francais\@undefined
@@ -763,11 +514,8 @@
\fi
\fi
% \end{macrocode}
-% After the statement above |\l@french| is sure to always be
-% defined.
+% Now |\l@french| is always defined.
%
-% \changes{frenchb-1.2}{1997/01/05}{`french' `frenchb' and
-% `francais' are synonymous regardless of \cs{CurrentOption}.}
% The internal name for the French language will be `french';
% `francais' and `frenchb' will be synonymous for `french':
% first let both names use the same hyphenation patterns.
@@ -776,9 +524,6 @@
% As French uses the standard values of |\lefthyphenmin| (2)
% and |\righthyphenmin| (3), no special setting is required here.
%
-% \changes{frenchb-1.5d}{2001/02/16}{The internal name for the
-% French language is changed from `frenchb' to `french'.}
-%
% \begin{macrocode}
\def\CurrentOption{french}
\ifx\l@francais\@undefined
@@ -791,10 +536,6 @@
% When this language definition file was loaded for one of the
% Canadian versions of French we need to make sure that a suitable
% hyphenation pattern register will be found by \TeX.
-%
-% \changes{babel-1.5b}{2001/02/09}{Added support for canadien and
-% acadian}
-%
% \begin{macrocode}
\ifx\l@canadien\@undefined
\let\l@canadien\l@french
@@ -804,69 +545,17 @@
\fi
% \end{macrocode}
%
-% \changes{frenchb-1.5g}{2001/09/09}{Instead of issuing a warning when
-% \cs{captionsfrancais} or \cs{captionsfrenchb} are customized in
-% the preamble, we merge the changes into \cs{captionsfrench}.}
-%
% This language definition can be loaded for different variants of
% the French language. The `key' \babel\ macros are only defined
% once, using `french' as the language name, but |frenchb| and
-% |francais| are synonymous. As some users who choose |frenchb|
-% or |francais| as option of \babel, might customize
-% |\captionsfrenchb| or |\captionsfrancais| in the preamble,
-% we merge their changes at the |\begin{document}| when they do so
-% (only possible in \LaTeXe).
-% The other three commands for |\date|, |\extras|, and |\noextras|
-% are not likely to be modified by end-users.
-% The other variants of languages are defined by checking if the
-% relevant option was used and then adding one extra level of
-% expansion.
-%
-% \changes{frenchb-1.6c}{2003/06/30}{Bug correction: it is necessary
-% to re-execute \cs{captionsfrench} after merging
-% \cs{captionsfrenchb} and \cs{captionsfrancais}.}
-%
+% |francais| are synonymous.
% \begin{macrocode}
\def\datefrancais{\datefrench}
-\def\extrasfrancais{\extrasfrench}
-\def\noextrasfrancais{\noextrasfrench}
\def\datefrenchb{\datefrench}
+\def\extrasfrancais{\extrasfrench}
\def\extrasfrenchb{\extrasfrench}
+\def\noextrasfrancais{\noextrasfrench}
\def\noextrasfrenchb{\noextrasfrench}
-\ifLaTeXe
- \AtBeginDocument{\let\captions@French\captionsfrench
- \ifx\captionsfrenchb\@undefined
- \let\captions@Frenchb\relax
- \else
- \let\captions@Frenchb\captionsfrenchb
- \fi
- \ifx\captionsfrancais\@undefined
- \let\captions@Francais\relax
- \else
- \let\captions@Francais\captionsfrancais
- \fi
- \def\captionsfrench{\captions@French
- \captions@Francais\captions@Frenchb}%
- \def\captionsfrancais{\captionsfrench}%
- \def\captionsfrenchb{\captionsfrench}%
- \iflanguage{french}{\captionsfrench}{}%
- }
-\else
- \def\captionsfrancais{\captionsfrench}
- \def\captionsfrenchb{\captionsfrench}
-\fi
-\@ifpackagewith{babel}{canadien}{%
- \def\captionscanadien{\captionsfrench}%
- \def\datecanadien{\datefrench}%
- \def\extrascanadien{\extrasfrench}%
- \def\noextrascanadien{\noextrasfrench}%
- }{}
-\@ifpackagewith{babel}{acadian}{%
- \def\captionsacadian{\captionsfrench}%
- \def\dateacadian{\datefrench}%
- \def\extrasacadian{\extrasfrench}%
- \def\noextrasacadian{\noextrasfrench}%
- }{}
% \end{macrocode}
%
% \begin{macro}{\extrasfrench}
@@ -875,14 +564,12 @@
% definitions needed for the French language.
% The macro |\noextrasfrench| is used to cancel the actions of
% |\extrasfrench|.\\
-% In French ``apostrophe'' is used in hyphenation in expressions
-% like |l'ambulance| (French 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 to be reset to null when exiting French.
-%
-% \changes{frenchb-1.2}{1997/01/05}{`french' `frenchb' and
-% `francais' are synonymous regardless of \cs{CurrentOption}.}
+% In French, character``apostrophe'' 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.
%
% \begin{macrocode}
\@namedef{extras\CurrentOption}{\lccode`\'=`\'}
@@ -891,529 +578,688 @@
% \end{macro}
% \end{macro}
%
-% \changes{frenchb-1.1}{1996/01/29}{Add some font changing
-% definitions.}
-%
-% It is best to use \LaTeXe{}'s font changing commands, and to
-% emulated those we need when they are not available, as in
-% Plain\TeX{} or \LaTeX-2.09. Be aware that old commands |\sc|,
-% |\it|, \textit{etc.} exist in \LaTeXe{}, but they behave like
-% they did in \LaTeX-2.09 (i.\,e., they switch back to
-% |\normalfont| instead of keeping the other font attributes
-% unchanged).
+% One more thing |\extrasfrench| needs to do is to make sure that
+% |\frenchspacing| is in effect. |\noextrasfrench| will switch
+% |\frenchspacing| off again.
% \begin{macrocode}
-\ifx\scshape\@undefined
- \ifx\sc\@undefined
- \let\scshape\relax
- \else
- \let\scshape\sc
- \fi
-\fi
-\ifx\emph\@undefined
- \ifx\em\@undefined
- \let\emph\relax
- \else
- \def\emph#1{\em #1}
- \fi
-\fi
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
% \end{macrocode}
%
-% \subsection{Caption names}
-%
-% The next step consists of defining the French equivalents for
-% the \LaTeX{} caption names.
-%
-% \changes{frenchb-1.3c}{1997/10/08}{changed \cs{@makecaption}
-% definition to add a hook \cs{CaptionSeparator}.}
-%
-% In French, captions in figures and tables should be printed with
-% endash (`--') instead of the standard `:'. If another separator
-% is preferred, see in the example configuration file above
-% (section~\ref{sec-cfg}) how to change the default value of
-% |\CaptionSeparator|.
-%
-% \changes{frenchb-1.4a}{1999/10/23}{frenchb-1.3 silently redefined
-% \cs{@makecaption}, overwriting changes made by some classes
-% like koma-script, ua-thesis\dots (pointed out by Werner~Lemberg).
-% New implementation suggested by Vincent~Jalby.}
-%
-% \changes{frenchb-1.4e}{2000/03/12}{Captions print twice with AMS
-% classes (amsart, amsbook). Bug reported by Jean-Fran\c cois
-% Mertens. Revert to implementation of version 1.4, which is
-% safer as \@makecaption can be changed unpredictably.}
-%
-% We first store the standard definition of |\@makecaption|
-% (e.g., the one provided in article.cls, report.cls, book.cls
-% which is frozen for \LaTeXe{} according to Frank Mittelbach),
-% in |\STD@makecaption|. `ATBeginDocument' we compare it to its
-% current definition (some classes like koma-script classes,
-% AMS classes, ua-thesis.cls\dots change it).
-% If they are identical, frenchb just adds a hook called
-% |\CaptionSeparator| to |\@makecaption|, |\CaptionSeparator|
-% defaults to ': ' as in the standard |\@makecaption|, and will be
-% changed to ' -- ' in French.
-% If the definitions differ, frenchb doesn't overwrite the changes,
-% but prints a message in the .log file.
-%
-% \changes{frenchb-1.4f}{2000/04/07}{Only issue a warning if
-% \cs{@makecaption} exists}
+% \subsection{Punctuation}
+% \label{sec-punct}
%
-% \begin{macrocode}
-\ifLaTeXe
- \long\def\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}
- \def\CaptionSeparator{\string:\space}
- \long\def\FB@makecaption#1#2{%
- \vskip\abovecaptionskip
- \sbox\@tempboxa{#1\CaptionSeparator #2}%
- \ifdim \wd\@tempboxa >\hsize
- #1\CaptionSeparator #2\par
- \else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
- \fi
- \vskip\belowcaptionskip}
- \AtBeginDocument{%
- \ifx\@makecaption\STD@makecaption
- \let\@makecaption\FB@makecaption
+% As long as no better solution is available%
+% \footnote{Lua\TeX, or pdf\TeX{} might provide alternatives in
+% the future\dots},
+% the `double punctuation' characters (|;| |!| |?| and |:|) have to
+% be made |\active| for an automatic control of the amount of space
+% to insert before them. Before doing so, we have to save the
+% standard definition of |\@makecaption| (which includes two ':')
+% to compare it later to its definition at the |\begin{document}|.
+% \begin{macrocode}
+\long\def\STD@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
\else
- \ifx\@makecaption\@undefined\else
- \PackageWarning{frenchb.ldf}%
- {The definition of \protect\@makecaption\space
- has been changed,\MessageBreak
- frenchb will NOT customize it;\MessageBreak reported}%
- \fi
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
- \let\FB@makecaption\relax
- \let\STD@makecaption\relax}
- \expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \def\CaptionSeparator{\string:\space}}
-\fi
+ \vskip\belowcaptionskip}%
% \end{macrocode}
%
-% \begin{macro}{\captionsfrench}
-% The macro |\captionsfrench| defines all strings used in the four
-% standard document classes provided with \LaTeX. Some authors do
-% not like some of these names; it is easy to change them in the
-% preamble \emph{after} loading |frenchb| (or in your file
-% |frenchb.cfg|), e.g
-% |\addto\captionsfrench{\def\figurename{Figure}}| will print
-% `Figure' in Roman instead of `\textsc{Fig.}'.
-%
-% \changes{frenchb-1.1}{1996/01/30}{This code is useless in Plain\TeX,
-% check the format before loading it.}
-%
-% \changes{frenchb-1.2}{1997/01/05}{Added aliases \cs{captionsfrenchb}
-% and \cs{captionsfrancais}.}
-%
-% \changes{frenchb-1.3c}{1997/10/08}{Added \cs{CaptionSeparator}.}
-%
-% \changes{frenchb-1.4a}{1999/10/23}{Changed `--' to
-% \cs{textendash} in \cs{CaptionSeparator} in case the ligature
-% doesn't exist (tt-fonts).}
-%
-% \changes{frenchb-1.4f}{2000/04/06}{Added \cs{glossaryname}}
+% We define a new `if' |\FBpunct@active| which will be made false
+% whenever a better alternative will be available.
+% The following code makes the four characters |;| |!| |?| and |:|
+% `active' and provides their definitions.
+% \begin{macrocode}
+\newif\ifFBpunct@active \FBpunct@activetrue
+\ifFBpunct@active
+ \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 an unbreakable |\thinspace| instead. If no
+% space has been typed, we add |\FDP@thinspace| which will be
+% defined, up to the user's wishes, as an automatic added
+% thin space, or as |\@empty|.
% \begin{macrocode}
-\ifLaTeX
-\@namedef{captions\CurrentOption}{%
- \def\refname{R\'ef\'erences}%
- \def\abstractname{R\'esum\'e}%
- \def\bibname{Bibliographie}%
- \def\prefacename{Pr\'eface}%
- \def\chaptername{Chapitre}%
- \def\appendixname{Annexe}%
- \def\contentsname{Table des mati\`eres}%
- \def\listfigurename{Table des figures}%
- \def\listtablename{Liste des tableaux}%
- \def\indexname{Index}%
- \def\figurename{{\scshape Fig.}}%
- \def\tablename{{\scshape Tab.}}%
- \def\CaptionSeparator{\space\textendash\space}%
+ \declare@shorthand{french}{;}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
% \end{macrocode}
-% ``Premi\`ere partie'' instead of ``Part I''
+% Now we can insert a |;| character.
% \begin{macrocode}
- \def\partname{\protect\@Fpt partie}%
- \def\@Fpt{{\ifcase\value{part}\or Premi\`ere\or Deuxi\`eme\or
- Troisi\`eme\or Quatri\`eme\or Cinqui\`eme\or Sixi\`eme\or
- Septi\`eme\or Huiti\`eme\or Neuvi\`eme\or Dixi\`eme\or Onzi\`eme\or
- Douzi\`eme\or Treizi\`eme\or Quatorzi\`eme\or Quinzi\`eme\or
- Seizi\`eme\or Dix-septi\`eme\or Dix-huiti\`eme\or Dix-neuvi\`eme\or
- Vingti\`eme\fi}\space\def\thepart{}}%
- \def\pagename{page}%
- \def\seename{{\emph{voir}}}%
- \def\alsoname{{\emph{voir aussi}}}%
- \def\enclname{P.~J. }%
- \def\ccname{Copie \`a }%
- \def\headtoname{}%
- \def\proofname{D\'emonstration}% for AMS-\LaTeX
- \def\glossaryname{Glossaire}%
- }
-\fi
+ \string;}
+% \end{macrocode}
+% The next three definitions are very similar.
+% \begin{macrocode}
+ \declare@shorthand{french}{!}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string!}
+ \declare@shorthand{french}{?}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \string?}
+% \end{macrocode}
+% According to the I.N. specifications, the `:' requires a normal
+% space before it, but some people prefer a |\thinspace| (just
+% like the other three). We define |\Fcolonspace| to hold the
+% required amount of space (user customisable).
+% \begin{macrocode}
+ \newcommand*{\Fcolonspace}{\space}
+ \declare@shorthand{french}{:}{%
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\Fcolonspace
+ \else
+ \FDP@colonspace
+ \fi
+ \fi
+ \string:}
% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Punctuation}
%
-% The `double punctuation' characters (|;| |!| |?| and |:|) have to
-% be made |\active| for an automatic control of the amount of space
-% to insert before them.
+% \begin{macro}{\AutoSpaceBeforeFDP}
+% \begin{macro}{\NoAutoSpaceBeforeFDP}
+% |\FDP@thinspace| and |\FDP@space| are defined as unbreakable
+% spaces by\\ |\AutoSpaceBeforeFDP| or as |\@empty| by
+% |\NoAutoSpaceBeforeFDP|.\\
+% Default is |\AutoSpaceBeforeFDP|.
+% \begin{macrocode}
+ \def\AutoSpaceBeforeFDP{%
+ \def\FDP@thinspace{\penalty\@M\thinspace}%
+ \def\FDP@colonspace{\penalty\@M\Fcolonspace}}
+ \def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty
+ \let\FDP@colonspace\@empty}
+ \AutoSpaceBeforeFDP
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% 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}
-\initiate@active@char{:}
-\initiate@active@char{;}
-\initiate@active@char{!}
-\initiate@active@char{?}
+ \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.
% \begin{macrocode}
-\expandafter\addto\csname extras\CurrentOption\endcsname{%
- \languageshorthands{french}}
+ \addto\extrasfrench{%
+ \languageshorthands{french}%
% \end{macrocode}
% These characters are `turned on' once, later their definition may
-% vary.
+% vary. Don't misunderstand the following code: they keep being
+% active all along the document, even when leaving French.
% \begin{macrocode}
-\expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@activate{:}\bbl@activate{;}%
- \bbl@activate{!}\bbl@activate{?}}
-\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@activate{:}\bbl@activate{;}%
+ \bbl@activate{!}\bbl@activate{?}%
+ }
+ \addto\noextrasfrench{%
\bbl@deactivate{:}\bbl@deactivate{;}%
\bbl@deactivate{!}\bbl@deactivate{?}}
+\fi
% \end{macrocode}
%
-% One more thing |\extrasfrench| needs to do is to make sure that
-% |\frenchspacing| is in effect. If this is not the case the
-% execution of |\noextrasfrench| will switch it off again.
+% \subsection{French quotation marks}
+%
+% \begin{macro}{\og}
+% \begin{macro}{\fg}
+% The top macros for quotation marks will be called |\og|
+% (``\underline{o}uvrez \underline{g}uillemets'') and |\fg|
+% (``\underline{f}ermez \underline{g}uillemets'').
+% Another option for typesetting quotes in multilingual texts
+% is to use the package |csquotes.sty| and its command |\enquote|.
+%
% \begin{macrocode}
-\expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@frenchspacing}
-\expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \bbl@nonfrenchspacing}
+\newcommand*{\og}{\@empty}
+\newcommand*{\fg}{\@empty}
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\french@sh@;@}
-% We have to tune the amount of white space before \texttt{;}
-% \texttt{!} \texttt{?} and \texttt{:}. This should only happen
-% in horizontal mode, hence the test |\ifhmode|.
+% \begin{macro}{\guillemotleft}
+% \begin{macro}{\guillemotright}
+% \LaTeX{} users are supposed to use 8-bit output encodings (T1,
+% LY1,\dots) to typeset French, those who still stick to OT1 should
+% call |aeguill.sty| 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, |\guillemotleft| and |\guillemotright| are defined
+% by package \file{xunicode.sty}.
+% We will check `AtBeginDocument' that the proper output encodings
+% are in use (see end of section~\ref{sec-keyval}).
+%
+% We give the following definitions for Plain users only as a (poor)
+% fall-back, they are welcome to change them for anything better.
+% \begin{macrocode}
+\ifLaTeXe
+\else
+ \ifx\guillemotleft\@undefined
+ \def\guillemotleft{\leavevmode\raise0.25ex
+ \hbox{$\scriptscriptstyle\ll$}}
+ \fi
+ \ifx\guillemotright\@undefined
+ \def\guillemotright{\raise0.25ex
+ \hbox{$\scriptscriptstyle\gg$}}
+ \fi
+ \let\xspace\relax
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The next step is to provide correct spacing after |\guillemotleft|
+% and before |\guillemotright|: a space precedes and follows
+% quotation marks but no line break is allowed neither \emph{after}
+% the opening one, nor \emph{before} the closing one.
+% |\FBguill@spacing| which does the spacing, has been fine tuned by
+% Thierry Bouche. 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.
+% We'll try to be smart to users of D.~Carlisle's |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{frenchb-1.1}{1995/12/23}{Added a hook to insert space
-% or not before `double punctuation'.}
+% \begin{macrocode}
+\newcommand*{\FBguill@spacing}{\penalty\@M\hskip.8\fontdimen2\font
+ plus.3\fontdimen3\font
+ minus.8\fontdimen4\font}
+\DeclareRobustCommand*{\FB@og}{\leavevmode
+ \guillemotleft\FBguill@spacing}
+\DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
+ \FBguill@spacing\guillemotright\xspace}
+% \end{macrocode}
%
-% In horizontal mode, if a space has been typed before `;' we
-% remove it and put an unbreakable |\thinspace| instead. If no
-% space has been typed, we add |\FDP@thinspace| which will be
-% defined, up to the user's wishes, as an automatic added
-% thin space, or as |\@empty|.
+% The top level definitions for French 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.
%
% \begin{macrocode}
-\declare@shorthand{french}{;}{%
- \ifhmode
- \ifdim\lastskip>\z@
- \unskip\penalty\@M\thinspace
- \else
- \FDP@thinspace
- \fi
- \fi
+\ifLaTeXe
+ \def\bbl@frenchguillemets{\renewcommand*{\og}{\FB@og}%
+ \renewcommand*{\fg}{\FB@fg}}
+ \def\bbl@nonfrenchguillemets{\renewcommand*{\og}{\textquotedblleft}%
+ \renewcommand*{\fg}{\ifdim\lastskip>\z@\unskip\fi
+ \textquotedblright}}
+\else
+ \def\bbl@frenchguillemets{\let\og\FB@og
+ \let\fg\FB@fg}
+ \def\bbl@nonfrenchguillemets{\def\og{``}%
+ \def\fg{\ifdim\lastskip>\z@\unskip\fi ''}}
+\fi
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchguillemets}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchguillemets}
% \end{macrocode}
-% Now we can insert a |;| character.
+%
+% \subsection{Date in French}
+%
+% \begin{macro}{\datefrench}
+% The macro |\datefrench| redefines the command |\today| to
+% produce French dates.
+%
% \begin{macrocode}
- \string;}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day \ifnum1=\day {\ier}\fi \relax \space
+ \ifcase\month
+ \or janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
+ juillet\or ao\^ut\or septembre\or octobre\or novembre\or
+ d\'ecembre\fi \relax
+ \space \number\year}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\french@sh@!@}
-% \begin{macro}{\french@sh@?@}
+% \subsection{Extra utilities}
+%
+% Let's provide the French user with some extra utilities.
%
-% Because these definitions are very similar only one is displayed
-% in a way that the definition can be easily checked.
+% \begin{macro}{\up}
+% \begin{macro}{\ieme}
+% |\up| eases the typesetting of superscripts like
+% `1\raise0.55ex\hbox{\small er}'. |\up| is just a shortcut for
+% |\textsuperscript| in \LaTeXe.
%
% \begin{macrocode}
-\declare@shorthand{french}{!}{%
- \ifhmode
- \ifdim\lastskip>\z@
- \unskip\penalty\@M\thinspace
- \else
- \FDP@thinspace
- \fi
- \fi
- \string!}
+\ifLaTeXe
+ \newcommand*{\up}[1]{\textsuperscript{#1}}
+\else
+ \newcommand*{\up}[1]{\leavevmode\raise1ex\hbox{\sevenrm #1}}
+\fi
% \end{macrocode}
%
% \begin{macrocode}
-\declare@shorthand{french}{?}{%
- \ifhmode
- \ifdim\lastskip>\z@
- \unskip\penalty\@M\thinspace
- \else
- \FDP@thinspace
- \fi
- \fi
- \string?}
+\def\ieme{\up{\lowercase{e}}\xspace}
+\def\iemes{\up{\lowercase{es}}\xspace}
+\def\ier{\up{\lowercase{er}}\xspace}
+\def\iers{\up{\lowercase{ers}}\xspace}
+\def\iere{\up{\lowercase{re}}\xspace}
+\def\ieres{\up{\lowercase{res}}\xspace}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\french@sh@:@}
-%
-% The `:' requires a normal space before it, instead of
-% a |\thinspace|.
+% \end{macro}
+% \end{macro}
%
+% \begin{macro}{\No}
+% \begin{macro}{\no}
+% \begin{macro}{\primo}
+% \begin{macro}{\fprimo)}
+% And some more macros for numbering, first two support macros.
% \begin{macrocode}
-\declare@shorthand{french}{:}{%
- \ifhmode
- \ifdim\lastskip>\z@
- \unskip\penalty\@M\Fcolonspace
- \else
- \FDP@colonspace
- \fi
- \fi
- \string:}
+\newcommand*{\FrenchEnumerate}[1]{%
+ #1\up{\lowercase{o}}\kern+.3em}
+\newcommand*{\FrenchPopularEnumerate}[1]{%
+ #1\up{\lowercase{o}})\kern+.3em}
% \end{macrocode}
-% \end{macro}
-%
-% \changes{frenchb-1.1}{1995/12/23}{Added a hook to insert space
-% or not before `double punctuation'.}
%
-% \changes{frenchb-1.5f}{2001/06/02}{Added a hook to customize
-% the space before the colon in French (thin or normal).}
+% Typing |\primo| should result in `$1^{\rm o}$\kern+.3em',
+% \begin{macrocode}
+\def\primo{\FrenchEnumerate1}
+\def\secundo{\FrenchEnumerate2}
+\def\tertio{\FrenchEnumerate3}
+\def\quarto{\FrenchEnumerate4}
+% \end{macrocode}
+% while typing |\fprimo)| gives `1$^{\rm o}$)\kern+.3em.
+% \begin{macrocode}
+\def\fprimo){\FrenchPopularEnumerate1}
+\def\fsecundo){\FrenchPopularEnumerate2}
+\def\ftertio){\FrenchPopularEnumerate3}
+\def\fquarto){\FrenchPopularEnumerate4}
+% \end{macrocode}
%
-% \begin{macro}{\Fcolonspace}
-% \begin{macro}{\AutoSpaceBeforeFDP}
-% \begin{macro}{\NoAutoSpaceBeforeFDP}
-% |\FDP@thinspace| and |\FDP@space| are defined as unbreakable
-% spaces by\\ |\AutoSpaceBeforeFDP| or as |\@empty| by
-% |\NoAutoSpaceBeforeFDP|.\\
-% Default is |\AutoSpaceBeforeFDP|.
+% Let's provide two macros for the common abbreviations
+% of ``Num\'ero''.
% \begin{macrocode}
-\newcommand{\Fcolonspace}{\space}
-\def\AutoSpaceBeforeFDP{%
- \def\FDP@thinspace{\penalty\@M\thinspace}%
- \def\FDP@colonspace{\penalty\@M\Fcolonspace}}
-\def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty
- \let\FDP@colonspace\@empty}
-\AutoSpaceBeforeFDP
+\DeclareRobustCommand*{\No}{N\up{\lowercase{o}}\kern+.2em}
+\DeclareRobustCommand*{\no}{n\up{\lowercase{o}}\kern+.2em}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\system@sh@:@}
-% \begin{macro}{\system@sh@!@}
-% \begin{macro}{\system@sh@?@}
-% \begin{macro}{\system@sh@;@}
+% \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}|.
%
-% 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.
+% \changes{frenchb-2.0}{2006/11/06}{\cs{hbox} dropped, replaced by
+% \kern0pt.}
%
% \begin{macrocode}
-\declare@shorthand{system}{:}{\string:}
-\declare@shorthand{system}{!}{\string!}
-\declare@shorthand{system}{?}{\string?}
-\declare@shorthand{system}{;}{\string;}
+\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.
+%
+% \begin{macrocode}
+\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
+% \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|).
+%
+% If the \TeX{} Companion fonts are available (\file{textcomp.sty}),
+% we pick up |\textdegree| from them instead of using emulating
+% `degrees' from the |\r{}| accent. Otherwise we overwrite the
+% (poor) definition of |\textdegree| given in \file{latin1.def},
+% \file{applemac.def} etc. (called by \file{inputenc.sty}) by
+% our definition of |\degres|. We also advice the user (once only)
+% to use TS1-encoding.
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \def\Warning@degree@TSone{%
+ \PackageWarning{frenchb.ldf}{%
+ Degrees would look better in TS1-encoding:
+ \MessageBreak add \protect
+ \usepackage{textcomp} to the preamble.
+ \MessageBreak Degrees used}}
+ \AtBeginDocument{\expandafter\ifx\csname M@TS1\endcsname\relax
+ \DeclareRobustCommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}%
+ \Warning@degree@TSone
+ \global\let\Warning@degree@TSone\relax}%
+ \let\textdegree\degres
+ \else
+ \DeclareRobustCommand*{\degres}{%
+ \hbox{\UseTextSymbol{TS1}{\textdegree}}}%
+ \fi}
+\else
+ \newcommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}}
+\fi
+% \end{macrocode}
% \end{macro}
+%
+% \subsection{Formatting numbers}
+% \label{sec-numbers}
+%
+% \begin{macro}{\DecimalMathComma}
+% \begin{macro}{\StandardMathComma}
+% As mentioned in the \TeX{}book p.~134, the comma is of type
+% |\mathpunct| in math mode: it is automatically followed by a
+% 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.
+% \begin{macrocode}
+\newcount\std@mcc
+\newcount\dec@mcc
+\std@mcc=\mathcode`\,
+\dec@mcc=\std@mcc
+\@tempcnta=\std@mcc
+\divide\@tempcnta by "1000
+\multiply\@tempcnta by "1000
+\advance\dec@mcc by -\@tempcnta
+\newcommand*{\DecimalMathComma}{\iflanguage{french}%
+ {\mathcode`\,=\dec@mcc}{}%
+ \addto\extrasfrench{\mathcode`\,=\dec@mcc}}
+\newcommand*{\StandardMathComma}{\mathcode`\,=\std@mcc
+ \addto\extrasfrench{\mathcode`\,=\std@mcc}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \mathcode`\,=\std@mcc}
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \subsection{French quotation marks}
+% \changes{frenchb-2.0}{2006/11/06}{\cs{nombre} requires now
+% numprint.sty.}
%
-% \changes{frenchb-1.3}{1997/04/24}{New implementation of guillemets.}
+% \begin{macro}{\nombre}
+% The command |\nombre| is now borrowed from |numprint.sty| for
+% \LaTeXe. 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.
%
-% \changes{frenchb-1.4}{1999/07/08}{Add a hook to pick French
-% guillemets from any font (suggested by Michel Bovani).}
+% Fake command |\nombre| for Plain based formats, warning users of
+% frenchb v.1.x. of the change.
+% \begin{macrocode}
+\newcommand*{\nombre}[1]{{#1}\message{%
+ *** \noexpand\nombre no longer formats numbers\string! ***}}%
+% \end{macrocode}
+% \end{macro}
%
-% \changes{frenchb-1.3e}{1999/01/02}{Try to use AMS Cyrillic fonts
-% to provide better looking guillemets in OT1 encoding.}
+% The next definitions only make sense for \LaTeXe. Let's cleanup
+% and exit if the format in Plain based.
%
-% \changes{frenchb-1.6b}{2003/04/05}{Default OT1 guillemets are
-% now borrowed from Polish fonts, rather than from wncyr.}
+% \begin{macrocode}
+\let\FBstop@here\relax
+\def\FBclean@on@exit{\let\ifLaTeXe\@undefined
+ \let\LaTeXetrue\@undefined
+ \let\LaTeXefalse\@undefined}
+\ifx\magnification\@undefined
+\else
+ \def\FBstop@here{\let\STD@makecaption\relax
+ \FBclean@on@exit
+ \ldf@quit\CurrentOption\endinput}
+\fi
+\FBstop@here
+% \end{macrocode}
%
-% \changes{frenchb-1.6c}{2003/06/30}{OT1 `Polish' guillemets are
-% now taken from the LM fonts which will be part of TL8.}
+% What follows now is for \LaTeXe{} \emph{only}.
+% We redefine |\nombre| for \LaTeXe. A warning is issued
+% at the first call of |\nombre| if |\numprint| is not
+% defined, suggesting what to do. The package |numprint|
+% is \emph{not} loaded automatically by frenchb because of
+% possible options conflict.
%
-% EC/LM fonts and standard PostScript fonts have built-in
-% guillemets, we of course use them. CM fonts have no French
-% guillemets built-in, so we have to emulate them:
-% \begin{itemize}
-% \item if a file `t1lmr.fd' is found, we expect the LM fonts
-% to be present on the system, so we pick up French guillemets
-% from them; before version 1.6b, French guillemets were
-% borrowed from the `wncyr' fonts, this has been changed because
-% it resulted in a conflict with the russian option of \babel.
-% Former Cyrillic guillemets are still available through the
-% command |\CyrillicGuillemets| (for backward compatibility).
-% \item otherwise we use math symbols, either \LaTeX's `lasy' font
-% if available, or \TeX{}~symbols |\ll| and |\gg| otherwise;
-% \end{itemize}
+% \begin{macrocode}
+\renewcommand*{\nombre}[1]{\Warning@nombre\numprint{#1}}
+\newcommand*{\Warning@nombre}{%
+ \@ifundefined{numprint}%
+ {\PackageWarning{frenchb.ldf}{%
+ \protect\nombre\space now relies on package numprint.sty,
+ \MessageBreak add \protect
+ \usepackage[autolanguage]{numprint}\MessageBreak
+ to your preamble *after* loading babel, \MessageBreak
+ see file numprint.pdf for other options.\MessageBreak
+ \protect\nombre\space called}%
+ \global\let\Warning@nombre\relax
+ \global\let\numprint\relax
+ }{}%
+}
+% \end{macrocode}
%
-% The standard names for French quotation marks are |\guillemotleft|
-% and |\guillemotright|, these commands are defined in |t1enc.def|
-% for T1-encoding.
-% In \LaTeXe{} formats, we first define these commands for
-% OT1-encoding (for CM fonts), using either the Polish `pl*' fonts
-% or \LaTeX{}'s `lasy' fonts.
-% Other local text encodings \emph{should} define them too,
-% but if they don't, the OT1 definitions will be used.
-% The standard PostScript fonts should \emph{always} be used together
-% with T1-encoding (\emph{not} OT1), for proper hyphenation and
-% built-in (better looking) French quotation marks.
-%
-% \changes{frenchb-1.2b}{1997/04/24}{Spacing after opening and before
-% closing guillemets slightly enlarged and some glue added,
-% as suggested by Th.~Bouche. Unlike \cs{kern}, \cs{hskip} doesn't
-% inhibit hyphenation, nothing like \cs{allowhyphens} is required.}
+% \changes{frenchb-2.0c}{2007/06/25}{No need to define here numprint's
+% command \cs{npstylefrench}, it will be redefined `AtBeginDocument'
+% by \cs{FBprocess@options}.}
%
-% The next step is to provide correct spacing after |\guillemotleft|
-% and before |\guillemotright| : a space precedes and follows
-% quotation marks but no line break is allowed neither \emph{after}
-% the opening one, nor \emph{before} the closing one.
-% |\guill@spacing| which does the spacing, has been fine tuned by
-% Thierry Bouche.
+% \changes{frenchb-2.0c}{2007/06/25}{\cs{ThinSpaceInFrenchNumbers}
+% added for compatibility with frenchb-1.x.}
%
-% \changes{frenchb-1.3d}{1998/04/20}{Spacing after opening and before
-% closing guillemets changed again: normal space with little glue
-% (suggested by Th. Bouche).}
+% \begin{macrocode}
+\newcommand*{\ThinSpaceInFrenchNumbers}{%
+ \PackageWarning{frenchb.ldf}{%
+ Type \protect\frenchbsetup{ThinSpaceInFrenchNumbers}
+ \MessageBreak Command \protect\ThinSpaceInFrenchNumbers\space
+ is no longer\MessageBreak defined in frenchb v.2,}}
+% \end{macrocode}
%
-% The top macros for quotation marks will be called |\og|
-% (``\underline{o}uvrez \underline{g}uillemets'') and |\fg|
-% (``\underline{f}ermez \underline{g}uillemets'').\\
-% The top level definitions for French 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.\\
-% As |\DeclareTextCommand| cannot be used after the
-% |\begin{document}| we introduce internal definitions
-% |\begin@guill| and |\end@guill|.\\
-% We'll try to be smart to users of D.~\textsc{Carlisle}'s |xspace|
-% package: if this package is loaded there will be no need for |{}|
-% or |\ | to get a space after |\fg|.
+% \subsection{Caption names}
%
-% \begin{macro}{\guillemotleft}
-% \begin{macro}{\guillemotright}
-% \begin{macro}{\og}
-% \begin{macro}{\fg}
-% \changes{frenchb-1.1}{1996/01/20}{A warning is now issued if \cs{og}
-% or \cs{fg} have been defined elsewhere in a \LaTeXe{} document
-% (suggested by Vincent Jalby).}
-% In \LaTeXe{} we provide a dummy definition for |\og| and |\fg|,
-% just to display an error message in case |\og| or |\fg| have been
-% defined elsewhere.
+% The next step consists of defining the French equivalents for
+% the \LaTeX{} caption names.
%
-% \changes{frenchb-1.2b}{1997/04/24}{Define \cs{xspace} as \relax if
-% it is not defined by D. Carlisle `xspace.sty'. Will be used in
-% \cs{fg}, and \cs{ieme} ... \cs{ieres} (new for this release).}
+% \begin{macro}{\captionsfrench}
+% Let's first define |\captionsfrench| which sets all strings used
+% in the four standard document classes provided with \LaTeX.
+%
+% \changes{frenchb-2.0}{2006/11/06}{`Fig.' changed to `Figure' and
+% `Tab.' to `Table'.}
%
-% \changes{frenchb-1.5f}{2001/04/21}{\cs{og} and \cs{fg} should not
-% be expanded when written to a file; use \cs{renewcommand} (in
-% \cs{LaTeX}) to redefine them instead of \cs{let} or \cs{def}.}
+% \changes{frenchb-2.0}{2006/12/15}{Set \cs{CaptionSeparator} in
+% \cs{extrasfrench} now instead of \cs{captionsfrench} because
+% it has to be reset when leaving French.}
%
% \begin{macrocode}
-\newcommand{\og}{\@empty}
-\newcommand{\fg}{\@empty}
+\@namedef{captions\CurrentOption}{%
+ \def\refname{R\'ef\'erences}%
+ \def\abstractname{R\'esum\'e}%
+ \def\bibname{Bibliographie}%
+ \def\prefacename{Pr\'eface}%
+ \def\chaptername{Chapitre}%
+ \def\appendixname{Annexe}%
+ \def\contentsname{Table des mati\`eres}%
+ \def\listfigurename{Table des figures}%
+ \def\listtablename{Liste des tableaux}%
+ \def\indexname{Index}%
+ \def\figurename{{\scshape Figure}}%
+ \def\tablename{{\scshape Table}}%
% \end{macrocode}
-% \begin{macro}{\FrenchGuillemetsFrom}
+% ``Premi\`ere partie'' instead of ``Part I''.
% \begin{macrocode}
-\ifLaTeXe
- \def\FrenchGuillemetsFrom#1#2#3#4{%
- \DeclareFontEncoding{#1}{}{}%
- \DeclareFontSubstitution{#1}{#2}{m}{n}%
- \DeclareTextCommand{\guillemotleft}{OT1}{%
- {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3}}%
- \DeclareTextCommand{\guillemotright}{OT1}{%
- {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
-% \end{macrocode}
-% \begin{macro}{\CyrillicGuillemets}
-% \begin{macro}{\PolishGuillemets}
-% \begin{macro}{\LasyGuillemets}
-% \begin{macro}{\bbl@frenchguillemets}
-% \begin{macro}{\bbl@nonfrenchguillemets}
-% \begin{macrocode}
- \def\CyrillicGuillemets{\FrenchGuillemetsFrom{OT2}{wncyr}{60}{62}}
- \def\PolishGuillemets{\FrenchGuillemetsFrom{T1}{lmr}{19}{20}}
- \def\LasyGuillemets{%
- \DeclareTextCommand{\guillemotleft}{OT1}{\hbox{%
- \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}}%
- \DeclareTextCommand{\guillemotright}{OT1}{\hbox{%
- \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}}
- \IfFileExists{t1lmr.fd}{\PolishGuillemets}{\LasyGuillemets}
- \DeclareTextSymbolDefault{\guillemotleft}{OT1}
- \DeclareTextSymbolDefault{\guillemotright}{OT1}
- \def\guill@spacing{\penalty\@M\hskip.8\fontdimen2\font
- plus.3\fontdimen3\font
- minus.8\fontdimen4\font}
- \DeclareRobustCommand*{\begin@guill}{\leavevmode
- \guillemotleft\penalty\@M\guill@spacing}
- \DeclareRobustCommand*{\end@guill}{\ifdim\lastskip>\z@\unskip\fi
- \penalty\@M\guill@spacing\guillemotright\xspace}
- \AtBeginDocument{\ifx\xspace\@undefined\let\xspace\relax\fi}
- \def\bbl@frenchguillemets{\renewcommand{\og}{\begin@guill}%
- \renewcommand{\fg}{\end@guill}}
- \def\bbl@nonfrenchguillemets{\renewcommand{\og}{``}%
- \renewcommand{\fg}{\ifdim\lastskip>\z@\unskip\fi ''}}
-% \end{macrocode}
-% For \emph{Plain}\TeX, and \LaTeX-2.09 we define |\begin@guill|
-% and |\end@guill| using math symbols |\ll| and |\gg|.
+ \def\partname{\protect\@Fpt partie}%
+ \def\@Fpt{{\ifcase\value{part}\or Premi\`ere\or Deuxi\`eme\or
+ Troisi\`eme\or Quatri\`eme\or Cinqui\`eme\or Sixi\`eme\or
+ Septi\`eme\or Huiti\`eme\or Neuvi\`eme\or Dixi\`eme\or Onzi\`eme\or
+ Douzi\`eme\or Treizi\`eme\or Quatorzi\`eme\or Quinzi\`eme\or
+ Seizi\`eme\or Dix-septi\`eme\or Dix-huiti\`eme\or Dix-neuvi\`eme\or
+ Vingti\`eme\fi}\space\def\thepart{}}%
+ \def\pagename{page}%
+ \def\seename{{\emph{voir}}}%
+ \def\alsoname{{\emph{voir aussi}}}%
+ \def\enclname{P.~J. }%
+ \def\ccname{Copie \`a }%
+ \def\headtoname{}%
+ \def\proofname{D\'emonstration}%
+ \def\glossaryname{Glossaire}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% As some users who choose |frenchb| or |francais| as option of
+% \babel, might customise |\captionsfrenchb| or |\captionsfrancais|
+% in the preamble, we merge their changes at the |\begin{document}|
+% when they do so.
+% The other variants of French (canadien, acadian) are defined by
+% checking if the relevant option was used and then adding one extra
+% level of expansion.
+%
+% \begin{macrocode}
+\AtBeginDocument{\let\captions@French\captionsfrench
+ \@ifundefined{captionsfrenchb}%
+ {\let\captions@Frenchb\relax}%
+ {\let\captions@Frenchb\captionsfrenchb}%
+ \@ifundefined{captionsfrancais}%
+ {\let\captions@Francais\relax}%
+ {\let\captions@Francais\captionsfrancais}%
+ \def\captionsfrench{\captions@French
+ \captions@Francais\captions@Frenchb}%
+ \def\captionsfrancais{\captionsfrench}%
+ \def\captionsfrenchb{\captionsfrench}%
+ \iflanguage{french}{\captionsfrench}{}%
+ }
+\@ifpackagewith{babel}{canadien}{%
+ \def\captionscanadien{\captionsfrench}%
+ \def\datecanadien{\datefrench}%
+ \def\extrascanadien{\extrasfrench}%
+ \def\noextrascanadien{\noextrasfrench}%
+ }{}
+\@ifpackagewith{babel}{acadian}{%
+ \def\captionsacadian{\captionsfrench}%
+ \def\dateacadian{\datefrench}%
+ \def\extrasacadian{\extrasfrench}%
+ \def\noextrasacadian{\noextrasfrench}%
+ }{}
+% \end{macrocode}
+%
+% \begin{macro}{\CaptionSeparator}
+% Let's consider now captions in figures and tables.
+% In French, captions in figures and tables should be printed with
+% endash (`--') instead of the standard `:'.
+%
+% The standard definition of |\@makecaption| (e.g., the one provided
+% in article.cls, report.cls, book.cls which is frozen for \LaTeXe{}
+% according to Frank Mittelbach), has been saved in
+% |\STD@makecaption| before making `:' active
+% (see section~\ref{sec-punct}). `AtBeginDocument' we compare it to
+% its current definition (some classes like koma-script classes,
+% AMS classes, ua-thesis.cls\dots change it).
+% If they are identical, frenchb just adds a hook called
+% |\CaptionSeparator| to |\@makecaption|, |\CaptionSeparator|
+% defaults to `: ' as in the standard |\@makecaption|, and will be
+% changed to ` -- ' in French.
+% If the definitions differ, frenchb doesn't overwrite the changes,
+% but prints a message in the .log file.
+%
% \begin{macrocode}
-\else
- \def\begin@guill{\leavevmode\raise0.25ex
- \hbox{$\scriptscriptstyle\ll$}%
- \penalty\@M\hskip.8\fontdimen2\font
- plus.3\fontdimen3\font
- minus.3\fontdimen4\font}
- \def\end@guill{\ifdim\lastskip>\z@\unskip\penalty\@M\fi
- \penalty\@M\hskip.8\fontdimen2\font
- plus.3\fontdimen3\font minus.3\fontdimen4\font
- \raise0.25ex\hbox{$\scriptscriptstyle\gg$}}
- \let\xspace\relax
- \def\bbl@frenchguillemets{\let\og\begin@guill
- \let\fg\end@guill}
- \def\bbl@nonfrenchguillemets{\def\og{``}%
- \def\fg{\ifdim\lastskip>\z@\unskip\fi ''}}
-\fi
+\def\CaptionSeparator{\string:\space}
+\long\def\FB@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\CaptionSeparator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\CaptionSeparator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\AtBeginDocument{%
+ \ifx\@makecaption\STD@makecaption
+ \global\let\@makecaption\FB@makecaption
+ \else
+ \@ifundefined{@makecaption}{}%
+ {\PackageWarning{frenchb.ldf}%
+ {The definition of \protect\@makecaption\space
+ has been changed,\MessageBreak
+ frenchb will NOT customise it;\MessageBreak reported}%
+ }%
+ \fi
+ \let\FB@makecaption\relax
+ \let\STD@makecaption\relax
+}
\expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@frenchguillemets}
+ \def\CaptionSeparator{\space\textendash\space}}
\expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \bbl@nonfrenchguillemets}
+ \def\CaptionSeparator{\string:\space}}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
%
% \subsection{French lists}
% \label{sec-lists}
%
-% \begin{macro}{\bbl@frenchlistspacing}
-% \begin{macro}{\bbl@nonfrenchlistspacing}
+% \begin{macro}{\listFB}
+% \begin{macro}{\listORI}
% Vertical spacing in general 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; as most lists are based on
-% |\list| we will redefine |\list| (up to version~1.4, the more
-% internal command |\@trivlist| was redefined, this ensured that
-% all lists would have common settings, but didn't allow the users
-% to provide their own settings, as pointed out by P.~Pichaureau).
-% If standard LaTeX{} settings are preferred, it is easy to issue
-% the command |\FrenchListSpacingfalse| in the preamble or in
-% |frenchb.cfg|. Please note that changing the flag
-% |\FrenchListSpacing| will \emph{not} take effect immediately,
-% but next time language French is switched on.
+% |\list| we will define a variant of |\list| (|\listFB|) to
+% be used in French.
%
% The amount of vertical space before and after a list is given by
% |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new
@@ -1421,200 +1267,135 @@
% 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.\\
-% Of course, this code is only for \LaTeX.
-%
-% \changes{frenchb-1.3}{1997/05/30}{Add a switch to allow \cs{LaTeXe}
-% standard settings.}
+% will be noticeable when |\parskip| is \emph{not} null.
%
-% \changes{frenchb-1.5a}{2001/01/02}{Redefine \cs{list} instead of
-% \cs{@trivlist} to provide more freedom to the user, but still
-% allow the former way with \cs{ifFrenchOldTrivlist}.}
-%
-% \changes{frenchb-1.5g}{2001/09/09}{\cs{parskip} is of type `skip',
-% its mean value only (not the glue) should be moved from
-% \cs{topsep} to \cs{partopsep}: substracting glue can lead to
-% weird results. Bug pointed out by Michel Bovani.}
-%
-% \begin{macrocode}
-\newif\ifFrenchListSpacing \FrenchListSpacingtrue
-\newif\ifFrenchOldTrivlist
-\ifLaTeX
- \let\listORI\list
-% \end{macrocode}
% |\endlist| is not redefined, but |\endlistORI| is provided for
% the users who prefer to define their own lists from the original
% command, they can code: |\begin{listORI}{}{} \end{listORI}|.
% \begin{macrocode}
- \let\endlistORI\endlist
- \def\FR@listsettings{%
- \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}%
+\let\listORI\list
+\let\endlistORI\endlist
+\def\FB@listsettings{%
+ \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 substracted from |\topsep| and added to
+% 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\listFR#1#2{\listORI{#1}{\FR@listsettings #2}}%
-% \end{macrocode}
-% Keep the |\@trivlist| redefinition from version 1.4 (only
-% for compatibility reasons). The flag |\ifFrenchOldTrivlist|
-% could happen to be useful to process older documents.
-% \begin{macrocode}
- \let\@trivlistORI\@trivlist
- \def\@trivlistFR{\FR@listsettings\@trivlistORI}
- \def\bbl@frenchlistspacing{\ifFrenchListSpacing\let\list\listFR\fi
- \ifFrenchOldTrivlist\let\@trivlist\@trivlistFR
- \let\list\listORI\fi}
- \def\bbl@nonfrenchlistspacing{\let\list\listORI
- \let\@trivlist\@trivlistORI}
- \expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@frenchlistspacing}
- \expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \bbl@nonfrenchlistspacing}
-\fi
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}}%
+\def\listFB#1#2{\listORI{#1}{\FB@listsettings #2}}%
+\let\endlistFB\endlist
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\bbl@frenchitemize}
-% \begin{macro}{\bbl@nonfrenchitemize}
-% The layout of French itemize-lists has changed between version~1.2
-% and~1.3. Jacques Andr\'e and Thierry Bouche pointed out to me
-% that vertical spacing between items, before and after the list,
-% should \emph{null} with \emph{no glue} added. Moreover
-% horizontal spacing was not correct either: the item labels of a
-% first level list should be vertically aligned on the paragraph's
-% first character (at |\parindent| from the left margin).
-% Checking the book ``Lexique des r\`egles typographiques en usage
-% \`a l'Imprimerie nationale'' confirmed their points, so the itemize
-% environment has been totally redefined for French in version~1.3.
-%
-% Several people pointed out to me that the layout of lists can
-% either be set by the current language or be tuned independently of
-% the language as part of the layout of the document. So hooks should
-% be provided to switch off the special settings made in |frenchb|.
-% Setting |\FrenchItemizeSpacingfalse| \emph{after} loading |frenchb|
-% in the preamble switches back to settings of version~1.2 (this can
-% be useful to process old documents). If you want all list spacings
-% to be exactly what they are in standard \LaTeXe{}, then add also
-% |\FrenchListSpacingfalse| in the preamble \emph{after} loading
-% |frenchb|. Both switches can also be set in |frenchb.cfg|.
-% Please note that changing the flags |\FrenchItemizeSpacing| and
-% |\FrenchListSpacing| will \emph{not} take effect immediately,
-% but next time language French is switched on.
-%
-% The \textbullet{} is never used in French itemize-lists,
-% a long dash `--' is preferred for all levels. The item label used
-% in French is stored in |\FrenchLabelItem}|, it defaults to '--' and
-% can be changed using |\renewcommand| (see the example
-% configuration file above).
-%
-% \changes{frenchb-1.1}{1996/01/25}{Save original definitions of label
-% items, instead of hard coding them in \cs{bbl@nonfrenchitems}
-% (suggested by Vincent Jalby).}
-%
-% \changes{frenchb-1.1}{1996/01/26}{Tune vertical spacing in
-% French lists.}
-%
-% \changes{frenchb-1.3}{1997/05/30}{Change -{}- to \cs{textendash},
-% completely redesign the itemize environment in French and add
-% a hook to switch back to \cs{LaTeXe} standard itemize lists.}
-%
-% \changes{frenchb-1.4}{1999/07/08}{\cs{newif} only in LaTeX.}
-%
-% \changes{frenchb-1.4}{1999/07/08}{Add a hook \cs{FrenchLabelItem}
-% which defaults to \cs{textendash}, this was suggested by
-% Michel Bovani to allow some customization of label items.}
-%
-% \changes{frenchb-1.5a}{2001/01/02}{Redesign \cs{itemize} to allow
-% users to change the markers of any level in itemize lists.}
-%
-% \changes{frenchb-1.5g}{2001/09/09}{\cs{parskip} is of type `skip',
-% its mean value only (not the glue) should be moved from
-% \cs{topsep} to \cs{partopsep}: substracting glue can lead to
-% weird results. Bug pointed out by Michel Bovani.}
-%
-% \begin{macrocode}
-\newif\ifFrenchItemizeSpacing \FrenchItemizeSpacingtrue
-\ifLaTeX
- \newcommand{\FrenchLabelItem}{\textendash}
- \newcommand{\Frlabelitemi}{\FrenchLabelItem}
- \newcommand{\Frlabelitemii}{\FrenchLabelItem}
- \newcommand{\Frlabelitemiii}{\FrenchLabelItem}
- \newcommand{\Frlabelitemiv}{\FrenchLabelItem}
- \def\bbl@frenchitemize{%
+% \begin{macro}{\itemizeFB}
+% \begin{macro}{\itemizeORI}
+% \begin{macro}{\bbl@frenchlabelitems}
+% \begin{macro}{\bbl@nonfrenchlabelitems}
+% Let's now consider French itemize lists. They differ from those
+% provided by the standard \LaTeXe{} classes:
+% \begin{itemize}
+% \item vertical spacing between items, before and after
+% the list, should be \emph{null} with \emph{no glue} added;
+% \item the item labels of a first level list should be vertically
+% aligned on the paragraph's first character (i.e. at
+% |\parindent| from the left margin);
+% \item the `\textbullet' is never used in French itemize-lists,
+% a long dash `--' is preferred for all levels. The item label
+% used in French is stored in |\FrenchLabelItem}|, it defaults
+% to `--' and can be changed using |\frenchbsetup{}| (see
+% section~\ref{sec-keyval}).
+% \end{itemize}
+%
+% \begin{macrocode}
+\newcommand*{\FrenchLabelItem}{\textendash}
+\newcommand*{\Frlabelitemi}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemii}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemiii}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemiv}{\FrenchLabelItem}
+% \end{macrocode}
+% |\bbl@frenchlabelitems| saves current itemize labels and changes
+% them to their value in French. This code should never be executed
+% twice in a row, so we need a new flag that will be set and reset
+% by |\bbl@nonfrenchlabelitems| and |\bbl@frenchlabelitems|.
+% \begin{macrocode}
+\newif\ifFB@enterFrench \FB@enterFrenchtrue
+\def\bbl@frenchlabelitems{%
+ \ifFB@enterFrench
\let\@ltiORI\labelitemi
\let\@ltiiORI\labelitemii
\let\@ltiiiORI\labelitemiii
\let\@ltivORI\labelitemiv
- \let\itemizeORI\itemize
\let\labelitemi\Frlabelitemi
\let\labelitemii\Frlabelitemii
\let\labelitemiii\Frlabelitemiii
\let\labelitemiv\Frlabelitemiv
- \ifFrenchItemizeSpacing
-% \end{macrocode}
-% Make sure |\itemize| uses |\@trivlistORI| even with
-% |\FrenchOldTrivlisttrue|.
-% \begin{macrocode}
- \def\itemize{\let\@trivlist\@trivlistORI
- \ifnum \@itemdepth >\thr@@\@toodeep\else
- \advance\@itemdepth\@ne
- \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
- \expandafter
- \listORI
- \csname\@itemitem\endcsname
- {\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
- \setlength{\leftmargin}{\labelwidth}%
- \addtolength{\leftmargin}{\labelsep}%
- \ifnum\@listdepth=0
- \setlength{\itemindent}{\parindent}%
- \else
- \addtolength{\leftmargin}{\parindent}%
- \fi
- \setlength{\itemsep}{\z@}%
- \setlength{\parsep}{\z@}%
- \setlength{\topsep}{\z@}%
- \setlength{\partopsep}{\z@}%
+ \FB@enterFrenchfalse
+ \fi
+}
+\let\itemizeORI\itemize
+\let\enditemizeORI\enditemize
+\let\enditemizeFB\enditemize
+\def\itemizeFB{%
+ \ifnum \@itemdepth >\thr@@\@toodeep\else
+ \advance\@itemdepth\@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter
+ \listORI
+ \csname\@itemitem\endcsname
+ {\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \ifnum\@listdepth=0
+ \setlength{\itemindent}{\parindent}%
+ \else
+ \addtolength{\leftmargin}{\parindent}%
+ \fi
+ \setlength{\itemsep}{\z@}%
+ \setlength{\parsep}{\z@}%
+ \setlength{\topsep}{\z@}%
+ \setlength{\partopsep}{\z@}%
% \end{macrocode}
% |\parskip| is of type `skip', its mean value only (\emph{not
-% the glue}) should be substracted from |\topsep| and added to
+% 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}}%
- \fi}%
- \fi}
-% \end{macrocode}
-% The user's changes in labelitems are saved when leaving French
-% for further use when switching back to French.
-% \begin{macrocode}
- \def\bbl@nonfrenchitemize{\let\Frlabelitemi\labelitemi
- \let\Frlabelitemii\labelitemii
- \let\Frlabelitemiii\labelitemiii
- \let\Frlabelitemiv\labelitemiv
- \let\labelitemi\@ltiORI
- \let\labelitemii\@ltiiORI
- \let\labelitemiii\@ltiiiORI
- \let\labelitemiv\@ltivORI
- \let\itemize\itemizeORI}
- \expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@frenchitemize}
- \expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \bbl@nonfrenchitemize}
-\fi
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}}%
+ \fi}
+% \end{macrocode}
+% The user's changes in labelitems are saved when leaving French for
+% further use when switching back to French. This code should never
+% be executed twice in a row (toggle with |\bbl@frenchlabelitems|).
+% \begin{macrocode}
+\def\bbl@nonfrenchlabelitems{%
+ \ifFB@enterFrench
+ \else
+ \let\Frlabelitemi\labelitemi
+ \let\Frlabelitemii\labelitemii
+ \let\Frlabelitemiii\labelitemiii
+ \let\Frlabelitemiv\labelitemiv
+ \let\labelitemi\@ltiORI
+ \let\labelitemii\@ltiiORI
+ \let\labelitemiii\@ltiiiORI
+ \let\labelitemiv\@ltivORI
+ \FB@enterFrenchtrue
+ \fi
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{French indentation of sections}
% \label{sec-indent}
@@ -1623,843 +1404,712 @@
% \begin{macro}{\bbl@nonfrenchindent}
% In French the first paragraph of each section should be indented,
% this is another difference with US-English.
-% Add this code only in \LaTeX.
-%
-% \changes{frenchb-1.2}{1996/12/27}{Corrected typo
-% \cs{bbl@nonfrenchident}.}
%
% \begin{macrocode}
-\ifLaTeX
- \let\@aifORI\@afterindentfalse
- \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
- \@afterindenttrue}
- \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
- \@afterindentfalse}
- \expandafter\addto\csname extras\CurrentOption\endcsname{%
- \bbl@frenchindent}
- \expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \bbl@nonfrenchindent}
-\fi
+\let\@aifORI\@afterindentfalse
+\def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+\def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Formatting footnotes}
+% \label{sec-footnotes}
%
-% \changes{frenchb-1.6a}{2003/02/02}{Add two hooks to customize
-% footnotes: \cs{AddThinSpaceBeforeFootnotes} and
-% \cs{FrenchFootnotes} (suggested by Jacques Andr\'e).}
+% \changes{frenchb-2.0}{2006/11/06}{Footnotes are now printed
+% by default `\`a la fran\c caise' for the whole document.}
%
-% \begin{macro}{\AddThinSpaceBeforeFootnotes}
-% \begin{macro}{\FrenchFootnotes}
-% \begin{macro}{\StandardFootnotes}
-% |\AddThinSpaceBeforeFootnotes| redefines |\@footnotemark| (whose
-% definition is saved at the |\begin{document}| in order to include
-% any customization that packages might have done) to add a thinspace
-% before the number or symbol calling a footnote (any space typed
-% in is removed first). |\AddThinSpaceBeforeFootnotes| has no effect
-% on the layout of the footnote itself. Note that |\thanks| in
-% |\maketitle| also relies on |\@footnotemark|, so the thinspace
-% is added there too.
+% \changes{frenchb-2.0b}{2007/04/18}{Just do nothing (except warning)
+% when the bigfoot package is loaded.}
%
-% \changes{frenchb-1.6f}{2003/04/02}{Move \cs{newif} and
-% \cs{newdimen} commands outside \cs{ifLaTeXe} ... \cs{fi}
-% for compatibility with the plain format.}
+% The |bigfoot| package deeply changes the way footnotes are
+% handled. When |bigfoot| is loaded, we just warn the user that
+% frenchb will drop the customisation of footnotes.
%
-% \begin{macrocode}
-\newif\ifthinspace@FN
-\newif\ifFR@fntlayout
-\newdimen\parindentFFN
-\ifLaTeXe
- \newcommand{\AddThinSpaceBeforeFootnotes}{\thinspace@FNtrue}
- \AtBeginDocument{\let\@footnotemarkORI\@footnotemark
- \def\@footnotemarkFR{\leavevmode\unskip\unkern
- \,\@footnotemarkORI}%
- \ifthinspace@FN
- \let\@footnotemark\@footnotemarkFR
- \fi}
-% \end{macrocode}
+% The layout of footnotes is controlled by two flags
+% |\ifFBAutoSpaceFootnotes| and |\ifFBFrenchFootnotes| which are
+% set by options of |\frenchbsetup{}| (see section~\ref{sec-keyval}).
+% Notice that 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 then define |\@makefntextFR|, a variant of |\@makefntext|
+% When |\ifFBAutoSpaceFootnotes| is true, |\@footnotemark| (whose
+% definition is saved at the |\begin{document}| in order to include
+% any customisation that packages might have done) is redefined to
+% add a thin space before the number or symbol calling a footnote
+% (any space typed in is removed first). This has no effect on
+% the layout of the footnote itself.
+%
+% \begin{macrocode}
+\AtBeginDocument{\@ifpackageloaded{bigfoot}%
+ {\PackageWarning{frenchb.ldf}%
+ {bigfoot package in use.\MessageBreak
+ frenchb will NOT customise footnotes;\MessageBreak
+ reported}}%
+ {\let\@footnotemarkORI\@footnotemark
+ \def\@footnotemarkFB{\leavevmode\unskip\unkern
+ \,\@footnotemarkORI}%
+ \ifFBAutoSpaceFootnotes
+ \let\@footnotemark\@footnotemarkFB
+ \fi}%
+ }
+% \end{macrocode}
+%
+% 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
+% specifications of the French `Imprimerie Nationale': footnotes
% will be indented by |\parindentFFN|, numbers (if any) typeset on
% the baseline (instead of textsuperscripts) and followed by a dot
% and an half quad space. 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).
-% The value of |\parindentFFN| will be defined at the
-% |\begin{document}|, as the maximum of |\parindent| and 1.5em.
-%
-% \begin{macrocode}
- \def\ftnISsymbol{\@fnsymbol\c@footnote}
- \long\def\@makefntextFR#1{\ifx\thefootnote\ftnISsymbol
- \@makefntextORI{#1}%
- \else
- \parindent=\parindentFFN
- \rule\z@\footnotesep
- \setbox\@tempboxa\hbox{\@thefnmark}%
- \ifdim\wd\@tempboxa>\z@
- \llap{\@thefnmark}.\kern.5em
- \fi #1
- \fi}%
-% \end{macrocode}
-% We now define two commands |\FrenchFootnotes| and
-% |\StandardFootnotes| which select French or Standard layout
-% for footnotes; we have to save the standard definition of
-% |\@makefntext| at the |\begin{document}|, and then redefine
-% |\@makefntext| according to the value of an internal flag set
-% by |\FrenchFootnotes| and reset by |\StandardFootnotes|.
-% \begin{macrocode}
- \AtBeginDocument{\parindentFFN=\parindent
- \ifdim\parindentFFN<1.5em\parindentFFN=1.5em\fi
+%
+% \changes{frenchb-2.0}{2006/11/06}{\cs{parindentFFN} not changed if
+% already defined (for cah-gut.cls, JA wants \cs{parindentFFN}=0pt.}
+%
+% The value of |\parindentFFN| will be redefined at the
+% |\begin{document}|, as the maximum of |\parindent| and 1.5em
+% \emph{only if} 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
+\def\ftnISsymbol{\@fnsymbol\c@footnote}
+\long\def\@makefntextFB#1{\ifx\thefootnote\ftnISsymbol
+ \@makefntextORI{#1}%
+ \else
+ \parindent=\parindentFFN
+ \rule\z@\footnotesep
+ \setbox\@tempboxa\hbox{\@thefnmark}%
+ \ifdim\wd\@tempboxa>\z@
+ \llap{\@thefnmark}.\kern.5em
+ \fi #1
+ \fi}%
+% \end{macrocode}
+%
+% We save the standard definition of |\@makefntext| at the
+% |\begin{document}|, and then redefine |\@makefntext| according to
+% the value of flag |\ifFBFrenchFootnotes| (true or false).
+%
+% \begin{macrocode}
+\AtBeginDocument{\@ifpackageloaded{bigfoot}{}%
+ {\ifdim\parindentFFN<10in
+ \else
+ \parindentFFN=\parindent
+ \ifdim\parindentFFN<1.5em\parindentFFN=1.5em\fi
+ \fi
\let\@makefntextORI\@makefntext
\long\def\@makefntext#1{%
- \ifFR@fntlayout
- \@makefntextFR{#1}%
+ \ifFBFrenchFootnotes
+ \@makefntextFB{#1}%
\else
\@makefntextORI{#1}%
- \fi
- }%
- }
- \newcommand{\FrenchFootnotes}{\FR@fntlayouttrue}
- \newcommand{\StandardFootnotes}{\FR@fntlayoutfalse}
-\fi
+ \fi}%
+ }%
+ }
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Formatting numbers}
-% \label{sec-numbers}
-%
-% \changes{frenchb-1.4}{1999/10/02}{Add a hook to let the comma
-% be in math mode of type \cs{mathord} in French, as a decimal
-% separator should be.}
%
-% \changes{frenchb-1.6e}{2003/11/09}{The change from \cs{mathpunct}
-% to \cs{mathord} should be encoding independent (suggested by
-% Michel Bovani): just strip the highest hexadecimal digit to
-% switch from type \cs{mathpunct} to type \cs{mathord}.}
-%
-% \begin{macro}{\DecimalMathComma}
-% \begin{macro}{\StandardMathComma}
-% As mentioned in the \TeX{}book p.~134, the comma is of type
-% |\mathpunct| in math mode: it is automatically followed by a
-% 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.
+% For compatibility reasons, we provide definitions for the commands
+% dealing with the layout of footnotes in frenchb version~1.6.
+% |\frenchbsetup{}| (see in section \ref{sec-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}
-\newcount\std@mcc
-\newcount\dec@mcc
-\std@mcc=\mathcode`\,
-\dec@mcc=\std@mcc
-\@tempcnta=\std@mcc
-\divide\@tempcnta by "1000
-\multiply\@tempcnta by "1000
-\advance\dec@mcc by -\@tempcnta
-\newcommand{\DecimalMathComma}{\iflanguage{french}%
- {\mathcode`\,=\dec@mcc}{}%
- \addto\extrasfrench{\mathcode`\,=\dec@mcc}}
-\newcommand{\StandardMathComma}{\mathcode`\,=\std@mcc
- \addto\extrasfrench{\mathcode`\,=\std@mcc}}
-\expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \mathcode`\,=\std@mcc}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \changes{frenchb-1.2}{1996/12/27}{New macros \cs{nombre}
-% \cs{decimalsep} and \cs{thousandsep} added to format numbers.}
-%
-% In English the decimal part starts with a point and thousands
-% should be separated by a comma: an approximation of $1000\pi$
-% should be inputed as |$3{,}141.592{,}653$| in math mode and
-% as |3,141.592,653| in text.\\
-% In French the decimal part starts with a comma and thousands
-% should be separated by a space; the same approximation of
-% $1000\pi$ should be inputed as |$3\;141{,}592\;653$| in math mode
-% and as something like |3~141,592~653| in text: in math mode, the
-% comma is of type |\mathpunct| (thus normally followed by a space)
-% while the point is of type |\mathord| (no space added).
-%
-% Thierry Bouche suggested that a second type of comma, of type
-% |\mathord| would be useful in math mode, and proposed to
-% introduce a command (named |\decimalsep| in this package),
-% the expansion of which would depend on the current language.
-%
-% Vincent Jalby suggested a command |\nombre| to conveniently
-% typeset numbers: inputting |\nombre{3141,592653}| either in
-% text or in math mode will format this number properly according
-% to the current language (French or non-French).
-%
-% |\nombre| accepts an optional argument which happens to be
-% useful with the package `dcolumn', it specifies the decimal
-% separator used in the \emph{source code}:
-% |\newcolumntype{d}{D{,}{\decimalsep}{-1}}| \\
-% |\begin{tabular}{|d|}\hline | \\
-% | 3,14 \\ | \\
-% | \nombre[,]{123,4567} \\ | \\
-% | \nombre[,]{9876,543}\\\hline| \\
-% |\end{tabular} | \\
-% will print a column of numbers aligned on the decimal point
-% (comma or point depending on the current language), each slice
-% of 3 digits being separated by a space or a comma according to
-% the current language.
-%
-% \begin{macro}{\decimalsep}
-% \begin{macro}{\thousandsep}
-% We need a internal definition, valid in both text and math mode,
-% for the comma (|\@comma@|) and another one for the unbreakable
-% fixed length space (no glue) used in French (|\f@thousandsep|).
-%
-% The commands |\decimalsep| and |\thousandsep| get default
-% definitions (for the English language) when |frenchb| is loaded;
-% these definitions will be updated when the current language is
-% switched to or from French.
-%
-% \changes{frenchb-1.2b}{1997/04/24}{Extra care taken to handle
-% signs properly inside \cs{nombre} in \LaTeXe.}
-%
-% \changes{frenchb-1.2b}{1997/04/24}{Definition of \cs{nombre} changed
-% to correct a bug with moving arguments in \LaTeX-2.09.}
-%
-% \changes{frenchb-1.4g}{2000/10/07}{Added a new hook
-% \cs{ThinSpaceInFrenchNumbers} to have thin spaces instead of
-% normal spaces (the default) when formatting French numbers.}
-%
-% \begin{macrocode}
-\mathchardef\m@comma=\dec@mcc
-\def\@comma@{\ifmmode\m@comma\else,\fi}
-\def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
-\def\ThinSpaceInFrenchNumbers{\def\f@thousandsep{%
- \ifmmode\mskip3mu\else\penalty\@M\kern.16667em\fi}}
-\newcommand{\decimalsep}{.}
-\newcommand{\thousandsep}{\@comma@}
-\expandafter\addto\csname extras\CurrentOption\endcsname{%
- \def\decimalsep{\@comma@}%
- \def\thousandsep{\f@thousandsep}}
-\expandafter\addto\csname noextras\CurrentOption\endcsname{%
- \def\decimalsep{.}%
- \def\thousandsep{\@comma@}}
+\newcommand*{\AddThinSpaceBeforeFootnotes}{\FBAutoSpaceFootnotestrue}
+\newcommand*{\FrenchFootnotes}{\FBFrenchFootnotestrue}
+\newcommand*{\StandardFootnotes}{\FBFrenchFootnotesfalse}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
%
-% \changes{frenchb-1.3}{1997/05/24}{Avoid mixing text and math mode
-% whenever possible: check if \cs{textminus} and co. are available.}
-% Signs can now be entered inside |\nombre|. When |\nombre| is
-% used in text-mode, signs should be text symbols to get the
-% series, shape... from the current text-font. When signs are not
-% available in text-mode, we provide some defaults.
-%
-% \begin{macrocode}
-\providecommand{\textminus}{\textendash}
-\providecommand{\textplusminus}{\ensuremath{\pm}}
-\providecommand{\textminusplus}{\ensuremath{\mp}}
-\def\fb@minus{\ifmmode-\else\textminus\fi}
-\def\fb@plusminus{\ifmmode\pm\else\textplusminus\fi}
-\def\fb@minusplus{\ifmmode\mp\else\textminusplus\fi}
-% \end{macrocode}
+% \subsection{Global layout}
+% \label{sec-global}
%
-% \begin{macro}{\nombre}
-% The decimal separator used when \emph{inputing} a number
-% with |\nombre| \emph{has to be a comma}.
-% |\nombre| splits the inputed number into two parts: what
-% comes before the first comma will be formatted by
-% \cs{@integerpart} while the rest (if not empty) will be
-% formatted by \cs{@decimalpart}. Both parts, once formatted
-% separately will be merged together with between them, either
-% the decimal separator \cs{decimalsep} or (in \LaTeXe{}
-% \emph{only}) the optional argument of |\nombre|.
-%
-% \changes{frenchb-1.3}{1997/05/24}{Added \cs{@empty} to the
-% definitions of \cs{nb@first} and \cs{nb@suite}, as suggested
-% by V. Jalby, to cope with possibly empty integer part as in
-% \cs{nombre{,123}}.}
-%
-% \begin{macrocode}
-\if@Two@E
- \newcommand{\nombre}[2][\decimalsep]{\def\@decimalsep{#1}%
- \@@nombre#2\@empty,\@empty,\@nil}
-\else
- \def\@decimalsep{\decimalsep}
- \newcommand{\nombre}[1]{\@nombre#1\@empty,\@empty,\@nil}
-\fi
-\def\@firstofmany#1#2,{#1}
-\def\@@nombre#1,#2,#3\@nil{%
- \def\nb@sign{}%
- \edef\nb@first{\@firstofmany #1\@empty,}%
- \edef\nb@suite{\@secondoftwo #1\@empty,}%
- \if+\nb@first \def\nb@sign{+}\fi
- \if-\nb@first \def\nb@sign{\fb@minus}\fi
- \expandafter\ifx\nb@first\pm \def\nb@sign{\fb@plusminus}\fi
- \expandafter\ifx\nb@first\mp \def\nb@sign{\fb@minusplus}\fi
- \ifx\@empty\nb@sign
- \let\@tmp\nb@suite\edef\nb@suite{\nb@first\@tmp}%
- \fi
- \nb@sign\expandafter\@nombre\nb@suite#2,#3\@nil}
-\def\@nombre#1,#2,#3\@nil{%
- \ifx\@empty#2%
- \@integerpart{#1}%
- \else
- \@integerpart{#1}\@decimalsep\@decimalpart{#2}%
- \fi}
-% \end{macrocode}
-% The easiest bit is the decimal part:
-% We attempt to read the first four digits of the decimal part, if
-% it has less than 4 digits, we just have to print them, otherwise
-% |\thousandsep| has to be appended after the third digit, and the
-% algorithm is applied recursively to the rest of the decimal part.
-% \begin{macrocode}
-\def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
-\def\@@decimalpart#1#2#3#4{#1#2#3%
- \ifx\@empty#4%
- \else
- \thousandsep\expandafter\@@decimalpart\expandafter#4%
- \fi}
-% \end{macrocode}
-% Formatting the integer part is more difficult because the slices
-% of 3 digits start from the \emph{bottom} while the number is
-% read from the top!
-% This (tricky) code is borrowed from David Carlisle's comma.sty.
-% \begin{macrocode}
-\def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
-\def\@@integerpart#1#2#3#4{%
- \ifx\@empty#2%
- \@addthousandsep#1\relax
- \else
- \ifx\@empty#3%
- \@addthousandsep\@empty\@empty#1#2\relax
- \else
- \ifx\@empty#4%
- \@addthousandsep\@empty#1#2#3\relax
- \else
- \@@integerpartafterfi{#1#2#3#4}%
- \fi
- \fi
- \fi}
-\def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
-\def\@addthousandsep#1#2#3#4{#1#2#3%
- \if#4\relax
- \else
- \thousandsep\expandafter\@addthousandsep\expandafter#4%
- \fi}
+% In multilingual documents, some typographic rules must depend
+% on the current language (e.g., hyphenation, typesetting of
+% numbers, spacing before double punctuation\dots), others should,
+% IMHO, be kept global to the document: especially the layout of
+% lists (see~\ref{sec-lists}) and footnotes
+% (see~\ref{sec-footnotes}), and the indentation of the first
+% paragraph of sections (see~\ref{sec-indent}).
+%
+% From version 2.0 on, two flags control the global layout, their
+% values are chosen in |\frenchbsetup{}| (see
+% section~\ref{sec-keyval}). The default behaviour of frenchb is
+% to customise the layout (i.e. lists, indentation of the first
+% paragraphs of sections) only when the current language is French.
+% Unifying the layout can be done in two ways: frenchb will leave
+% the standard layout provided by the \LaTeX{} class untouched
+% in French when the option |StandardLayout| is made true in
+% |\frenchbsetup{}| or frenchb will (try to) force the layout
+% outside French to be the same as in French when the option
+% |GlobalLayoutFrench| is made true in |\frenchbsetup{}|.
+% Of course, the second option only works if the other languages
+% do not alter the layout.
+%
+% The former commands |\FrenchLayout| and |\StandardLayout| are kept
+% for compatibility reasons but should no longer be used.
+%
+% \begin{macrocode}
+\newcommand*{\FrenchLayout}{\FBGlobalLayoutFrenchtrue
+ \PackageWarning{frenchb.ldf}%
+ {\protect\FrenchLayout\space is obsolete. Please use\MessageBreak
+ \protect\frenchbsetup{GlobalLayoutFrench} instead.}%
+}
+\newcommand*{\StandardLayout}{\FBStandardLayouttrue
+ \PackageWarning{frenchb.ldf}%
+ {\protect\StandardLayout\space is obsolete. Please use\MessageBreak
+ \protect\frenchbsetup{StandardLayout} instead.}%
+}
+\@onlypreamble\FrenchLayout
+\@onlypreamble\StandardLayout
% \end{macrocode}
-% \end{macro}
%
% \subsection{Dots\dots}
% \label{sec-dots}
%
-% \changes{frenchb-1.3}{1997/06/03}{Added this section.}
+% \begin{macro}{\FBtextellipsis}
% \LaTeXe'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 |\Frtextellipsis| for French (in \LaTeXe{} only).
+% We define |\FBtextellipsis| for French (in \LaTeXe{} only).
%
-% \changes{frenchb-1.4c}{1999/11/17}{Bug correction: \cs{xspace}
-% didn't work in \cs{dots} without amsmath.sty.}
% The |\if| construction in the \LaTeXe{} 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{frenchb-1.4d}{2000/02/01}{AMS-LaTeX 2.0 provides a much
-% better spacing for \cs{dots} than 1.2, so let's take advantage
-% of it when amsmath (up to 1.2 or newer) is loaded.}
+% \changes{frenchb-2.0}{2006/11/06}{Added special case for LY1
+% encoding, see bug report from Bruno Voisin (2004/05/18).}
+%
+% LY1 has a ready made character for |\textellipsis|, it should be
+% used in French too (pointed out by Bruno Voisin).
%
-% \begin{macro}{\Frtextellipsis}
% \begin{macrocode}
-\ifLaTeXe
- \DeclareTextCommandDefault{\Frtextellipsis}{%
+\DeclareTextSymbol{\FBtextellipsis}{LY1}{133}
+\DeclareTextCommandDefault{\FBtextellipsis}{%
.\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}
% \end{macrocode}
% |\Mdots@| and |\Tdots@ORI| 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 |\Frtextellipsis|
+% switching from/to French, while |\Tdots@| is |\FBtextellipsis|
% in French and |\Tdots@ORI| otherwise.
% \begin{macrocode}
- \newcommand{\Tdots@ORI}{\@xp\textellipsis}
- \newcommand{\Tdots@}{\Tdots@ORI}
- \newcommand{\Mdots@}{\@xp\mdots@}
- \AtBeginDocument{\DeclareRobustCommand{\dots}{\relax
- \csname\ifmmode M\else T\fi dots@\endcsname}%
- \ifx\@xp\@undefined\let\@xp\relax\fi
- \ifx\mdots@\@undefined\let\Tdots@ORI\textellipsis
- \let\Mdots@\mathellipsis\fi}
- \def\bbl@frenchdots{\let\Tdots@\Frtextellipsis}
- \def\bbl@nonfrenchdots{\let\Tdots@\Tdots@ORI}
- \expandafter\addto\csname extras\CurrentOption\endcsname{%
+\newcommand*{\Tdots@ORI}{\@xp\textellipsis}
+\newcommand*{\Tdots@}{\Tdots@ORI}
+\newcommand*{\Mdots@}{\@xp\mdots@}
+\AtBeginDocument{\DeclareRobustCommand{\dots}{\relax
+ \csname\ifmmode M\else T\fi dots@\endcsname}%
+ \@ifundefined{@xp}{\let\@xp\relax}{}%
+ \@ifundefined{mdots@}{\let\Tdots@ORI\textellipsis
+ \let\Mdots@\mathellipsis}{}}
+\def\bbl@frenchdots{\let\Tdots@\FBtextellipsis}
+\def\bbl@nonfrenchdots{\let\Tdots@\Tdots@ORI}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
\bbl@frenchdots}
- \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
\bbl@nonfrenchdots}
-\fi
% \end{macrocode}
% \end{macro}
%
-% \subsection{Global layout}
-% \label{sec-global}
-%
-% \changes{frenchb-1.4}{1999/10/03}{Added this section.}
-%
-% In multilingual documents, some typographic rules must depend
-% on the current language (e.g., hyphenation, typesetting of
-% numbers, spacing before double punctuation\dots),
-% others should, IMHO, be kept global to the document:
-% especially the layout of lists (see~\ref{sec-lists})
-% and the indentation of the first paragraph of sections
-% (see~\ref{sec-indent}).
-%
-% \begin{macro}{\FrenchLayout}
-% \begin{macro}{\StandardLayout}
-% In a multilingual document, a unified look, either the French
-% one or the standard one, can be assigned to the whole document:
-% adding |\FrenchLayout| will give a global ``French look'' to
-% the document (e.g., lists, regardless the current language, will
-% be typeset as in French) and |\StandardLayout| forces a global
-% ``US-English'' look.
-% Both of these commands can only be used \emph{before} the
-% |\begin{document}|.
-% |\StandardLayout| can also be of interest for class designers
-% who do not want |frenchb| to interfere with their global layout
-% choices.
-%
-% As of version~1.4, |\FrenchLayout| and |\StandardLayout| only
-% affect:
-% \begin{itemize}
-% \item the layout of lists (see~\ref{sec-lists}),
-% \item the indentation of the first paragraph of sections
-% (see~\ref{sec-indent}).
-% \end{itemize}
-%
-% \changes{frenchb-1.6c}{2003/06/30}{Bug correction: the definitions
-% of \cs{labelitemi} ... \cs{itemize} need to be saved in
-% \cs{StandardLayout}.}
-%
-% \begin{macrocode}
-\ifLaTeXe
- \newcommand{\FrenchLayout}{%
- \renewcommand{\StandardLayout}{%
- \PackageWarning{frenchb.ldf}%
- {\protect\StandardLayout\space makes no change\MessageBreak
- (\protect\FrenchLayout\space has been selected before
- \MessageBreak for the whole document)}%
- }%
- \AtBeginDocument{\bbl@frenchitemize\bbl@frenchlistspacing
- \bbl@frenchindent}%
- \let\bbl@nonfrenchitemize\relax
- \let\bbl@nonfrenchlistspacing\relax
- \let\bbl@nonfrenchindent\relax}
- \newcommand{\StandardLayout}{%
- \renewcommand{\FrenchLayout}{%
- \PackageWarning{frenchb.ldf}%
- {\protect\FrenchLayout\space makes no change\MessageBreak
- (\protect\StandardLayout\space has been selected before
- \MessageBreak for the whole document)}%
- }%
- \let\@ltiORI\labelitemi
- \let\@ltiiORI\labelitemii
- \let\@ltiiiORI\labelitemiii
- \let\@ltivORI\labelitemiv
- \let\itemizeORI\itemize
- \let\bbl@frenchitemize\relax
- \let\bbl@frenchlistspacing\relax
- \let\bbl@frenchindent\relax}
- \@onlypreamble\FrenchLayout
- \@onlypreamble\StandardLayout
-\fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
+% \subsection{Setup options: keyval stuff}
+% \label{sec-keyval}
%
-% \subsection{Extra utilities}
+% \changes{frenchb-2.0}{2006/11/06}{New command \cs{frenchbsetup}
+% added for global customisation.}
%
-% All that is left to do now is to provide the French user
-% with some extra utilities.
+% \changes{frenchb-2.0c}{2007/06/25}{Option ThinSpaceInFrenchNumbers
+% added.}
%
-% \begin{macro}{\up}
-% \begin{macro}{\ieme}
-% |\up| eases the typesetting of superscripts like
-% `1\raise0.55ex\hbox{\small er}'. |\up| relies on
-% |\textsuperscript| when available (i.\,e., in \LaTeXe).
+% \changes{frenchb-2.0d}{2007/07/15}{Options og and fg changed: limit
+% the definition to French so that quote characters can be used
+% in German.}
%
-% \changes{frenchb-1.1}{1996/01/20}{Use \cs{textsuperscript} in \LaTeXe,
-% as suggested by Vincent Jalby.}
+% \changes{frenchb-2.0e}{2007/10/05}{New option: StandardLists.}
%
-% \changes{frenchb-1.1}{1996/01/26}{Internal macro \cs{up@size}
-% introduced by Johannes Braams to replace \cs{small},
-% too fragile in 2.09).}
+% \begin{macro}{\frenchbsetup}
+% From version 2.0 on, all setup options are handled by \emph{one}
+% command |\frenchbsetup| using the keyval syntax.
%
-% \changes{frenchb-1.1}{1996/05/03}{\cs{@ptsize} may not be undefined,
-% i.\,e. in slides.cls.}
+% We first define a collection of conditionals with their defaults
+% (true or false).
%
-% \begin{macro}{\up@size}
-% The internal macro |\up@size| holds the size at which the
-% superscript will be typeset. The reason for this is that we have
-% to specify it differently for different formats.
-% \begin{macrocode}
-\ifx\sevenrm\@undefined
- \ifx\@ptsize\@undefined
- \let\up@size\small
- \else
- \ifx\selectfont\@undefined
-% \end{macrocode}
-% In this case the format is the original \LaTeX-2.09:
-% \begin{macrocode}
- \ifcase\@ptsize
- \let\up@size\ixpt\or
- \let\up@size\xpt\or
- \let\up@size\xipt
- \fi
-% \end{macrocode}
-% When |\selectfont| is defined we probably have NFSS available:
-% \begin{macrocode}
- \else
- \ifcase\@ptsize
- \def\up@size{\fontsize\@ixpt{10pt}\selectfont}\or
- \def\up@size{\fontsize\@xpt{11pt}\selectfont}\or
- \def\up@size{\fontsize\@xipt{12pt}\selectfont}
- \fi
- \fi
- \fi
-\else
-% \end{macrocode}
-% If we end up here it must be a plain based \TeX{} format, so:
% \begin{macrocode}
- \let\up@size\sevenrm
-\fi
-% \end{macrocode}
-% \end{macro}
-% Now we can define |\up|. When \LaTeXe{} runs in
-% compatibility mode (\LaTeX-2.09 emulation), |\textsuperscript| is
-% also defined, but does no good job, so we give two different
-% definitions for |\up| using |\if@Two@E|.
-% \begin{macrocode}
-\if@Two@E
- \DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}
-\else
- \DeclareRobustCommand*{\up}[1]{\leavevmode\raise1ex\hbox{\up@size#1}}
-\fi
+\newif\ifFBStandardLayout \FBStandardLayoutfalse
+\newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchfalse
+\newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue
+\newif\ifFBThinColonSpace \FBThinColonSpacefalse
+\newif\ifFBReduceListSpacing \FBReduceListSpacingtrue
+\newif\ifFBCompactItemize \FBCompactItemizetrue
+\newif\ifFBStandardItemLabels \FBStandardItemLabelsfalse
+\newif\ifFBStandardLists \FBStandardListsfalse
+\newif\ifFBIndentFirst \FBIndentFirsttrue
+\newif\ifFBFrenchFootnotes \FBFrenchFootnotestrue
+\newif\ifFBAutoSpaceFootnotes \FBAutoSpaceFootnotestrue
+\newif\ifFBThinSpaceInFrenchNumbers \FBThinSpaceInFrenchNumbersfalse
+\newif\ifFBPartNameFull \FBPartNameFulltrue
+\newif\ifFBShowOptions \FBShowOptionsfalse
% \end{macrocode}
%
-% \changes{frenchb-1.1}{1996/05/31}{Added 5 macros from french.sty and
-% missing \cs{lowercase}.}
-%
-% \changes{frenchb-1.2b}{1997/04/24}{Use \cs{xspace} to control spacing
-% after \cs{ieme} ... \cs{ieres}.}
-%
-% |\ieme| is provided for compatibility with |francais.sty|,
-% the other 5 for compatibility with |french.sty|:
+% Let's now define the main configuration command |\frenchbsetup|
+% which reads and sets the options which will be processed later
+% (at |\begin{document}|). It can only be called in the preamble.
% \begin{macrocode}
-\def\ieme{\up{\lowercase{e}}\xspace}
-\def\iemes{\up{\lowercase{es}}\xspace}
-\def\ier{\up{\lowercase{er}}\xspace}
-\def\iers{\up{\lowercase{ers}}\xspace}
-\def\iere{\up{\lowercase{re}}\xspace}
-\def\ieres{\up{\lowercase{res}}\xspace}
+\newcommand*{\frenchbsetup}[1]{%
+ \setkeys{FB}{#1}%
+}%
+\@onlypreamble\frenchbsetup
% \end{macrocode}
% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\No}
-% \begin{macro}{\no}
-% \begin{macro}{\primo}
-% \begin{macro}{\fprimo)}
-% And some more macros for numbering, first two support macros.
-%
-% \changes{frenchb-1.1}{1996/01/25}{Avoid using math superscripts
-% in text mode (suggested by V.~Jalby), use \cs{up} instead.
-% The symbol `degree' has nothing to do in
-% \cs{FrenchPopularEnumerate}, replace it by a small `o'.}
%
+% frenchb being an option of babel, it cannot load a package (keyval)
+% while frenchb.ldf is read, so we defer the loading of \file{keyval}
+% and the options setup at the end of \babel's loading.
+%
+% |StandardLayout| resets the layout in French to the standard layout
+% defined par the \LaTeX{} class and packages loaded. It deals with
+% lists, indentation of first paragraphs of sections and footnotes.
+% Other keys, entered \emph{after} |StandardLayout| in
+% |\frenchbsetup|, can overrule some of the |StandardLayout|
+% settings.
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \RequirePackage{keyval}%
+ \define@key{FB}{StandardLayout}[true]%
+ {\csname FBStandardLayout#1\endcsname
+ \ifFBStandardLayout
+ \FBStandardListstrue
+ \FBIndentFirstfalse
+ \FBFrenchFootnotesfalse
+ \FBAutoSpaceFootnotesfalse
+ \fi}%
+ \define@key{FB}{GlobalLayoutFrench}[true]%
+ {\csname FBGlobalLayoutFrench#1\endcsname}%
+ \define@key{FB}{AutoSpacePunctuation}[true]%
+ {\csname FBAutoSpacePunctuation#1\endcsname}%
+ \define@key{FB}{ThinColonSpace}[true]%
+ {\csname FBThinColonSpace#1\endcsname}%
+ \define@key{FB}{ReduceListSpacing}[true]%
+ {\csname FBReduceListSpacing#1\endcsname}%
+ \define@key{FB}{CompactItemize}[true]%
+ {\csname FBCompactItemize#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}[false]%
+ {\csname FBStandardLayout#1\endcsname
+ \ifFBStandardLists
+ \FBReduceListSpacingfalse
+ \FBCompactItemizefalse
+ \FBStandardItemLabelstrue
+ \fi}%
+ \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}{ThinSpaceInFrenchNumbers}[true]%
+ {\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
+ \define@key{FB}{PartNameFull}[true]%
+ {\csname FBPartNameFull#1\endcsname}%
+ \define@key{FB}{ShowOptions}[true]%
+ {\csname FBShowOptions#1\endcsname}%
+% \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|.
+% The purpose of the following code is to map the French quote
+% characters to |\og\ignorespaces| and |{\fg}| respectively when
+% the current language is French, and to |\guillemotleft| and
+% |\guillemotright| otherwise (think of German quotes); thus correct
+% unbreakable 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). We first check whether XeTeX is used
+% or not, if not the package |inputenc| has to be loaded before the
+% |\begin{document}| with the proper coding option, so we check if
+% |\DeclareInputText| is defined.
+% \begin{macrocode}
+ \define@key{FB}{og}{%
+ \newcommand*{\FB@@og}{\iflanguage{french}%
+ {\FB@og\ignorespaces}{\guillemotleft}}%
+ \expandafter\ifx\csname XeTeXrevision\endcsname\relax
+ \AtBeginDocument{%
+ \@ifundefined{DeclareInputText}%
+ {\PackageWarning{frenchb.ldf}%
+ {Option `og' requires package inputenc.\MessageBreak}%
+ }%
+ {\@ifundefined{uc@dclc}%
+% \end{macrocode}
+% if |\uc@dclc| is undefined, utf8x is not loaded\dots
+% \begin{macrocode}
+ {\@ifundefined{DeclareUnicodeCharacter}%
+% \end{macrocode}
+% if |\DeclareUnicodeCharacter| is undefined, utf8 is not loaded
+% either, we assume 8-bit character input encoding.
+% Package MULEenc.sty (from CJK) defines |\mule@def| to map
+% characters to control sequences.
+% \begin{macrocode}
+ {\@tempcnta`#1\relax
+ \@ifundefined{mule@def}%
+ {\DeclareInputText{\the\@tempcnta}{\FB@@og}}%
+ {\mule@def{11}{{\FB@@og}}}%
+ }%
+% \end{macrocode}
+% utf8 loaded, use |\DeclareUnicodeCharacter|,
+% \begin{macrocode}
+ {\DeclareUnicodeCharacter{00AB}{\FB@@og}}%
+ }%
+% \end{macrocode}
+% utf8x loaded, use |\uc@dclc|,
+% \begin{macrocode}
+ {\uc@dclc{171}{default}{\FB@@og}}%
+ }%
+ }%
+% \end{macrocode}
+% XeTeX in use, the following trick for defining the active quote
+% character is borrowed from \file{inputenc.dtx}.
% \begin{macrocode}
-\DeclareRobustCommand*{\FrenchEnumerate}[1]{%
- #1\up{\lowercase{o}}\kern+.3em}
-\DeclareRobustCommand*{\FrenchPopularEnumerate}[1]{%
- #1\up{\lowercase{o}})\kern+.3em}
+ \else
+ \catcode`#1=\active
+ \bgroup
+ \uccode`\~`#1%
+ \uppercase{%
+ \egroup
+ \def~%
+ }{\FB@@og}%
+ \fi
+ }%
% \end{macrocode}
-%
-% \changes{frenchb-1.3c}{1997/10/08}{Typos corrected: quatro, fquatro}
-%
-% Typing |\primo| should result in `$1^{\rm o}$\kern+.3em',
-% \begin{macrocode}
-\def\primo{\FrenchEnumerate1}
-\def\secundo{\FrenchEnumerate2}
-\def\tertio{\FrenchEnumerate3}
-\def\quarto{\FrenchEnumerate4}
+% Same code for the closing quote.
+% \begin{macrocode}
+ \define@key{FB}{fg}{%
+ \newcommand*{\FB@@fg}{\iflanguage{french}%
+ {\FB@fg}{\guillemotright}}%
+ \expandafter\ifx\csname XeTeXrevision\endcsname\relax
+ \AtBeginDocument{%
+ \@ifundefined{DeclareInputText}%
+ {\PackageWarning{frenchb.ldf}%
+ {Option `fg' requires package inputenc.\MessageBreak}%
+ }%
+ {\@ifundefined{uc@dclc}%
+ {\@ifundefined{DeclareUnicodeCharacter}%
+ {\@tempcnta`#1\relax
+ \@ifundefined{mule@def}%
+ {\DeclareInputText{\the\@tempcnta}{{\FB@@fg}}}%
+ {\mule@def{27}{{\FB@@fg}}}%
+ }%
+ {\DeclareUnicodeCharacter{00BB}{{\FB@@fg}}}%
+ }%
+ {\uc@dclc{187}{default}{{\FB@@fg}}}%
+ }%
+ }%
+ \else
+ \catcode`#1=\active
+ \bgroup
+ \uccode`\~`#1%
+ \uppercase{%
+ \egroup
+ \def~%
+ }{{\FB@@fg}}%
+ \fi
+ }%
+}
% \end{macrocode}
-% while typing |\fprimo)| gives `1$^{\rm o}$)\kern+.3em.
+%
+% |\FBprocess@options| processes the options, it is called \emph{once}
+% at |\begin{document}|.
% \begin{macrocode}
-\def\fprimo){\FrenchPopularEnumerate1}
-\def\fsecundo){\FrenchPopularEnumerate2}
-\def\ftertio){\FrenchPopularEnumerate3}
-\def\fquarto){\FrenchPopularEnumerate4}
+\newcommand*{\FBprocess@options}{%
% \end{macrocode}
+% Nothing has to be done here for |StandardLayout| (the involved
+% flags have already been set in |\frenchbsetup{}|).
%
-% Let's provide two macros for the common abbreviations
-% of ``Num\'ero''.
+% |AutoSpacePunctuation| adds an unbreakable space (in French only)
+% before the four active characters (:;!?) even if none has been
+% typed before them.
% \begin{macrocode}
-\DeclareRobustCommand*{\No}{N\up{\lowercase{o}}\kern+.2em}
-\DeclareRobustCommand*{\no}{n\up{\lowercase{o}}\kern+.2em}
+ \ifFBAutoSpacePunctuation
+ \AutoSpaceBeforeFDP
+ \else
+ \NoAutoSpaceBeforeFDP
+ \fi
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \changes{frenchb-1.1}{1996/01/29}{Added command \cs{bsc}.}
%
-% \changes{frenchb-1.1}{1996/05/31}{Added \cs{leavevmode} in \cs{bsc}}
-%
-% \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; this is a simpler implementation of
-% commands |\fsc| and |\lsc| from |french.sty| : no automatic
-% uppercase/lowercase conversion is performed.
-% Usage: |Jean~\bsc{Duchemin}|.
+% |ThinColonSpace| changes the normal unbreakable space typeset in
+% French before `:' to a thin space.
% \begin{macrocode}
-\DeclareRobustCommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}
+ \ifFBThinColonSpace\renewcommand*{\Fcolonspace}{\thinspace}\fi
% \end{macrocode}
-% \end{macro}
-%
-% \changes{frenchb-1.1}{1996/05/31}{Added \cs{AllTeX}.}
-%
-% \changes{frenchb-1.2}{1997/01/08}{Removed \cs{AllTeX}.}
-%
-% \changes{frenchb-1.1}{1996/02/12}{Added T1-encodings for \oe, \OE,
-% \ae, \AE. \emph{Do not} re-define these symbols outside \LaTeXe.}
-%
-% \changes{frenchb-1.1}{1996/02/14}{Corrected definitions of
-% \cs{boi}.}
-%
-% \changes{frenchb-1.3}{1997/05/24}{Use \cs{textbackslash} to define
-% \cs{boi}.}
-%
-% Some definitions for special characters. The first eight are
-% mandatory for |\oe| etc. to work properly in moving arguments,
-% the others just for convenience. 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|.
-%
-% \changes{frenchb-1.3}{1997/05/24}{Use \cs{r{}} to access the
-% character `degree', as suggested by V. Jalby.}
-%
-% |\degre| needs a special treatment: it is |\char6|
-% in T1-encoding and |\char23| in OT1-encoding, both can be
-% accessed by the command |\r{}| for ring accent.
-%
-% \changes{frenchb-1.1}{1996/03/03}{Do not use commands related to
-% encodings outside \LaTeXe.}
-%
-% \changes{frenchb-1.4}{1999/10/03}{Add definitions for \cs{at},
-% \cs{circonflexe} and \cs{tild} in other encodings (mlTeX's LO1).}
+% The next three options deal with the layout of lists in French.
%
+% |ReduceListSpacing| reduces the vertical spaces between list
+% items in French (done by changing |\list| to |\listFB|).
+% When |GlobalLayoutFrench| is true the same is done outside French.
% \begin{macrocode}
-\ifLaTeXe
- \DeclareTextSymbol{\ae}{T1}{230}
- \DeclareTextSymbol{\ae}{OT1}{26}
- \DeclareTextSymbol{\oe}{T1}{247}
- \DeclareTextSymbol{\oe}{OT1}{27}
- \DeclareTextSymbol{\AE}{T1}{198}
- \DeclareTextSymbol{\AE}{OT1}{29}
- \DeclareTextSymbol{\OE}{T1}{215}
- \DeclareTextSymbol{\OE}{OT1}{30}
- \DeclareTextSymbol{\at}{T1}{64}
- \DeclareTextSymbol{\at}{OT1}{64}
- \DeclareTextSymbol{\circonflexe}{T1}{94}
- \DeclareTextSymbol{\circonflexe}{OT1}{94}
- \DeclareTextSymbol{\tild}{T1}{126}
- \DeclareTextSymbol{\tild}{OT1}{126}
- \DeclareTextSymbolDefault{\at}{OT1}
- \DeclareTextSymbolDefault{\circonflexe}{OT1}
- \DeclareTextSymbolDefault{\tild}{OT1}
- \DeclareRobustCommand*{\boi}{\textbackslash}
- \DeclareRobustCommand*{\degre}{\r{}}
-\else
- \def\T@one{T1}
- \ifx\f@encoding\T@one
- \newcommand{\degre}{\char6}
+ \ifFBReduceListSpacing
+ \addto\extrasfrench{\let\list\listFB
+ \let\endlist\endlistFB}%
+ \addto\noextrasfrench{\ifFBGlobalLayoutFrench
+ \let\list\listFB
+ \let\endlist\endlistFB
+ \else
+ \let\list\listORI
+ \let\endlist\endlistORI
+ \fi}%
\else
- \newcommand{\degre}{\char23}
+ \addto\extrasfrench{\let\list\listORI
+ \let\endlist\endlistORI}%
+ \addto\noextrasfrench{\let\list\listORI
+ \let\endlist\endlistORI}%
\fi
- \newcommand{\at}{\char64}
- \newcommand{\circonflexe}{\char94}
- \newcommand{\tild}{\char126}
- \newcommand{\boi}{{$\backslash$}}
-\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|).
-%
-% If the \TeX{} Companion fonts are available (\file{textcomp.sty}),
-% we pick up |\textdegree| from them instead of using emulating
-% `degrees' from the |\r{}| accent. Otherwise we overwrite the
-% (poor) definition of |\textdegree| given in \file{latin1.def},
-% \file{applemac.def} etc. (called by \file{inputenc.sty}) by
-% our definition of |\degres|. We also advice the user (once only)
-% to use TS1-encoding.
-%
-% \changes{frenchb-1.1}{1996/01/25}{Fixed width bounding box for
-% correct spacing with both CM, EC and PostScript fonts}
-%
-% \changes{frenchb-1.1}{1996/05/31}{Added \cs{leavevmode} in the
-% \cs{degres}'s definition}
-%
-% \changes{frenchb-1.6a}{2003/02/02}{Replace \cs{degres} by
-% \cs{textdegree} from textcomp.sty when possible (suggested
-% by Michel Bovani).}
-%
-% \changes{frenchb-1.6g}{2005/02/06}{Add \cs{hbox} in the definition
-% of \cs{degres} when textcomp.sty is loaded, so that \cs{degres}
-% can be used in math mode.}
+% |CompactItemize| suppresses the vertical spacing between list
+% items in French (done by changing |\itemize| to |\itemizeFB|).
+% When |GlobalLayoutFrench| is true the same is done outside French.
+% \begin{macrocode}
+ \ifFBCompactItemize
+ \addto\extrasfrench{\let\itemize\itemizeFB
+ \let\enditemize\enditemizeFB}%
+ \addto\noextrasfrench{\ifFBGlobalLayoutFrench
+ \let\itemize\itemizeFB
+ \let\enditemize\enditemizeFB
+ \else
+ \let\itemize\itemizeORI
+ \let\enditemize\enditemizeORI
+ \fi}%
+ \else
+ \addto\extrasfrench{\let\itemize\itemizeORI
+ \let\enditemize\enditemizeORI}%
+ \addto\noextrasfrench{\let\itemize\itemizeORI
+ \let\enditemize\enditemizeORI}%
+ \fi
+% \end{macrocode}
%
+% |StandardItemLabels| resets labelitems in French to their
+% standard values set by the \LaTeX{} class and packages loaded.
+% When |GlobalLayoutFrench| is true labelitems are identical inside
+% and outside French.
% \begin{macrocode}
-\ifLaTeXe
- \def\Warning@degree@TSone{%
- \PackageWarning{frenchb.ldf}{%
- Degrees would look better in TS1-encoding:
- \MessageBreak add \protect
- \usepackage{textcomp} to the preamble.
- \MessageBreak Degrees used}}
- \AtBeginDocument{\expandafter\ifx\csname M@TS1\endcsname\relax
- \DeclareRobustCommand*{\degres}{%
- \leavevmode\hbox to 0.3em{\hss\degre\hss}%
- \Warning@degree@TSone
- \global\let\Warning@degree@TSone\relax}%
- \let\textdegree\degres
- \else
- \DeclareRobustCommand*{\degres}{%
- \hbox{\UseTextSymbol{TS1}{\textdegree}}}%
- \fi}
-\else
- \DeclareRobustCommand*{\degres}{%
- \leavevmode\hbox to 0.3em{\hss\degre\hss}}
-\fi
+ \ifFBStandardItemLabels
+ \addto\extrasfrench{\bbl@nonfrenchlabelitems}%
+ \addto\noextrasfrench{\bbl@nonfrenchlabelitems}%
+ \else
+ \addto\extrasfrench{\bbl@frenchlabelitems}%
+ \addto\noextrasfrench{\ifFBGlobalLayoutFrench
+ \bbl@frenchlabelitems
+ \else
+ \bbl@nonfrenchlabelitems
+ \fi}%
+ \fi
% \end{macrocode}
-% \end{macro}
-%
-% \changes{frenchb-1.1}{1996/01/16}{Special care has to be taken
-% with Ml\TeX.}
-%
-% The following macros are used in the redefinition of |\^| and
-% |\"| to handle the letter~i: they allow users to type simply
-% |\^i| and |\"i| instead of |\^{\i}| and |\"{\i}|.\\
-% Ml\TeX{}'s macros dealing with accents conflict with those of
-% \LaTeXe{}, so we check whether |\csubinverse| is defined or not.
-% If |\csubinverse| is \emph{defined}, we are in Ml\TeX.
-%
-% \changes{frenchb-1.1}{1996/03/02}{Do this only in \LaTeXe.}
-%
-% \changes{frenchb-1.1}{1996/03/12}{Do not redefine \cs{\char94} and
-% \cs{"} in Ml\TeX, because it would break hyphenation. The correct
-% place to redefine \cs{\char94i} and \cs{"i} is in the format
-% itself, see MLTeX.cfg.}
%
+% |IndentFirst| forces the first paragraphs of sections to be
+% indented just like the other ones in French.
+% When |GlobalLayoutFrench| is true the same is done outside French.
% \begin{macrocode}
-\ifLaTeXe
- \AtBeginDocument{%
- \ifx\csubinverse\@undefined
- \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}%
- \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}%
- \fi}
-\fi
+ \ifFBIndentFirst
+ \addto\extrasfrench{\bbl@frenchindent}%
+ \addto\noextrasfrench{\ifFBGlobalLayoutFrench
+ \bbl@frenchindent
+ \else
+ \bbl@nonfrenchindent
+ \fi}%
+ \else
+ \addto\extrasfrench{\bbl@nonfrenchindent}%
+ \addto\noextrasfrench{\bbl@nonfrenchindent}%
+ \fi
% \end{macrocode}
%
-% \subsection{Date and clean up}
-%
-% \begin{macro}{\datefrench}
-% The macro |\datefrench| redefines the command |\today| to
-% produce French dates.
-%
-% \changes{frenchb-1.2}{1997/01/05}{Added aliases \cs{datefrenchb}
-% and \cs{datefrancais}. Use \cs{ier} instead of \cs{up}.}
-%
-% \changes{frenchb-1.3b}{1997/10/01}{Use \cs{edef} to define
-% \cs{today} to save memory}
-%
-% \changes{frenchb-1.3d}{1998/07/04}{Move this code to the end
-% of file, until \cs{ier} is defined (due to use of \cs{edef});
-% expansion of \cs{ier} has to be stopped anyway.}
-%
-% \changes{frenchb-1.3g}{1999/08/18}{Replaced \cs{edef} with \cs{def}
-% to prevent problems with unexpandable accent commands}
+% The layout of footnotes is handled at the |\begin{document}|
+% depending on the values of flags |FrenchFootnotes|
+% and |AutoSpaceFootnotes| (see section~\ref{sec-footnotes}),
+% nothing has to be done here for footnotes.
+%
+% When |true|, |ThinSpaceInFrenchNumbers| redefines |numprint.sty|'s
+% |\npstylefrench| command to set |\npthousandsep| to |\,|
+% (thinspace) instead of |~| (default) . This option has no effect
+% if package |numprint.sty| is not loaded with `|autolanguage|'.
+% As old versions of |numprint.sty| did not define |\npstylefrench|,
+% we have to provide this command.
+% \begin{macrocode}
+ \@ifpackageloaded{numprint}%
+ {\ifnprt@autolanguage
+ \providecommand*{\npstylefrench}{}%
+ \ifFBThinSpaceInFrenchNumbers
+ \renewcommand*\npstylefrench{%
+ \npthousandsep{\,}%
+ \npdecimalsign{,}%
+ \npproductsign{\cdot}%
+ \npunitseparator{\,}%
+ \npdegreeseparator{}%
+ \nppercentseparator{\nprt@unitsep}%
+ }%
+ \else
+ \renewcommand*\npstylefrench{%
+ \npthousandsep{~}%
+ \npdecimalsign{,}%
+ \npproductsign{\cdot}%
+ \npunitseparator{\,}%
+ \npdegreeseparator{}%
+ \nppercentseparator{\nprt@unitsep}%
+ }%
+ \fi
+ \npaddtolanguage{french}{french}%
+ \fi}{}%
+% \end{macrocode}
+%
+% |PartNameFull|: if |false|, redefine |\partname|.
+% \begin{macrocode}
+ \ifFBPartNameFull
+ \else\addto\captionsfrench{\def\partname{Partie}}\fi
+% \end{macrocode}
+%
+% |ShowOptions|: if |true|, print the list of all options to the
+% \file{.log} file.
+% \begin{macrocode}
+ \ifFBShowOptions
+ \GenericWarning{* }{%
+ * **** List of possible options for frenchb ****\MessageBreak
+ [Default values between brackets]\MessageBreak
+ ShowOptions=true [false]\MessageBreak
+ StandardLayout=true [false]\MessageBreak
+ GlobalLayoutFrench=true [false]\MessageBreak
+ AutoSpacePunctuation=false [true]\MessageBreak
+ ThinColonSpace=true [false]\MessageBreak
+ StandardLists=true [false]\MessageBreak
+ ReduceListSpacing=false [true]\MessageBreak
+ CompactItemize=false [true]\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
+ IndentFirst=false [true]\MessageBreak
+ FrenchFootnotes=false [true]\MessageBreak
+ AutoSpaceFootnotes=false [true]\MessageBreak
+ ThinSpaceInFrenchNumbers=true [false]\MessageBreak
+ PartNameFull=false [true]\MessageBreak
+ og= <left quote character>, fg= <right quote character>
+ \MessageBreak
+ *********************************************
+ \MessageBreak\protect\frenchbsetup{ShowOptions}}
+ \fi
+}
+% \end{macrocode}
+%
+% At |\begin{document}| we save again the definitions of the `list'
+% and `itemize' environments and the values of labelitems so that
+% all changes made in the preamble are taken into account in
+% languages other than French and in French with the StandardLayout
+% option. We also have to provide an |\xspace| command in case the
+% |xspace.sty| package is not loaded.
+%
+% \changes{frenchb-2.0}{2006/12/15}{AtBeginDocument, save again the
+% definitions of the `list' and `itemize' environments and the
+% values of labelitems. As of frenchb v.1.6, `ORI' values were
+% set when reading frenchb.ldf, later changes were ignored.}
+%
+% \changes{frenchb-2.0}{2006/12/06}{Added warning for OT1 encoding.}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\listORI\list
+ \let\endlistORI\endlist
+ \let\itemizeORI\itemize
+ \let\enditemizeORI\enditemize
+ \let\@ltiORI\labelitemi
+ \let\@ltiiORI\labelitemii
+ \let\@ltiiiORI\labelitemiii
+ \let\@ltivORI\labelitemiv
+ \providecommand*{\xspace}{\relax}%
+% \end{macrocode}
+% It is time to process the options set with |\frenchboptions{}|.
+% Then execute either |\extrasfrench| and |\captionsfrench| or
+% |\noextrasfrench| according to the current language at the
+% |\begin{document}| (these three commands are updated by
+% |\FBprocess@options|).
+% \begin{macrocode}
+ \FBprocess@options
+ \iflanguage{french}{\extrasfrench\captionsfrench}{\noextrasfrench}%
+% \end{macrocode}
+% Some warnings are issued when output font encodings are not
+% properly set. With XeLaTeX, \file{fontspec.sty} and
+% \file{xunicode.sty} should be loaded; with (pdf)\LaTeX, a warning
+% is issued when OT1 encoding is in use at the |\begin{document}|.
+% Mind that |\encodingdefault| is defined as `long', defining
+% |\FBOTone| with |\newcommand*| would fail!
+% \begin{macrocode}
+ \expandafter\ifx\csname XeTeXrevision\endcsname\relax
+ \begingroup \newcommand{\FBOTone}{OT1}%
+ \ifx\encodingdefault\FBOTone
+ \PackageWarning{frenchb.ldf}%
+ {OT1 encoding should not be used for French.
+ \MessageBreak
+ Add \protect\usepackage[T1]{fontenc} to the
+ preamble\MessageBreak of your document,}
+ \fi
+ \endgroup
+ \else
+ \@ifundefined{DeclareUTFcharacter}%
+ {\PackageWarning{frenchb.ldf}%
+ {Add \protect\usepackage{fontspec} *and*\MessageBreak
+ \protect\usepackage{xunicode} to the preamble\MessageBreak
+ of your document,}}%
+ {}%
+ \fi
+}
+% \end{macrocode}
%
-% \changes{frenchb-1.4d}{2000/02/01}{Changed \cs{noexpand}\cs{ier}
-% to \cs{ier}, as a result of the replacement of \cs{edef} by
-% \cs{def}, see previous change. Also add braces around \cs{ier}
-% for xspace.sty.}
+% \subsection{Clean up and exit}
%
+% Load |frenchb.cfg| (should do nothing, just for compatibility).
% \begin{macrocode}
-\@namedef{date\CurrentOption}{%
- \def\today{\number\day
- \ifnum1=\day {\ier}\fi
- \space \ifcase\month
- \or janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
- juillet\or ao\^ut\or septembre\or octobre\or novembre\or
- d\'ecembre\fi
- \space \number\year}}
+\loadlocalcfg{frenchb}
% \end{macrocode}
-% \end{macro}
-%
+% Final cleaning.
% The macro |\ldf@quit| 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.
% The config file searched for has to be `frenchb.cfg', and
% |\CurrentOption| has been set to `french', so
% |\ldf@finish\CurrentOption| cannot be used: we first load
-% `frenchb.cfg' (in LaTeX2e only), then call
-% |\ldf@quit\CurrentOption|.
-% The macro-space used by some control sequences we do not
-% need any longer, is freed.
-%
-% \changes{frenchb-1.1b}{1996/11/02}{Now use \cs{ldf@finish} to wrap
-% up.}
-%
-% \changes{frenchb-1.2}{1997/01/05}{The config file searched for is
-% `frenchb.cfg' regardless \cs{CurrentOption}.}
-%
-% \changes{frenchb-1.5d}{2001/02/16}{Load frenchb.cfg first and
-% change \cs{ldf@finish} to \cs{ldf@quit}.}
-%
-% \changes{frenchb-1.6g}{2005/02/06}{frenchb.cfg is now loaded only
-% with LaTeX2e, as the customization makes sense only in LaTeX2e.
-% Suggested by J.F. Burnol.}
-%
+% `frenchb.cfg', then call |\ldf@quit\CurrentOption|.
% \begin{macrocode}
-\ifLaTeXe
- \loadlocalcfg{frenchb}
-\fi
-\let\T@one\relax
-\let\@FI@\relax
-\let\ifLaTeX\@undefined
-\let\LaTeXtrue\@undefined
-\let\LaTeXfalse\@undefined
-\let\ifLaTeXe\@undefined
-\let\LaTeXetrue\@undefined
-\let\LaTeXefalse\@undefined
+\FBclean@on@exit
\ldf@quit\CurrentOption
-%</code>
% \end{macrocode}
-%
-% \Finale
+% \iffalse
+%</code>
+%<*dtx>
+% \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
@@ -2477,4 +2127,9 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
+% \iffalse
+%</dtx>
+% \fi
+%
+% \Finale
\endinput