/usr/share/texlive/texmf-dist/tex/lualatex/luapersian/luapersian-persiancal.sty is in texlive-luatex 2012.20120611-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | %%
%% This is file `luapersian-persiancal.sty',
%% generated with the docstrip utility.
%% ______________________________________
%% Copyright © 2011 Vafa Khalighi
%%
%% License information appended.
%%
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luapersian-persiancal}[2011/08/01 v0.1 provides Persian calendar]
\newif\ifluapersian@leap \newif\ifluapersian@kabiseh
\newcount\luapersian@i \newcount\luapersian@y \newcount\luapersian@m \newcount\luapersian@d
\newcount\luapersian@latini \newcount\luapersian@persiani
\newcount\luapersian@latinii \newcount\luapersian@persianii
\newcount\luapersian@latiniii \newcount\luapersian@persianiii
\newcount\luapersian@latiniv \newcount\luapersian@persianiv
\newcount\luapersian@latinv \newcount\luapersian@persianv
\newcount\luapersian@latinvi \newcount\luapersian@persianvi
\newcount\luapersian@latinvii \newcount\luapersian@persianvii
\newcount\luapersian@latinviii \newcount\luapersian@persianviii
\newcount\luapersian@latinix \newcount\luapersian@persianix
\newcount\luapersian@latinx \newcount\luapersian@persianx
\newcount\luapersian@latinxi \newcount\luapersian@persianxi
\newcount\luapersian@latinxii \newcount\luapersian@persianxii
\newcount\luapersian@persianxiii
\newcount\luapersian@temp
\newcount\luapersian@temptwo
\newcount\luapersian@tempthree
\newcount\luapersian@yModHundred
\newcount\luapersian@thirtytwo
\newcount\luapersian@dn
\newcount\luapersian@sn
\newcount\luapersian@mminusone
\def\persiantoday{%
\luapersian@y=\year \luapersian@m=\month \luapersian@d=\day
\luapersian@temp=\luapersian@y
\divide\luapersian@temp by 100\relax
\multiply\luapersian@temp by 100\relax
\luapersian@yModHundred=\luapersian@y
\advance\luapersian@yModHundred by -\luapersian@temp\relax
\ifodd\luapersian@yModHundred
\luapersian@leapfalse
\else
\luapersian@temp=\luapersian@yModHundred
\divide\luapersian@temp by 2\relax
\ifodd\luapersian@temp\luapersian@leapfalse
\else
\ifnum\luapersian@yModHundred=0%
\luapersian@temp=\luapersian@y
\divide\luapersian@temp by 400\relax
\multiply\luapersian@temp by 400\relax
\ifnum\luapersian@y=\luapersian@temp\luapersian@leaptrue\else\luapersian@leapfalse\fi
\else\luapersian@leaptrue
\fi
\fi
\fi
\luapersian@latini=31\relax
\ifluapersian@leap
\luapersian@latinii = 29\relax
\else
\luapersian@latinii = 28\relax
\fi
\luapersian@latiniii = 31\relax
\luapersian@latiniv = 30\relax
\luapersian@latinv = 31\relax
\luapersian@latinvi = 30\relax
\luapersian@latinvii = 31\relax
\luapersian@latinviii = 31\relax
\luapersian@latinix = 30\relax
\luapersian@latinx = 31\relax
\luapersian@latinxi = 30\relax
\luapersian@latinxii = 31\relax
\luapersian@thirtytwo=32\relax
\luapersian@temp=\luapersian@y
\advance\luapersian@temp by -17\relax
\luapersian@temptwo=\luapersian@temp
\divide\luapersian@temptwo by 33\relax
\multiply\luapersian@temptwo by 33\relax
\advance\luapersian@temp by -\luapersian@temptwo
\ifnum\luapersian@temp=\luapersian@thirtytwo\luapersian@kabisehfalse
\else
\luapersian@temptwo=\luapersian@temp
\divide\luapersian@temptwo by 4\relax
\multiply\luapersian@temptwo by 4\relax
\advance\luapersian@temp by -\luapersian@temptwo
\ifnum\luapersian@temp=\z@\luapersian@kabisehtrue\else\luapersian@kabisehfalse\fi
\fi
\luapersian@tempthree=\luapersian@y % Number of Leap years
\advance\luapersian@tempthree by -1
\luapersian@temp=\luapersian@tempthree % T := (MY-1) div 4
\divide\luapersian@temp by 4\relax
\luapersian@temptwo=\luapersian@tempthree % T := T - ((MY-1) div 100)
\divide\luapersian@temptwo by 100\relax
\advance\luapersian@temp by -\luapersian@temptwo
\luapersian@temptwo=\luapersian@tempthree % T := T + ((MY-1) div 400)
\divide\luapersian@temptwo by 400\relax
\advance\luapersian@temp by \luapersian@temptwo
\advance\luapersian@tempthree by -611 % Number of Kabise years
\luapersian@temptwo=\luapersian@tempthree % T := T - ((SY+10) div 33) * 8
\divide\luapersian@temptwo by 33\relax
\multiply\luapersian@temptwo by 8\relax
\advance\luapersian@temp by -\luapersian@temptwo
\luapersian@temptwo=\luapersian@tempthree %
\divide\luapersian@temptwo by 33\relax
\multiply\luapersian@temptwo by 33\relax
\advance\luapersian@tempthree by -\luapersian@temptwo
\ifnum\luapersian@tempthree=32\advance\luapersian@temp by 1\fi % if (SY+10) mod 33=32 then Inc(T);
\divide\luapersian@tempthree by 4\relax % T := T - ((SY+10) mod 33) div 4
\advance\luapersian@temp by -\luapersian@tempthree
\advance\luapersian@temp by -137 % T := T - 137 Adjust the value
\luapersian@persiani=31
\advance\luapersian@persiani by -\luapersian@temp % now 31 - T is the persiani
\luapersian@persianii = 30\relax
\ifluapersian@kabiseh
\luapersian@persianiii = 30\relax
\else
\luapersian@persianiii = 29\relax
\fi
\luapersian@persianiv = 31\relax
\luapersian@persianv = 31\relax
\luapersian@persianvi = 31\relax
\luapersian@persianvii = 31\relax
\luapersian@persianviii= 31\relax
\luapersian@persianix = 31\relax
\luapersian@persianx = 30\relax
\luapersian@persianxi = 30\relax
\luapersian@persianxii = 30\relax
\luapersian@persianxiii= 30\relax
\luapersian@dn= 0\relax
\luapersian@sn= 0\relax
\luapersian@mminusone=\luapersian@m
\advance\luapersian@mminusone by -1\relax
\luapersian@i=0\relax
\ifnum\luapersian@i < \luapersian@mminusone
\loop
\advance \luapersian@i by 1\relax
\advance\luapersian@dn by \csname luapersian@latin\romannumeral\the\luapersian@i\endcsname
\ifnum\luapersian@i<\luapersian@mminusone \repeat
\fi
\advance \luapersian@dn by \luapersian@d
\luapersian@i=1\relax
\luapersian@sn = \luapersian@persiani
\ifnum \luapersian@sn<\luapersian@dn
\loop
\advance \luapersian@i by 1\relax
\advance\luapersian@sn by \csname luapersian@persian\romannumeral\the\luapersian@i\endcsname
\ifnum \luapersian@sn<\luapersian@dn \repeat
\fi
\ifnum \luapersian@i < 4
\luapersian@m = 9 \advance\luapersian@m by \luapersian@i
\advance \luapersian@y by -622\relax
\else
\luapersian@m = \luapersian@i \advance \luapersian@m by -3\relax
\advance \luapersian@y by -621\relax
\fi
\advance\luapersian@sn by -\csname luapersian@persian\romannumeral\the\luapersian@i%
\endcsname
\ifnum\luapersian@i = 1
\luapersian@d = \luapersian@dn \advance \luapersian@d by 30 \advance\luapersian@d by -\luapersian@persiani
\else
\luapersian@d = \luapersian@dn \advance \luapersian@d by -\luapersian@sn
\fi
\bgroup\textdir TLT\number\luapersian@d\egroup\space%
\persianmonth{\luapersian@m}\space\bgroup\textdir TLT\number\luapersian@y\egroup%
}
\def\persianmonth#1{\ifcase#1\or فروردین\or
اردیبهشت\or
خرداد\or تیر\or
مرداد\or
شهریور\or مهر\or
آبان\or آذر\or
دی\or بهمن\or
اسفند\fi}
%%
%% Copyright © 2011 Vafa Khalighi <vafa018@gmail.com>
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%%
%% This work is “author-maintained” (as per LPPL maintenance status)
%% by Vafa Khalighi.
%%
%%
%%
%%
%% End of file `luapersian-persiancal.sty'.
|