[latex3-commits] [git/LaTeX3-latex3-babel] main: Hebrew calendar. (e6c2d68)

Javier email at dante.de
Sat May 28 13:33:55 CEST 2022


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

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

commit e6c2d68d7cc19f68b107d04693de45bdba1a7822
Author: Javier <email at localhost>
Date:   Sat May 28 13:33:55 2022 +0200

    Hebrew calendar.


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

e6c2d68d7cc19f68b107d04693de45bdba1a7822
 README.md              |   5 +-
 babel.dtx              | 271 ++++++++++++++++++++++++++++++++++++++++++++++++-
 babel.ins              |   3 +-
 babel.pdf              | Bin 868060 -> 877688 bytes
 bbcompat.dtx           |   2 +-
 locale/he/babel-he.ini |   1 +
 6 files changed, 275 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index fc237ab..289403d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.75.2750
+## Babel 3.75.2751
 
 *(Development)*
 
@@ -49,7 +49,8 @@ respective authors.
 ### Summary of latest changes
 ```
 3.75   (dev)
-       * Calendar conversion: islamic-civil, islamic-umalqura.
+       * Calendar conversion with a new macro \babelcalendar: hebrew,
+         islamic-civil, islamic-umalqura.
 
 3.75   2022-05-22
        * `\BabelEnsureInfo` is active by default, to make sure the BCP 47
diff --git a/babel.dtx b/babel.dtx
index 00717e4..823810e 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/05/27 v3.75.2750 The Babel package]
+\ProvidesFile{babel.dtx}[2022/05/28 v3.75.2751 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -5143,8 +5143,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.75.2750>>
-%<<date=2022/05/27>>
+%<<version=3.75.2751>>
+%<<date=2022/05/28>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -22812,6 +22812,271 @@ Babel.cjk_breaks = {
 %</ca-islamic>
 %    \end{macrocode}
 %
+% \section{Hebrew}
+%
+% This is basically the set of macros written by Michail Rozman in
+% 1991, with corrections and adaptions by Rama Porrat, Misha, Dan Haran
+% and Boris Lavva. This must be eventually replaced by computations
+% with \textsf{l3fp}.
+%
+%    \begin{macrocode}
+%<*ca-hebrew>
+\newcount\bbl at cntcommon
+\def\bbl at remainder#1#2#3{%
+  #3 = #1                   %  c = a
+  \divide #3 by #2          %  c = a/b
+  \multiply #3 by -#2       %  c = -b(a/b)
+  \advance #3 by #1 }%        %  c = a - b(a/b)
+\newif\ifbbl at divisible
+\def\bbl at checkifdivisible#1#2{%
+  {\countdef\tmp = 0 % \tmp == \count0 - temporary variable
+   \bbl at remainder{#1}{#2}{\tmp}%
+   \ifnum \tmp = 0
+       \global\bbl at divisibletrue 
+   \else
+       \global\bbl at divisiblefalse
+   \fi}}
+\newif\ifbbl at gregleap
+\def\bbl at ifgregleap#1{%
+  \bbl at checkifdivisible{#1}{4}%
+  \ifbbl at divisible
+      \bbl at checkifdivisible{#1}{100}%
+      \ifbbl at divisible
+          \bbl at checkifdivisible{#1}{400}%
+          \ifbbl at divisible
+              \bbl at gregleaptrue
+          \else
+              \bbl at gregleapfalse
+          \fi
+      \else
+          \bbl at gregleaptrue
+      \fi
+  \else
+      \bbl at gregleapfalse
+  \fi
+  \ifbbl at gregleap}
+\def\bbl at gregdayspriormonths#1#2#3{% no month number 0
+    {#3 = \ifcase #1 0 \or 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or
+          181 \or 212 \or 243 \or 273 \or 304 \or 334 \fi
+     \bbl at ifgregleap{#2}%
+         \ifnum #1 > 2        % if month after February
+             \advance #3 by 1  % add leap day
+         \fi
+     \fi
+     \global\bbl at cntcommon = #3}%
+    #3 = \bbl at cntcommon}
+\def\bbl at gregdaysprioryears#1#2{%
+  {\countdef\tmpc = 4      % \tmpc==\count4
+   \countdef\tmpb = 2      % \tmpb==\count2
+   \tmpb = #1              %
+   \advance \tmpb by -1    %
+   \tmpc = \tmpb           % \tmpc = \tmpb = year-1
+   \multiply \tmpc by 365  % Days in prior years =
+   #2 = \tmpc              % = 365*(year-1) ...
+   \tmpc = \tmpb           %
+   \divide \tmpc by 4      % \tmpc = (year-1)/4
+   \advance #2 by \tmpc    % ... plus Julian leap days ...
+   \tmpc = \tmpb           %
+   \divide \tmpc by 100    % \tmpc = (year-1)/100
+   \advance #2 by -\tmpc   % ... minus century years ...
+   \tmpc = \tmpb           %
+   \divide \tmpc by 400    % \tmpc = (year-1)/400
+   \advance #2 by \tmpc    % ... plus 4-century years.
+   \global\bbl at cntcommon = #2}%
+  #2 = \bbl at cntcommon}
+\def\bbl at absfromgreg#1#2#3#4{%
+  {\countdef\tmpd = 0       % \tmpd==\count0
+   #4 = #1                  % days so far this month
+   \bbl at gregdayspriormonths{#2}{#3}{\tmpd}%
+   \advance #4 by \tmpd     % add days in prior months
+   \bbl at gregdaysprioryears{#3}{\tmpd}%
+   \advance #4 by \tmpd     % add days in prior years
+   \global\bbl at cntcommon = #4}%
+  #4 = \bbl at cntcommon}
+\newif\ifbbl at hebrleap
+\def\bbl at checkleaphebryear#1{%
+  {\countdef\tmpa = 0       % \tmpa==\count0
+   \countdef\tmpb = 1       % \tmpb==\count1
+   \tmpa = #1
+   \multiply \tmpa by 7
+   \advance \tmpa by 1
+   \bbl at remainder{\tmpa}{19}{\tmpb}%
+   \ifnum \tmpb < 7         % \tmpb = (7*year+1)%19
+       \global\bbl at hebrleaptrue
+   \else
+       \global\bbl at hebrleapfalse
+   \fi}}
+\def\bbl at hebrelapsedmonths#1#2{%
+  {\countdef\tmpa = 0        % \tmpa==\count0
+   \countdef\tmpb = 1        % \tmpb==\count1
+   \countdef\tmpc = 2        % \tmpc==\count2
+   \tmpa = #1                %
+   \advance \tmpa by -1      %
+   #2 = \tmpa                % #2 = \tmpa = year-1
+   \divide #2 by 19          % Number of complete Meton cycles
+   \multiply #2 by 235       % #2 = 235*((year-1)/19)
+   \bbl at remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
+   \tmpc = \tmpb             %
+   \multiply \tmpb by 12     %
+   \advance #2 by \tmpb      % add regular months this cycle
+   \multiply \tmpc by 7      %
+   \advance \tmpc by 1       %
+   \divide \tmpc by 19       % \tmpc = (1+7*((year-1)%19))/19 -
+   \advance #2 by \tmpc      %  add leap months
+   \global\bbl at cntcommon = #2}%
+  #2 = \bbl at cntcommon}
+\def\bbl at hebrelapseddays#1#2{%
+  {\countdef\tmpa = 0        % \tmpa==\count0
+   \countdef\tmpb = 1        % \tmpb==\count1
+   \countdef\tmpc = 2        % \tmpc==\count2
+   \bbl at hebrelapsedmonths{#1}{#2}%
+   \tmpa = #2                %
+   \multiply \tmpa by 13753  %
+   \advance \tmpa by 5604    % \tmpa=MonthsElapsed*13758 + 5604
+   \bbl at remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
+   \divide \tmpa by 25920 
+   \multiply #2 by 29 
+   \advance #2 by 1 
+   \advance #2 by \tmpa      %  #2 = 1 + MonthsElapsed*29 +
+   \bbl at remainder{#2}{7}{\tmpa}% %  \tmpa == DayOfWeek
+   \ifnum \tmpc < 19440 
+       \ifnum \tmpc < 9924 
+       \else                 % New moon at 9 h. 204 p. or later
+           \ifnum \tmpa = 2  % on Tuesday ...
+               \bbl at checkleaphebryear{#1}% of a common year
+               \ifbbl at hebrleap 
+               \else 
+                   \advance #2 by 1 
+               \fi 
+           \fi 
+       \fi 
+       \ifnum \tmpc < 16789 
+       \else                  % New moon at 15 h. 589 p. or later
+           \ifnum \tmpa = 1   % on Monday ...
+               \advance #1 by -1 
+               \bbl at checkleaphebryear{#1}% at the end of leap year
+               \ifbbl at hebrleap 
+                   \advance #2 by 1 
+               \fi 
+           \fi 
+       \fi 
+   \else 
+       \advance #2 by 1       %  new moon at or after midday
+   \fi 
+   \bbl at remainder{#2}{7}{\tmpa}%  %  \tmpa == DayOfWeek
+   \ifnum \tmpa = 0           %  if Sunday ...
+       \advance #2 by 1 
+   \else                      %
+       \ifnum \tmpa = 3       %  Wednesday ...
+           \advance #2 by 1 
+       \else 
+           \ifnum \tmpa = 5   %  or Friday
+                \advance #2 by 1 
+           \fi 
+       \fi 
+   \fi 
+   \global\bbl at cntcommon = #2}%
+  #2 = \bbl at cntcommon}
+\def\bbl at daysinhebryear#1#2{%
+  {\countdef\tmpe = 12    % \tmpe==\count12
+   \bbl at hebrelapseddays{#1}{\tmpe}%
+   \advance #1 by 1 
+   \bbl at hebrelapseddays{#1}{#2}%
+   \advance #2 by -\tmpe 
+   \global\bbl at cntcommon = #2}%
+  #2 = \bbl at cntcommon}
+\def\bbl at hebrdayspriormonths#1#2#3{%
+  {\countdef\tmpf= 14    % \tmpf==\count14
+   #3 = \ifcase #1       % Days in prior month of regular year
+          0 \or          % no month number 0
+          0 \or          % Tishri
+         30 \or          % Heshvan
+         59 \or          % Kislev
+         89 \or          % Tebeth
+        118 \or          % Shebat
+        148 \or          % Adar I
+        148 \or          % Adar II
+        177 \or          % Nisan
+        207 \or          % Iyar
+        236 \or          % Sivan
+        266 \or          % Tammuz
+        295 \or          % Av
+        325 \or          % Elul
+        400              % Dummy
+   \fi
+   \bbl at checkleaphebryear{#2}%
+   \ifbbl at hebrleap             % in leap year
+       \ifnum #1 > 6          % if month after Adar I
+           \advance #3 by 30  % add  30 days
+       \fi 
+   \fi 
+   \bbl at daysinhebryear{#2}{\tmpf}%
+   \ifnum #1 > 3 
+       \ifnum \tmpf = 353     %
+           \advance #3 by -1  %
+       \fi                    %  Short Kislev
+       \ifnum \tmpf = 383     %
+           \advance #3 by -1  %
+       \fi                    %
+   \fi 
+   \ifnum #1 > 2 
+       \ifnum \tmpf = 355     %
+           \advance #3 by 1   %
+       \fi                    %  Long Heshvan
+       \ifnum \tmpf = 385     %
+           \advance #3 by 1   %
+       \fi                    %
+   \fi 
+   \global\bbl at cntcommon = #3}%
+  #3 = \bbl at cntcommon}
+\def\bbl at absfromhebr#1#2#3#4{%
+  {#4 = #1 
+   \bbl at hebrdayspriormonths{#2}{#3}{#1}%
+   \advance #4 by #1          % Add days in prior months this year
+   \bbl at hebrelapseddays{#3}{#1}%
+   \advance #4 by #1          % Add days in prior years
+   \advance #4 by -1373429    % Subtract days before Gregorian
+   \global\bbl at cntcommon = #4}%     %   01.01.0001
+  #4 = \bbl at cntcommon}
+\def\bbl at hebrfromgreg#1#2#3#4#5#6{%
+  {\countdef\tmpx= 17         % \tmpx==\count17
+   \countdef\tmpy= 18         % \tmpy==\count18
+   \countdef\tmpz= 19         % \tmpz==\count19
+   #6 = #3                    %
+   \global\advance #6 by 3761 % approximation from above
+   \bbl at absfromgreg{#1}{#2}{#3}{#4}%
+   \tmpz = 1  \tmpy = 1 
+   \bbl at absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
+   \ifnum \tmpx > #4               %
+       \global\advance #6 by -1 % Hyear = Gyear + 3760
+       \bbl at absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
+   \fi                             %
+   \advance #4 by -\tmpx      % Days in this year
+   \advance #4 by 1           %
+   #5 = #4                    %
+   \divide #5 by 30           % Approximation for month from below
+   \loop                      % Search for month
+       \bbl at hebrdayspriormonths{#5}{#6}{\tmpx}%
+       \ifnum \tmpx < #4 
+           \advance #5 by 1 
+           \tmpy = \tmpx 
+   \repeat 
+   \global\advance #5 by -1 
+   \global\advance #4 by -\tmpy}}
+\newcount\bbl at hebrday \newcount\bbl at hebrmonth \newcount\bbl at hebryear
+\newcount\bbl at gregday \newcount\bbl at gregmonth \newcount\bbl at gregyear
+%
+\def\bbl at ca@hebrew#1-#2-#3\@@#4#5#6{%
+  \bbl at gregday=#3 \bbl at gregmonth=#2 \bbl at gregyear=#1
+  \bbl at hebrfromgreg
+    {\bbl at gregday}{\bbl at gregmonth}{\bbl at gregyear}%
+    {\bbl at hebrday}{\bbl at hebrmonth}{\bbl at hebryear}%
+  \edef#4{\the\bbl at hebryear}%
+  \edef#5{\the\bbl at hebrmonth}%
+  \edef#6{\the\bbl at hebrday}}
+%</ca-hebrew>
+%    \end{macrocode}
+%
 % \section{Support for Plain \TeX\ (\texttt{plain.def})}
 %
 % \subsection{Not renaming \file{hyphen.tex}}
diff --git a/babel.ins b/babel.ins
index fe0bd14..207aaf3 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/05/27}
+\def\filedate{2022/05/28}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
@@ -135,6 +135,7 @@
           \file{switch.def}{\from{babel.dtx}{kernel}}
           \file{hyphen.cfg}{\from{babel.dtx}{patterns}}
           \file{nil.ldf}{\from{babel.dtx}{nil}}
+          \file{babel-ca-hebrew.tex}{\from{babel.dtx}{ca-hebrew}}
           \file{babel-ca-islamic.tex}{\from{babel.dtx}{ca-islamic}}
           \file{xebabel.def}{\from{babel.dtx}{xetex}}
           \file{luababel.def}{\from{babel.dtx}{luatex}}
diff --git a/babel.pdf b/babel.pdf
index b57fe4c..e0e9d6a 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 96288a7..50abf1b 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/05/27 v3.75.2750]
+\ProvidesFile{bbcompat.dtx}[2022/05/28 v3.75.2751]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/he/babel-he.ini b/locale/he/babel-he.ini
index 9893a7e..af25b9a 100644
--- a/locale/he/babel-he.ini
+++ b/locale/he/babel-he.ini
@@ -27,6 +27,7 @@ script.tag.opentype = hebr
 level = 1
 encodings = 
 derivate = no
+require.calendars = hebrew
 
 [captions]
 preface = מבוא





More information about the latex3-commits mailing list.