[latex3-commits] [git/LaTeX3-latex3-babel] main: Fixed #207 (new way). 'base' now ignores unknown options. (4026a79)

Javier email at dante.de
Fri Dec 16 18:46:56 CET 2022


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/4026a79a5e11366f540afef36902b82047cb28c9

>---------------------------------------------------------------

commit 4026a79a5e11366f540afef36902b82047cb28c9
Author: Javier <email at localhost>
Date:   Fri Dec 16 18:46:56 2022 +0100

    Fixed #207 (new way). 'base' now ignores unknown options.


>---------------------------------------------------------------

4026a79a5e11366f540afef36902b82047cb28c9
 README.md    |   9 ++++++++-
 babel.dtx    |  65 ++++++++++++++++++++++++++++++++++++++++++-----------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 900444 -> 900858 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 57 insertions(+), 21 deletions(-)

diff --git a/README.md b/README.md
index e81bb9e..7e0b11d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.83.2950
+## Babel 3.83.2953
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages. Many
@@ -47,6 +47,13 @@ respective authors.
 ### Summary of latest changes
 ```
 3.84  (dev)
+      * Automatic selection of encodings with \babelprovide and pdftex.
+      * Option 'base' now ignores unknown options.
+      * Fixes:
+        - With 'select.write = omit' the main language wasn’t selected
+          in the aux file.
+        - New option counters* the pre-expand \thepage.
+        - #297
       
 3.83  2022-11-30
       * Improved Punjabi, thanks to Arvinder Singh (@punjab).
diff --git a/babel.dtx b/babel.dtx
index 6778b96..6c3a2e1 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/12/13 v3.83.2950 The Babel package]
+\ProvidesFile{babel.dtx}[2022/12/16 v3.83.2953 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -5194,8 +5194,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.83.2950>>
-%<<date=2022/12/13>>
+%<<version=3.83.2953>>
+%<<date=2022/12/16>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5741,10 +5741,16 @@ help from Bernd Raichle, for which I am grateful.
   \input babel.def
   \let\bbl at onlyswitch\@undefined
   \ifx\directlua\@undefined
-    \DeclareOption*{\bbl at patterns{\CurrentOption}}%
+    \DeclareOption*{%
+      \bbl at ifunset{l@\CurrentOption}%
+        {\bbl at warning{Ignoring \CurrentOption\space with 'base'\\}}%
+        {\bbl at patterns{\CurrentOption}}}%
   \else
     \input luababel.def
-    \DeclareOption*{\bbl at patterns@lua{\CurrentOption}}%
+    \DeclareOption*{%
+      \bbl at ifunset{l@\CurrentOption}%
+        {\bbl at warning{Ignoring \CurrentOption\space with 'base'\\}}%
+        {\bbl at patterns@lua{\CurrentOption}}}%
   \fi
   \DeclareOption{base}{}%
   \DeclareOption{showlanguages}{}%
@@ -22115,15 +22121,9 @@ local function insert_implicit(head, state, outer)
     dir = ((outer == 'r') and 'TLT' or 'TRT') -- ie, reverse
     local d = node.new(DIR)
     d.dir = '+' .. dir
-    if state.sim.prev and state.sim.prev.id == 8 then
-      state.sim = state.sim.prev
-    end
     node.insert_before(head, state.sim, d)
     local d = node.new(DIR)
     d.dir = '-' .. dir
-    if state.eim.next and state.eim.next.id == 8 then
-      state.eim = state.eim.next
-    end
     node.insert_after(head, state.eim, d)
   end
   new_state.sim, new_state.eim = nil, nil
@@ -22136,16 +22136,10 @@ local function insert_numeric(head, state)
   if state.san and state.ean and state.san ~= state.ean then
     local d = node.new(DIR)
     d.dir = '+TLT'
-    if state.san.prev and state.san.prev.id == 8 then
-      state.san = state.san.prev
-    end
     _, new = node.insert_before(head, state.san, d)
     if state.san == state.sim then state.sim = new end
     local d = node.new(DIR)
     d.dir = '-TLT'
-    if state.ean.next and state.ean.next.id == 8 then
-      state.ean = state.ean.next
-    end
     _, new = node.insert_after(head, state.ean, d)
     if state.ean == state.eim then state.eim = new end
   end
@@ -22174,6 +22168,8 @@ function Babel.bidi(head, ispar, hdir)
   local has_en = false
   local first_et = nil
   
+  local has_hyperlink = false
+
   local ATDIR = Babel.attr_dir
 
   local save_outer
@@ -22287,6 +22283,9 @@ function Babel.bidi(head, ispar, hdir)
     elseif item.id == node.id'math' then
       inmath = (item.subtype == 0)   
       
+    elseif item.id == 8 and item.subtype == 19 then
+      has_hyperlink = true
+
     else
       d = nil
     end
@@ -22485,7 +22484,37 @@ function Babel.bidi(head, ispar, hdir)
 
   end
   
-  return node.prev(head) or head
+  head = node.prev(head) or head
+  
+  -------------- FIX HYPERLINKS ----------------
+  
+  if has_hyperlink then
+    local flag, linking = 0, 0
+    for item in node.traverse(head) do
+      if item.id == DIR then
+        if item.dir == '+TRT' or item.dir == '+TLT' then
+          flag = flag + 1
+        elseif item.dir == '-TRT' or item.dir == '-TLT' then
+          flag = flag - 1
+        end
+      elseif item.id == 8 and item.subtype == 19 then
+        linking = flag
+      elseif item.id == 8 and item.subtype == 20 then
+        if linking > 0 then
+          if item.prev.id == DIR and
+              (item.prev.dir == '-TRT' or item.prev.dir == '-TLT') then
+            d = node.new(DIR)
+            d.dir = item.prev.dir
+            node.remove(head, item.prev)
+            node.insert_after(head, item, d)
+          end
+        end
+        linking = 0
+      end
+    end
+  end
+
+  return head
 end
 %</basic>
 %    \end{macrocode}
diff --git a/babel.ins b/babel.ins
index 7e7172e..e7e8a83 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2022/12/13}
+\def\filedate{2022/12/16}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index a752e34..0dbd573 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index d9438b4..532cfe5 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/12/13 v3.83.2950]
+\ProvidesFile{bbcompat.dtx}[2022/12/16 v3.83.2953]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.