summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/quran/tex/quran-transfr.def
blob: 4e970e342989f19aae90a6fc379c14ae33ad444c (plain)
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
%% This is file `quran-transfr.def',
%% 
%% Copyright © 2015-2020 
%% Seiied-Mohammad-Javad Razavian <javadr@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%% 
%% This work is “author-maintained” (as per LPPL maintenance status).
%% 
%% The Current Maintainer of this work is Seiied-Mohammad-Javad Razavian.
%% 
%% to one who has devoted his life to Quran
%%
\let\qt@doqt@orig\qt@doqt%
\let\ToggleBasmalah@orig\ToggleBasmalah%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\basmalahfr{Au nom d'Allah, le Tout Miséricordieux, le Très Miséricordieux.\qt@par\space}%
\bidi@newrobustcmd\ToggleBasmalahfr{%
  \ifx\basmalahfr\relax%
    \def\basmalahfr{Au nom d'Allah, le Tout Miséricordieux, le Très Miséricordieux.\qt@par\space}%
  \else%
    \let\basmalahfr\relax%
  \fi%
}%
\def\Basmalahfr{%
        \begingroup%
        \let\par\relax%
        \def\qt@no##1{\relax}%
        \quranayahfr[1][1][1]%
        \endgroup%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand\qt@dofr{ o o }{%
    \addtocounter{qt@count}{1}%
    \def\@qtexp{}%
    \loop%
        \global\xdef\@qtexp{\@qtexp\csname qurantrans@fr@\roman{qt@count}\endcsname\ifnum\value{qt@count}=\qt@max\else\space\fi\qt@par}%
        \ifnum\value{qt@count}<\qt@max\relax%
        \addtocounter{qt@count}{1}%
    \repeat%
    \IfNoValueTF{#1}%
    {\@qtexp}%true
    {\qt@WordCount=0\relax\c@qt@start=\numexpr#1-1\relax%
    \readlist*\qt@words{\@qtexp}%
        \IfNoValueTF{#2}%
        {\c@qt@end=\numexpr\qt@wordslen+1\relax}{\c@qt@end=\numexpr#2+1\relax}%
        \foreachitem\qt@word\in\qt@words{%
            \ifnum\qt@wordcnt>\c@qt@start\ifnum\qt@wordcnt<\c@qt@end\qt@word\ifnum\qt@wordcnt=\numexpr\c@qt@end-1\relax\else\xspace\fi\fi\fi%
        }%
        \qt@showitems{\ifdefined\arabicfont\arabicfont\fi\showitems\qt@words}%
    }%false
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\qurantextfr}{ s O{\qt@default} o t{+} }{%
    \IfBooleanTF{#4}{\def\qt@showitems##1{\footnote{##1}}}{\def\qt@showitems##1{\relax}}%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\IfBooleanTF{#4}{\qurantext*[#2][#3]+}{\qurantext*[#2][#3]}}%
    {\IfBooleanTF{#4}{\qurantext[#2][#3]+}{\qurantext[#2][#3]}}%
    \let\qt@doqt\qt@doqt@orig% 
    \def\qt@showitems##1{\relax}%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand\quransurahfr{ s O{\qt@surah@default} }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quransurah*[#2]}%
    {\quransurah[#2]}%
    \let\qt@doqt\qt@doqt@orig%        
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranayahfr}{ s o o o t{+} }{%
    \let\qt@doqt\qt@dofr%
    \let\ToggleBasmalah\ToggleBasmalahfr%
    \IfBooleanTF{#1}%
    {\IfBooleanTF{#5}{\quranayah*[#2][#3][#4]+}{\quranayah*[#2][#3][#4]}}%
    {\IfBooleanTF{#5}{\quranayah[#2][#3][#4]+}{\quranayah[#2][#3][#4]}}%    
    \let\qt@doqt\qt@doqt@orig%    
    \let\ToggleBasmalah\ToggleBasmalah@orig%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranjuzfr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranjuz*[#2]}%
    {\quranjuz[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranpagefr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranpage*[#2]}%
    {\quranpage[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranquarterfr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranquarter*[#2]}%
    {\quranquarter[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranrukufr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranruku*[#2]}%
    {\quranruku[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranhizbfr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranhizb*[#2]}%
    {\quranhizb[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareDocumentCommand{\quranmanzilfr}{ s o }{%
    \let\qt@doqt\qt@dofr%
    \IfBooleanTF{#1}%
    {\quranmanzil*[#2]}%
    {\quranmanzil[#2]}%        
    \let\qt@doqt\qt@doqt@orig%    
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%