Debian Codegraph @

texmf-dist/tex/generic/babel/babel-ca-hebrew.tex

raw
1 %%
2 %% This is file `babel-ca-hebrew.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% babel.dtx (with options: `ca-hebrew')
8 %%
9 %%
10 %% Copyright (C) 2012-2026 Javier Bezos and Johannes L. Braams.
11 %% Copyright (C) 1989-2012 Johannes L. Braams and
12 %% any individual authors listed elsewhere in this file.
13 %% All rights reserved.
14 %%
15 %%
16 %% This file is part of the Babel system.
17 %% --------------------------------------
18 %%
19 %% It may be distributed and/or modified under the
20 %% conditions of the LaTeX Project Public License, either version 1.3
21 %% of this license or (at your option) any later version.
22 %% The latest version of this license is in
23 %% http://www.latex-project.org/lppl.txt
24 %% and version 1.3 or later is part of all distributions of LaTeX
25 %% version 2003/12/01 or later.
26 %%
27 %% This work has the LPPL maintenance status "maintained".
28 %%
29 %% The Current Maintainer of this work is Javier Bezos.
30 %%
31 %% The list of derived (unpacked) files belonging to the distribution
32 %% and covered by LPPL is defined by the unpacking scripts (with
33 %% extension |.ins|) which are part of the distribution.
34 %%
35 \newcount\bbl@cntcommon
36 \def\bbl@remainder#1#2#3{%
37 #3=#1\relax
38 \divide #3 by #2\relax
39 \multiply #3 by -#2\relax
40 \advance #3 by #1\relax}%
41 \newif\ifbbl@divisible
42 \def\bbl@checkifdivisible#1#2{%
43 {\countdef\tmp=0
44 \bbl@remainder{#1}{#2}{\tmp}%
45 \ifnum \tmp=0
46 \global\bbl@divisibletrue
47 \else
48 \global\bbl@divisiblefalse
49 \fi}}
50 \newif\ifbbl@gregleap
51 \def\bbl@ifgregleap#1{%
52 \bbl@checkifdivisible{#1}{4}%
53 \ifbbl@divisible
54 \bbl@checkifdivisible{#1}{100}%
55 \ifbbl@divisible
56 \bbl@checkifdivisible{#1}{400}%
57 \ifbbl@divisible
58 \bbl@gregleaptrue
59 \else
60 \bbl@gregleapfalse
61 \fi
62 \else
63 \bbl@gregleaptrue
64 \fi
65 \else
66 \bbl@gregleapfalse
67 \fi
68 \ifbbl@gregleap}
69 \def\bbl@gregdayspriormonths#1#2#3{%
70 {#3=\ifcase #1 0 \or 0 \or 31 \or 59 \or 90 \or 120 \or 151 \or
71 181 \or 212 \or 243 \or 273 \or 304 \or 334 \fi
72 \bbl@ifgregleap{#2}%
73 \ifnum #1 > 2
74 \advance #3 by 1
75 \fi
76 \fi
77 \global\bbl@cntcommon=#3}%
78 #3=\bbl@cntcommon}
79 \def\bbl@gregdaysprioryears#1#2{%
80 {\countdef\tmpc=4
81 \countdef\tmpb=2
82 \tmpb=#1\relax
83 \advance \tmpb by -1
84 \tmpc=\tmpb
85 \multiply \tmpc by 365
86 #2=\tmpc
87 \tmpc=\tmpb
88 \divide \tmpc by 4
89 \advance #2 by \tmpc
90 \tmpc=\tmpb
91 \divide \tmpc by 100
92 \advance #2 by -\tmpc
93 \tmpc=\tmpb
94 \divide \tmpc by 400
95 \advance #2 by \tmpc
96 \global\bbl@cntcommon=#2\relax}%
97 #2=\bbl@cntcommon}
98 \def\bbl@absfromgreg#1#2#3#4{%
99 {\countdef\tmpd=0
100 #4=#1\relax
101 \bbl@gregdayspriormonths{#2}{#3}{\tmpd}%
102 \advance #4 by \tmpd
103 \bbl@gregdaysprioryears{#3}{\tmpd}%
104 \advance #4 by \tmpd
105 \global\bbl@cntcommon=#4\relax}%
106 #4=\bbl@cntcommon}
107 \newif\ifbbl@hebrleap
108 \def\bbl@checkleaphebryear#1{%
109 {\countdef\tmpa=0
110 \countdef\tmpb=1
111 \tmpa=#1\relax
112 \multiply \tmpa by 7
113 \advance \tmpa by 1
114 \bbl@remainder{\tmpa}{19}{\tmpb}%
115 \ifnum \tmpb < 7
116 \global\bbl@hebrleaptrue
117 \else
118 \global\bbl@hebrleapfalse
119 \fi}}
120 \def\bbl@hebrelapsedmonths#1#2{%
121 {\countdef\tmpa=0
122 \countdef\tmpb=1
123 \countdef\tmpc=2
124 \tmpa=#1\relax
125 \advance \tmpa by -1
126 #2=\tmpa
127 \divide #2 by 19
128 \multiply #2 by 235
129 \bbl@remainder{\tmpa}{19}{\tmpb}% \tmpa=years%19-years this cycle
130 \tmpc=\tmpb
131 \multiply \tmpb by 12
132 \advance #2 by \tmpb
133 \multiply \tmpc by 7
134 \advance \tmpc by 1
135 \divide \tmpc by 19
136 \advance #2 by \tmpc
137 \global\bbl@cntcommon=#2}%
138 #2=\bbl@cntcommon}
139 \def\bbl@hebrelapseddays#1#2{%
140 {\countdef\tmpa=0
141 \countdef\tmpb=1
142 \countdef\tmpc=2
143 \bbl@hebrelapsedmonths{#1}{#2}%
144 \tmpa=#2\relax
145 \multiply \tmpa by 13753
146 \advance \tmpa by 5604
147 \bbl@remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
148 \divide \tmpa by 25920
149 \multiply #2 by 29
150 \advance #2 by 1
151 \advance #2 by \tmpa
152 \bbl@remainder{#2}{7}{\tmpa}%
153 \ifnum \tmpc < 19440
154 \ifnum \tmpc < 9924
155 \else
156 \ifnum \tmpa=2
157 \bbl@checkleaphebryear{#1}% of a common year
158 \ifbbl@hebrleap
159 \else
160 \advance #2 by 1
161 \fi
162 \fi
163 \fi
164 \ifnum \tmpc < 16789
165 \else
166 \ifnum \tmpa=1
167 \advance #1 by -1
168 \bbl@checkleaphebryear{#1}% at the end of leap year
169 \ifbbl@hebrleap
170 \advance #2 by 1
171 \fi
172 \fi
173 \fi
174 \else
175 \advance #2 by 1
176 \fi
177 \bbl@remainder{#2}{7}{\tmpa}%
178 \ifnum \tmpa=0
179 \advance #2 by 1
180 \else
181 \ifnum \tmpa=3
182 \advance #2 by 1
183 \else
184 \ifnum \tmpa=5
185 \advance #2 by 1
186 \fi
187 \fi
188 \fi
189 \global\bbl@cntcommon=#2\relax}%
190 #2=\bbl@cntcommon}
191 \def\bbl@daysinhebryear#1#2{%
192 {\countdef\tmpe=12
193 \bbl@hebrelapseddays{#1}{\tmpe}%
194 \advance #1 by 1
195 \bbl@hebrelapseddays{#1}{#2}%
196 \advance #2 by -\tmpe
197 \global\bbl@cntcommon=#2}%
198 #2=\bbl@cntcommon}
199 \def\bbl@hebrdayspriormonths#1#2#3{%
200 {\countdef\tmpf= 14
201 #3=\ifcase #1
202 0 \or
203 0 \or
204 30 \or
205 59 \or
206 89 \or
207 118 \or
208 148 \or
209 148 \or
210 177 \or
211 207 \or
212 236 \or
213 266 \or
214 295 \or
215 325 \or
216 400
217 \fi
218 \bbl@checkleaphebryear{#2}%
219 \ifbbl@hebrleap
220 \ifnum #1 > 6
221 \advance #3 by 30
222 \fi
223 \fi
224 \bbl@daysinhebryear{#2}{\tmpf}%
225 \ifnum #1 > 3
226 \ifnum \tmpf=353
227 \advance #3 by -1
228 \fi
229 \ifnum \tmpf=383
230 \advance #3 by -1
231 \fi
232 \fi
233 \ifnum #1 > 2
234 \ifnum \tmpf=355
235 \advance #3 by 1
236 \fi
237 \ifnum \tmpf=385
238 \advance #3 by 1
239 \fi
240 \fi
241 \global\bbl@cntcommon=#3\relax}%
242 #3=\bbl@cntcommon}
243 \def\bbl@absfromhebr#1#2#3#4{%
244 {#4=#1\relax
245 \bbl@hebrdayspriormonths{#2}{#3}{#1}%
246 \advance #4 by #1\relax
247 \bbl@hebrelapseddays{#3}{#1}%
248 \advance #4 by #1\relax
249 \advance #4 by -1373429
250 \global\bbl@cntcommon=#4\relax}%
251 #4=\bbl@cntcommon}
252 \def\bbl@hebrfromgreg#1#2#3#4#5#6{%
253 {\countdef\tmpx= 17
254 \countdef\tmpy= 18
255 \countdef\tmpz= 19
256 #6=#3\relax
257 \global\advance #6 by 3761
258 \bbl@absfromgreg{#1}{#2}{#3}{#4}%
259 \tmpz=1 \tmpy=1
260 \bbl@absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
261 \ifnum \tmpx > #4\relax
262 \global\advance #6 by -1
263 \bbl@absfromhebr{\tmpz}{\tmpy}{#6}{\tmpx}%
264 \fi
265 \advance #4 by -\tmpx
266 \advance #4 by 1
267 #5=#4\relax
268 \divide #5 by 30
269 \loop
270 \bbl@hebrdayspriormonths{#5}{#6}{\tmpx}%
271 \ifnum \tmpx < #4\relax
272 \advance #5 by 1
273 \tmpy=\tmpx
274 \repeat
275 \global\advance #5 by -1
276 \global\advance #4 by -\tmpy}}
277 \newcount\bbl@hebrday \newcount\bbl@hebrmonth \newcount\bbl@hebryear
278 \newcount\bbl@gregday \newcount\bbl@gregmonth \newcount\bbl@gregyear
279 \def\bbl@ca@hebrew#1-#2-#3\@@#4#5#6{%
280 \bbl@gregday=#3\relax \bbl@gregmonth=#2\relax \bbl@gregyear=#1\relax
281 \bbl@hebrfromgreg
282 {\bbl@gregday}{\bbl@gregmonth}{\bbl@gregyear}%
283 {\bbl@hebrday}{\bbl@hebrmonth}{\bbl@hebryear}%
284 \edef#4{\the\bbl@hebryear}%
285 \edef#5{\the\bbl@hebrmonth}%
286 \edef#6{\the\bbl@hebrday}}
287 \endinput
288 %%
289 %% End of file `babel-ca-hebrew.tex'.