From c672bfbc647851808b23bd991236f0eb93f2b404 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 30 Apr 2022 20:04:04 +0000
Subject: babel (30apr22)

git-svn-id: svn://tug.org/texlive/trunk@63189 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/generic/babel/babel.sty | 81 +++++++++++++++++----------
 1 file changed, 51 insertions(+), 30 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/babel/babel.sty')

diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty
index 87ca08bbc74..2c97c5384a5 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.sty
+++ b/Master/texmf-dist/tex/generic/babel/babel.sty
@@ -34,7 +34,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2022/02/26 3.73 The Babel package]
+\ProvidesPackage{babel}[2022/04/30 3.74 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl@debug\@firstofone
@@ -360,6 +360,8 @@
 \DeclareOption{safe=none}{\let\bbl@opt@safe\@empty}
 \DeclareOption{safe=bib}{\def\bbl@opt@safe{B}}
 \DeclareOption{safe=ref}{\def\bbl@opt@safe{R}}
+\DeclareOption{safe=refbib}{\def\bbl@opt@safe{BR}}
+\DeclareOption{safe=bibref}{\def\bbl@opt@safe{BR}}
 \chardef\bbl@bidimode\z@
 \DeclareOption{bidi=default}{\chardef\bbl@bidimode=\@ne}
 \DeclareOption{bidi=basic}{\chardef\bbl@bidimode=101 }
@@ -367,6 +369,9 @@
 \DeclareOption{bidi=bidi}{\chardef\bbl@bidimode=201 }
 \DeclareOption{bidi=bidi-r}{\chardef\bbl@bidimode=202 }
 \DeclareOption{bidi=bidi-l}{\chardef\bbl@bidimode=203 }
+\chardef\bbl@eqnpos\z@
+\DeclareOption{leqno}{\chardef\bbl@eqnpos\@ne}
+\DeclareOption{fleqn}{\chardef\bbl@eqnpos\tw@}
 \let\bbl@opt@shorthands\@nnil
 \let\bbl@opt@config\@nnil
 \let\bbl@opt@main\@nnil
@@ -453,8 +458,8 @@
       \expandafter\@secondoftwo
     \fi}
 \fi
-\def\bbl@version{3.73}
-\def\bbl@date{2022/02/26}
+\def\bbl@version{3.74}
+\def\bbl@date{2022/04/30}
 \ifx\language\@undefined
   \csname newcount\endcsname\language
 \fi
@@ -3723,7 +3728,7 @@
   \fi
 \fi
 \bbl@trace{Cross referencing macros}
-\ifx\bbl@opt@safe\@empty\else
+\ifx\bbl@opt@safe\@empty\else % ie, if 'ref' and/or 'bib'
   \def\@newl@bel#1#2#3{%
    {\@safe@activestrue
     \bbl@ifunset{#1@#2}%
@@ -3755,10 +3760,24 @@
 \fi
 \bbl@xin@{R}\bbl@opt@safe
 \ifin@
-  \bbl@redefinerobust\ref#1{%
-    \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
-  \bbl@redefinerobust\pageref#1{%
-    \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
+  \edef\bbl@tempc{\expandafter\string\csname ref code\endcsname}%
+  \bbl@xin@{\expandafter\strip@prefix\meaning\bbl@tempc}%
+    {\expandafter\strip@prefix\meaning\ref}%
+  \ifin@
+    \bbl@redefine\@kernel@ref#1{%
+      \@safe@activestrue\org@@kernel@ref{#1}\@safe@activesfalse}
+    \bbl@redefine\@kernel@pageref#1{%
+      \@safe@activestrue\org@@kernel@pageref{#1}\@safe@activesfalse}
+    \bbl@redefine\@kernel@sref#1{%
+      \@safe@activestrue\org@@kernel@sref{#1}\@safe@activesfalse}
+    \bbl@redefine\@kernel@spageref#1{%
+      \@safe@activestrue\org@@kernel@spageref{#1}\@safe@activesfalse}
+  \else
+    \bbl@redefinerobust\ref#1{%
+      \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
+    \bbl@redefinerobust\pageref#1{%
+      \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
+  \fi
 \else
   \let\org@ref\ref
   \let\org@pageref\pageref
@@ -3841,28 +3860,30 @@
        \bbl@tempc
      \fi}  % end ifbbl@single, end \IfBabelLayout
 \bbl@trace{Preventing clashes with other packages}
-\bbl@xin@{R}\bbl@opt@safe
-\ifin@
-  \AtBeginDocument{%
-    \@ifpackageloaded{ifthen}{%
-      \bbl@redefine@long\ifthenelse#1#2#3{%
-        \let\bbl@temp@pref\pageref
-        \let\pageref\org@pageref
-        \let\bbl@temp@ref\ref
-        \let\ref\org@ref
-        \@safe@activestrue
-        \org@ifthenelse{#1}%
-          {\let\pageref\bbl@temp@pref
-           \let\ref\bbl@temp@ref
-           \@safe@activesfalse
-           #2}%
-          {\let\pageref\bbl@temp@pref
-           \let\ref\bbl@temp@ref
-           \@safe@activesfalse
-           #3}%
-        }%
-      }{}%
-    }
+\ifx\org@ref\@undefined\else
+  \bbl@xin@{R}\bbl@opt@safe
+  \ifin@
+    \AtBeginDocument{%
+      \@ifpackageloaded{ifthen}{%
+        \bbl@redefine@long\ifthenelse#1#2#3{%
+          \let\bbl@temp@pref\pageref
+          \let\pageref\org@pageref
+          \let\bbl@temp@ref\ref
+          \let\ref\org@ref
+          \@safe@activestrue
+          \org@ifthenelse{#1}%
+            {\let\pageref\bbl@temp@pref
+             \let\ref\bbl@temp@ref
+             \@safe@activesfalse
+             #2}%
+            {\let\pageref\bbl@temp@pref
+             \let\ref\bbl@temp@ref
+             \@safe@activesfalse
+             #3}%
+          }%
+        }{}%
+      }
+\fi
   \AtBeginDocument{%
     \@ifpackageloaded{varioref}{%
       \bbl@redefine\@@vpageref#1[#2]#3{%
-- 
cgit v1.2.3

