Debian Codegraph @

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

raw
1 %%
2 %% This is file `babel-ca-persian.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% babel.dtx (with options: `ca-persian')
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 \def\bbl@fpmod#1#2{(#1-#2*floor(#1/#2))}
36 \def\bbl@cs@gregleap#1{%
37 (\bbl@fpmod{#1}{4} == 0) &&
38 (!((\bbl@fpmod{#1}{100} == 0) && (\bbl@fpmod{#1}{400} != 0)))}
39 \def\bbl@cs@jd#1#2#3{% year, month, day
40 \fpeval{ 1721424.5 + (365 * (#1 - 1)) +
41 floor((#1 - 1) / 4) + (-floor((#1 - 1) / 100)) +
42 floor((#1 - 1) / 400) + floor((((367 * #2) - 362) / 12) +
43 ((#2 <= 2) ? 0 : (\bbl@cs@gregleap{#1} ? -1 : -2)) + #3) }}
44 \def\bbl@cs@firstjal@xx{2012,2016,2020,2024,2028,2029,% March 20
45 2032,2033,2036,2037,2040,2041,2044,2045,2048,2049}
46 \def\bbl@ca@persian#1-#2-#3\@@#4#5#6{%
47 \edef\bbl@tempa{#1}% 20XX-03-\bbl@tempe = 1 farvardin:
48 \ifnum\bbl@tempa>2012 \ifnum\bbl@tempa<2051
49 \bbl@afterfi\expandafter\@gobble
50 \fi\fi
51 {\bbl@error{year-out-range}{2013-2050}{}{}}%
52 \bbl@xin@{\bbl@tempa}{\bbl@cs@firstjal@xx}%
53 \ifin@\def\bbl@tempe{20}\else\def\bbl@tempe{21}\fi
54 \edef\bbl@tempc{\fpeval{\bbl@cs@jd{\bbl@tempa}{#2}{#3}+.5}}% current
55 \edef\bbl@tempb{\fpeval{\bbl@cs@jd{\bbl@tempa}{03}{\bbl@tempe}+.5}}% begin
56 \ifnum\bbl@tempc<\bbl@tempb
57 \edef\bbl@tempa{\fpeval{\bbl@tempa-1}}% go back 1 year and redo
58 \bbl@xin@{\bbl@tempa}{\bbl@cs@firstjal@xx}%
59 \ifin@\def\bbl@tempe{20}\else\def\bbl@tempe{21}\fi
60 \edef\bbl@tempb{\fpeval{\bbl@cs@jd{\bbl@tempa}{03}{\bbl@tempe}+.5}}%
61 \fi
62 \edef#4{\fpeval{\bbl@tempa-621}}% set Jalali year
63 \edef#6{\fpeval{\bbl@tempc-\bbl@tempb+1}}% days from 1 farvardin
64 \edef#5{\fpeval{% set Jalali month
65 (#6 <= 186) ? ceil(#6 / 31) : ceil((#6 - 6) / 30)}}
66 \edef#6{\fpeval{% set Jalali day
67 (#6 - ((#5 <= 7) ? ((#5 - 1) * 31) : (((#5 - 1) * 30) + 6)))}}}
68 \endinput
69 %%
70 %% End of file `babel-ca-persian.tex'.