diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-23 23:34:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-23 23:34:09 +0000 |
commit | 35c8a6c999c88800146abb0df96becdb3f0ddf9c (patch) | |
tree | fd1eb2fe75df7c776d201429829716b4a6bc6dc2 /Master/texmf-dist/tex/generic/babel-french | |
parent | 2a3f80d33949f85ee55f2d478e94d9a53b9e44a4 (diff) |
babel-french (22jun14)
git-svn-id: svn://tug.org/texlive/trunk@34367 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel-french')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.ldf | 264 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 28 |
2 files changed, 197 insertions, 95 deletions
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf index c5002a314d8..fffb081fd38 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.ldf @@ -33,7 +33,7 @@ %% extension .ins) which are part of the distribution. %% \ProvidesLanguage{frenchb} - [2014/04/18 v3.0c French support from the babel system] + [2014/06/21 v3.1a French support from the babel system] %% %% File `frenchb.ldf' %% Babel package for LaTeX version 2e @@ -202,11 +202,11 @@ \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname newluatexattribute\endcsname\relax \input luatexbase.sty - \newluatexattribute\FB@addDPspace \FB@addDPspace=1 \relax - \newluatexattribute\FB@addGUILspace \FB@addGUILspace=0 \relax - \fb@info{No need for active punctuation characters\\ - with this version of LuaTeX!} \fi + \newluatexattribute\FB@addDPspace \FB@addDPspace=1 \relax + \newluatexattribute\FB@addGUILspace \FB@addGUILspace=0 \relax + \fb@info{No need for active punctuation characters\\ + with this version of LuaTeX!} \fi \fi \ifFB@luatex@punct @@ -528,6 +528,90 @@ \def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright} \fi \FB@addto{extras}{\babel@save\og \babel@save\fg \bbl@frenchguillemets} +\newcommand*{\ogi}{\FB@og} +\newcommand*{\fgi}{\FB@fg} +\newcommand*{\ogii}{\textquotedblleft} +\newcommand*{\fgii}{\textquotedblright} +\newcount\FBguill@level +\newif\ifFBcloseguill \FBcloseguilltrue +\newif\ifFBInnerGuillSingle +\def\FBguillopen{\bgroup\NoAutoSpacing\guillemotleft\egroup} +\def\FBguillclose{\bgroup\NoAutoSpacing\guillemotright\egroup} +\let\FBguillnone\relax +\let\FBeveryparguill\FBguillopen +\ifFB@luatex@punct + \let\FBeverylineguill\FBguillopen + \ifLaTeXe + \let\local@leftbox\luatexlocalleftbox + \else + \let\local@leftbox\localleftbox + \fi +\else + \let\FBeverylineguill\FBguillnone +\fi +\ifLaTeXe + \DeclareRobustCommand\frquote{% + \@ifstar{\FBcloseguillfalse\fr@quote}% + {\FBcloseguilltrue\fr@quote}} +\else + \newcommand\frquote[1]{\fr@quote{#1}} +\fi +\newcommand{\fr@quote}[1]{% + \bgroup + \ifnum\FBguill@level=2 + \PackageWarning{frenchb.ldf}{% + \protect\frquote\space accepts no more than two levels + \MessageBreak of quotations. Reported} + \else + \advance\FBguill@level by \@ne + \fi + \ifnum\FBguill@level=1 + \ifx\FBeveryparguill\relax + \let\FBeverypar@quote\relax + \else + \def\FBeverypar@quote{\FBeveryparguill + \kern.8\fontdimen2\font}% + \fi + \expandafter\csname og\romannumeral\FBguill@level\endcsname + \everypar \expandafter{\the\everypar \FBeverypar@quote}% + #1% + \expandafter\csname fg\romannumeral\FBguill@level\endcsname + \else + \ifx\FBeverylineguill\FBguillopen + \local@leftbox{\guillemotleft\kern.8\fontdimen2\font}% + \let\FBeverypar@quote\relax + \FB@og #1\ifFBcloseguill\FB@fg\fi + \else + \ifx\FBeverylineguill\FBguillclose + \local@leftbox{\guillemotright\kern.8\fontdimen2\font}% + \let\FBeverypar@quote\relax + \FB@og #1\ifFBcloseguill\FB@fg\fi + \else + \let\FBeverypar@quote\relax + \ifFBInnerGuillSingle + \def\ogii{\leavevmode + \guilsinglleft\FBguillspace}% + \def\fgii{\ifdim\lastskip>\z@\unskip\fi + \FBguillspace\guilsinglright}% + \ifx\FBeveryparguill\FBguillopen + \def\FBeverypar@quote{\guilsinglleft + \kern.8\fontdimen2\font}% + \fi + \ifx\FBeveryparguill\FBguillclose + \def\FBeverypar@quote{\guilsinglright + \kern.8\fontdimen2\font}% + \fi + \fi + \expandafter\csname og\romannumeral\FBguill@level\endcsname + #1% + \ifFBcloseguill\expandafter + \csname fg\romannumeral\FBguill@level\endcsname + \fi + \fi + \fi + \fi + \egroup +} \ifLaTeXe \def\BabelLanguages{french,acadian} \StartBabelCommands*{\BabelLanguages}{date} @@ -876,6 +960,7 @@ \setkeys{FB}{#1}% }% \@onlypreamble\frenchbsetup +\newif\ifFBShowOptions \FBShowOptionsfalse \newif\ifFBStandardLayout \FBStandardLayouttrue \newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue \newif\ifFBReduceListSpacing \FBReduceListSpacingfalse @@ -890,7 +975,6 @@ \newif\ifFBAutoSpaceFootnotes \FBAutoSpaceFootnotesfalse \newif\ifFBOriginalTypewriter \FBOriginalTypewriterfalse \newif\ifFBThinColonSpace \FBThinColonSpacefalse -\newif\ifFBINGuillSpace \FBINGuillSpacefalse \newif\ifFBThinSpaceInFrenchNumbers \FBThinSpaceInFrenchNumbersfalse \newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue \newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue @@ -898,7 +982,7 @@ \newif\ifFBCustomiseFigTabCaptions \FBCustomiseFigTabCaptionsfalse \newif\ifFBOldFigTabCaptions \FBOldFigTabCaptionsfalse \newif\ifFBSuppressWarning \FBSuppressWarningfalse -\newif\ifFBShowOptions \FBShowOptionsfalse +\newif\ifFBINGuillSpace \FBINGuillSpacefalse \edef\FB@french{\CurrentOption} \AtEndOfPackage{% \ifx\bbl@main@language\FB@french @@ -919,6 +1003,8 @@ \FBGlobalLayoutFrenchfalse \fi \RequirePackage{keyval}% + \define@key{FB}{ShowOptions}[true]% + {\csname FBShowOptions#1\endcsname}% \define@key{FB}{StandardLayout}[true]% {\csname FBStandardLayout#1\endcsname \ifFBStandardLayout @@ -1010,21 +1096,19 @@ {\csname FBOriginalTypewriter#1\endcsname}% \define@key{FB}{ThinColonSpace}[true]% {\csname FBThinColonSpace#1\endcsname}% - \define@key{FB}{INGuillSpace}[true]% - {\csname FBINGuillSpace#1\endcsname}% \define@key{FB}{ThinSpaceInFrenchNumbers}[true]% - {\csname FBThinSpaceInFrenchNumbers#1\endcsname}% + {\csname FBThinSpaceInFrenchNumbers#1\endcsname}% \define@key{FB}{FrenchSuperscripts}[true]% - {\csname FBFrenchSuperscripts#1\endcsname} + {\csname FBFrenchSuperscripts#1\endcsname} \define@key{FB}{LowercaseSuperscripts}[true]% - {\csname FBLowercaseSuperscripts#1\endcsname} + {\csname FBLowercaseSuperscripts#1\endcsname} \define@key{FB}{PartNameFull}[true]% - {\csname FBPartNameFull#1\endcsname - \ifFBPartNameFull - \else - \FB@addto{captions}{% - \def\partname{Partie\protect\FB@Rpart}}% - \fi}% + {\csname FBPartNameFull#1\endcsname + \ifFBPartNameFull + \else + \FB@addto{captions}{% + \def\partname{Partie\protect\FB@Rpart}}% + \fi}% \define@key{FB}{CustomiseFigTabCaptions}[true]% {\csname FBCustomiseFigTabCaptions#1\endcsname}% \define@key{FB}{OldFigTabCaptions}[true]% @@ -1038,87 +1122,81 @@ \ifFBSuppressWarning \renewcommand{\FBWarning}[2]{\relax}% \fi}% - \define@key{FB}{ShowOptions}[true]% - {\csname FBShowOptions#1\endcsname}% + \define@key{FB}{INGuillSpace}[true]% + {\csname FBINGuillSpace#1\endcsname}% + \define@key{FB}{InnerGuillSingle}[true]% + {\csname FBInnerGuillSingle#1\endcsname}% + \define@key{FB}{EveryParGuill}{\expandafter\let\expandafter + \FBeveryparguill\csname FBguill#1\endcsname}% + \define@key{FB}{EveryLineGuill}{\expandafter\let\expandafter + \FBeverylineguill\csname FBguill#1\endcsname + \ifFB@luatex@punct + \else + \let\FBeverylineguill\FBguillnone + \PackageWarning{frenchb.ldf}% + {Option `EveryLineGuill' skipped:% + \MessageBreak this option is for + LuaTeX *only*.\MessageBreak Reported}% + \fi}% \define@key{FB}{og}{% - \ifFB@active@punct - \newcommand*{\FB@@og}{% + \ifFBunicode + \ifFB@luatex@punct + \FB@addGUILspace=1 \relax + \fi + \ifFB@xetex@punct + \XeTeXcharclass"13 = \FB@guilo + \XeTeXcharclass"AB = \FB@guilo + \XeTeXcharclass"A0 = \FB@guilnul + \XeTeXcharclass"202F = \FB@guilnul + \fi + \else + \newcommand*{\FB@@og}{% \iflanguage{french}% {\ifFBAutoSpaceGuill\FB@og\ignorespaces \else\guillemotleft \fi}% {\guillemotleft}}% - \fi - \ifFBunicode - \ifFB@luatex@punct - \FB@addGUILspace=1 \relax - \else - \ifFB@xetex@punct - \XeTeXcharclass"AB = \FB@guilo - \XeTeXcharclass"A0 = \FB@guilnul - \XeTeXcharclass"202F = \FB@guilnul + \AtBeginDocument{% + \ifdefined\DeclareInputText + \ifdefined\uc@dclc + \uc@dclc{171}{default}{\FB@@og}% + \else + \ifdefined\DeclareUnicodeCharacter + \DeclareUnicodeCharacter{00AB}{\FB@@og}% + \else + \@tempcnta`#1\relax + \ifdefined\mule@def + \mule@def{11}{\FB@@og}% + \else + \DeclareInputText{\the\@tempcnta}{\FB@@og}% + \fi + \fi + \fi \else - \catcode`#1=\active - \bgroup - \uccode`\~`#1% - \uppercase{% - \egroup - \def~% - }{\FB@@og}% + \PackageWarning{frenchb.ldf}% + {Option `og' requires package inputenc.\MessageBreak}% \fi - \fi - \else - \AtBeginDocument{% - \ifdefined\DeclareInputText - \ifdefined\uc@dclc - \uc@dclc{171}{default}{\FB@@og}% - \else - \ifdefined\DeclareUnicodeCharacter - \DeclareUnicodeCharacter{00AB}{\FB@@og}% - \else - \@tempcnta`#1\relax - \ifdefined\mule@def - \mule@def{11}{\FB@@og}% - \else - \DeclareInputText{\the\@tempcnta}{\FB@@og}% - \fi - \fi - \fi - \else - \PackageWarning{frenchb.ldf}% - {Option `og' requires package inputenc.\MessageBreak}% - \fi - }% - \fi + }% + \fi }% \define@key{FB}{fg}{% - \ifFB@active@punct - \newcommand*{\FB@@fg}{% + \ifFBunicode + \ifFB@luatex@punct + \FB@addGUILspace=1 \relax + \fi + \ifFB@xetex@punct + \XeTeXcharclass"14 = \FB@guilf + \XeTeXcharclass"BB = \FB@guilf + \XeTeXcharclass"A0 = \FB@guilnul + \XeTeXcharclass"202F = \FB@guilnul + \fi + \else + \newcommand*{\FB@@fg}{% \iflanguage{french}% {\ifFBAutoSpaceGuill\FB@fg \else\guillemotright \fi}% {\guillemotright}}% - \fi - \ifFBunicode - \ifFB@luatex@punct - \FB@addGUILspace=1 \relax - \else - \ifFB@xetex@punct - \XeTeXcharclass"BB = \FB@guilf - \XeTeXcharclass"A0 = \FB@guilnul - \XeTeXcharclass"202F = \FB@guilnul - \else - \catcode`#1=\active - \bgroup - \uccode`\~`#1% - \uppercase{% - \egroup - \def~% - }{{\FB@@fg}}% - \fi - \fi - \else \AtBeginDocument{% \ifdefined\DeclareInputText \ifdefined\uc@dclc @@ -1137,10 +1215,10 @@ \fi \else \PackageWarning{frenchb.ldf}% - {Option `fg' requires package inputenc.\MessageBreak}% + {Option `fg' requires package inputenc.\MessageBreak}% \fi }% - \fi + \fi }% } \newcommand*{\FBprocess@options}{% @@ -1291,7 +1369,6 @@ AutoSpacePunctuation=false [true]\MessageBreak OriginalTypewriter=true [false]\MessageBreak ThinColonSpace=true [false]\MessageBreak - INGuillSpace=true [false]\MessageBreak ThinSpaceInFrenchNumbers=true [false]\MessageBreak FrenchSuperscripts=false [true]\MessageBreak LowercaseSuperscripts=false [true]\MessageBreak @@ -1299,6 +1376,11 @@ SuppressWarning=true [false]\MessageBreak CustomiseFigTabCaptions=false [true]\MessageBreak OldFigTabCaptions=true [false]\MessageBreak + INGuillSpace=true [false]\MessageBreak + InnerGuillSingle=true [false]\MessageBreak + EveryParGuill=open, close, none [open]\MessageBreak + EveryLineGuill=open, close, none + [open in LuaTeX, none otherwise]\MessageBreak og= <left quote character>, fg= <right quote character>% \MessageBreak *********************************************% @@ -1340,9 +1422,11 @@ \ifFBunicode \ifdefined\DeclareUTFcharacter \else - \PackageWarning{frenchb.ldf}% - {Add \protect\usepackage{fontspec} to the\MessageBreak - preamble of your document,}% + \@ifpackageloaded{luainputenc}{}% + {\PackageWarning{frenchb.ldf}% + {Add \protect\usepackage{fontspec} to the\MessageBreak + preamble of your document,}% + }% \fi \else \begingroup \newcommand{\FBOTone}{OT1}% diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index 253cbdfaac7..63c5cad1d94 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua @@ -1,5 +1,5 @@ -- --- File `frenchb.lua' generated from frenchb.dtx [2014/04/18 v3.0c] +-- File `frenchb.lua' generated from frenchb.dtx [2014/06/21 v3.1a] -- -- Copyright (C) 2014 Daniel Flipo <daniel.flipo at free.fr> -- License LPPL: see frenchb.dtx. @@ -15,9 +15,11 @@ local FB_punct_left = [string.byte("?")] = true, [string.byte(";")] = true, [string.byte(":")] = true, + [0x14] = true, [0xBB] = true} local FB_punct_right = - {[0xAB] = true} + {[0x13] = true, + [0xAB] = true} local FB_punct_null = {[string.byte("!")] = true, [string.byte("?")] = true, @@ -31,6 +33,7 @@ local FB_guil_null = local new_node = node.new local copy_node = node.copy local node_id = node.id +local KERN = node_id("kern") local GLUE = node_id("glue") local GSPEC = node_id("glue_spec") local GLYPH = node_id("glyph") @@ -114,7 +117,9 @@ local function french_punctuation (head) insert_node_before(head, item, copy_node(fbglue)) end elseif SIG and SIG > 0 then - if glue or (prev_char and not FB_guil_null[prev_char]) then + local addgl = (prev_char and not FB_guil_null[prev_char]) or + (not prev_char) + if glue or addgl then if glue then head = remove_node(head,prev,true) end @@ -126,12 +131,23 @@ local function french_punctuation (head) end if lang == FR and FB_punct_right[char] and SIG and SIG > 0 then local next = item.next - local next_id, next_subtype, next_char + local next_id, next_subtype, next_char, kern_wd, nextnext if next then next_id = next.id next_subtype = next.subtype if next_id == GLYPH then next_char = next.char + elseif next_id == KERN then + kern_wd = next.kern + if kern_wd == 0 then + nextnext = next.next + if nextnext then + next = nextnext + next_id = nextnext.id + next_subtype = nextnext.subtype + next_char = nextnext.char + end + end end end local glue = next_id == GLUE and next_subtype == 0 @@ -140,7 +156,9 @@ local function french_punctuation (head) glue_wd = glue_spec.width end glue = glue and glue_wd > 0 - if glue or (next_char and not FB_guil_null[next_char]) then + local addgl = (next_char and not FB_guil_null[next_char]) or + (not next_char) + if glue or addgl then if glue then head = remove_node(head,next,true) end |