diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-26 21:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-26 21:11:59 +0000 |
commit | 95375b444b5671e7a939635fdf5d1a0e4ef16813 (patch) | |
tree | bf55f9f27c66c7300e8efbc6cc3e8f1d1ab12602 /Master/texmf-dist/source/generic | |
parent | a6eb3e7dd5d57b2333c11e6a82dfc36828cfe711 (diff) |
babel-french (26oct14)
git-svn-id: svn://tug.org/texlive/trunk@35444 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic')
-rw-r--r-- | Master/texmf-dist/source/generic/babel-french/frenchb.dtx | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx index 9b640647b54..0821c0870ae 100644 --- a/Master/texmf-dist/source/generic/babel-french/frenchb.dtx +++ b/Master/texmf-dist/source/generic/babel-french/frenchb.dtx @@ -13,14 +13,14 @@ %<ldf>\ProvidesLanguage{frenchb} %\ProvidesFile{frenchb.dtx} %<*!lua> - [2014/09/16 v3.1b French support from the babel system] + [2014/10/25 v3.1c French support from the babel system] %</!lua> %<*internal> \iffalse %</internal> %<*lua> -- --- File `frenchb.lua' generated from frenchb.dtx [2014/09/16 v3.1b] +-- File `frenchb.lua' generated from frenchb.dtx [2014/10/25 v3.1c] -- -- Copyright (C) 2014 Daniel Flipo <daniel.flipo at free.fr> -- License LPPL: see frenchb.dtx. @@ -1388,13 +1388,18 @@ local function french_punctuation (head) end % \end{macrocode} % -% \changes{v3.0c}{2014/04/18}{Bug correction: null glues should not +% \changes{v3.0c}{2014/04/18}{frenchb.lua: null glues should not % trigger space insertion before high ponctuation. Bug pointed out % by Benoit Rivet for the `lstlisting' environment of the listings % package.} % -% If the previous item is a glue, check its natural width, -% only positive glues are to be replaced by a nobreakspace. +% \changes{v3.1c}{2014/10/25}{frenchb.lua: Previous bug fix for null +% glues (v3.0c) did not work properly. Fixed now (I hope!). +% Pointed out by Jacques André.} +% +% If the previous item is a glue, check its natural width, only +% positive glues (actually glues > 1 sp, for tabular ``l'' +% columns) are to be replaced by a nobreakspace. % \begin{macrocode} local glue = prev_id == GLUE and prev_subtype == 0 local glue_wd @@ -1402,7 +1407,7 @@ local function french_punctuation (head) glue_spec = prev.spec glue_wd = glue_spec.width end - glue = glue and glue_wd > 0 + local realglue = glue and glue_wd > 1 % \end{macrocode} % For characters for which |FB_punct_thin| or |FB_punct_thick| is % \emph{true}, the amount of spacing to be typeset before them @@ -1412,32 +1417,33 @@ local function french_punctuation (head) % \emph{glue} in the node list), we remove the \emph{glue} and add a % nobreak penalty and the required \emph{glue}. % Otherwise (|auto| option), the penalty and the required -% \emph{glue} are inserted \emph{only if} all three conditions are -% satisfied: a) attribute |\FB@addDPspace| is set, -% b) the previous character is not part of type -% |FB_punct_null| (this avoids spurious spaces in strings -% like |(!)| or |??|), -% c) the punctuation mark does not start a paragraph. -% -% \changes{v3.0c}{2014/04/18}{Missing pair of braces after `and' in the -% definition of `auto'.} +% \emph{glue} are inserted if attribute |\FB@addDPspace| is set, +% unless one of these three condition is met: +% a) the previous character is part of type |FB_punct_null| (this +% avoids spurious spaces in strings like |(!)| or |??|), +% b) a null glue (actually glues <= 1 sp for tabulars) preceeds the +% punctuation character, +% c) the punctuation character starts a paragraph. % % \begin{macrocode} - if (FB_punct_thin[char] or FB_punct_thick[char]) then + if FB_punct_thin[char] or FB_punct_thick[char] then local SBDP = has_attribute(item, addDPspace) + local auto = SBDP and SBDP > 0 + if auto then + if (prev_char and FB_punct_null[prev_char]) or + (glue and glue_wd <= 1) or + (prev_id == 0 and prev_subtype == 3) then + auto = false + end + end local fbglue if FB_punct_thick[char] then fbglue = new_glue_scaled(fid,colnwd,colnst,colnsh) else fbglue = new_glue_scaled(fid,thinwd,thinst,thinsh) end - local auto = - SBDP and SBDP > 0 and - ((prev_char and not FB_punct_null[prev_char]) or - (not prev_char and (prev_id ~= 0 or prev_subtype ~= 3)) - ) - if glue or auto then - if glue then + if realglue or auto then + if realglue then head = remove_node(head,prev,true) end insert_node_before(head, item, copy_node(nobreak)) |