aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.dtx
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-03-30 11:58:47 +0200
committerRobert Alessi <alessi@robertalessi.net>2016-03-30 11:58:47 +0200
commit4668233f36c49ea7a1306aa92b48b4711b7e1d95 (patch)
tree6b583437a5b50c5ff3cf4565b159ff7e8523be02 /arabluatex.dtx
parent004737dc9a7a87ba34813851748fb939b70188b5 (diff)
downloadarabluatex-4668233f36c49ea7a1306aa92b48b4711b7e1d95.tar.gz
Added sukūn above the taṭwīl in fullvoc for linguistics proposes; started cleaning up the code: we are getting close to the first public release.
Diffstat (limited to 'arabluatex.dtx')
-rw-r--r--arabluatex.dtx167
1 files changed, 136 insertions, 31 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 537cef4..c4e6388 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -116,7 +116,13 @@
116% \changes{1.0}{2016/03/29}{Initial release} 116% \changes{1.0}{2016/03/29}{Initial release}
117% 117%
118% \DoNotIndex{\newcommand,\newenvironment,\renewcommand} 118% \DoNotIndex{\newcommand,\newenvironment,\renewcommand}
119% 119% \DoNotIndex{\~,\AtBeginDocument,\bgroup,\csname}
120% \DoNotIndex{\DeclareDocumentCommand,\def,\edef,\egroup}
121% \DoNotIndex{\else,\endcsname,\endinput,\expandafter,\fi}
122% \DoNotIndex{\ifdef,\ifdefined,\ifx,\MessageBreak,\NeedsTeXFormat}
123% \DoNotIndex{\NewDocumentCommand,\newif,\PackageError,\PackageWarning}
124% \DoNotIndex{\relax,\RenewDocumentCommand,\string}
125%
120% \providecommand*{\url}{\texttt} 126% \providecommand*{\url}{\texttt}
121% \GetFileInfo{arabluatex.dtx} 127% \GetFileInfo{arabluatex.dtx}
122% 128%
@@ -149,8 +155,12 @@
149% writing. \package{arabluatex} is able to process any Arab\TeX\ 155% writing. \package{arabluatex} is able to process any Arab\TeX\
150% input notation. Its output can be set in the same modes of 156% input notation. Its output can be set in the same modes of
151% vocalization as Arab\TeX, or in different roman 157% vocalization as Arab\TeX, or in different roman
152% transliterations. It further allows some typographical 158% transliterations. It further allows many typographical
153% refinements. 159% refinements. It will eventually interact with some other packages
160% yet to come to produce from \verb|.tex| source files, in addition
161% to printed books, \texttt{TEI xml} compliant critical editions
162% and/or lexicons that can be searched, analyzed and correlated in
163% various ways.
154% \end{abstract} 164% \end{abstract}
155% 165%
156% \section*{License and disclamer} 166% \section*{License and disclamer}
@@ -161,7 +171,6 @@
161% {\texttt{alessi@{\allowbreak}robertalessi.net}}> 171% {\texttt{alessi@{\allowbreak}robertalessi.net}}>
162% \item website: \url{http://www.robertalessi.net/arabluatex} 172% \item website: \url{http://www.robertalessi.net/arabluatex}
163% \end{compactitem} 173% \end{compactitem}
164%
165% 174%
166% This program is free software; you can redistribute it and/or 175% This program is free software; you can redistribute it and/or
167% modify it under the terms of the GNU General Public License 176% modify it under the terms of the GNU General Public License
@@ -177,7 +186,20 @@
177% along with this program; if not, write to the Free Software 186% along with this program; if not, write to the Free Software
178% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 187% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
179% 02111-1307, USA. 188% 02111-1307, USA.
180% 189%
190% This release of \package{arabluatex} consists of the following
191% source files:
192% \begin{compactitem}
193% \item |arabluatex.ins|
194% \item |arabluatex.dtx|
195% \item |arabluatex.lua|
196% \item |arabluatex_voc.lua|
197% \item |arabluatex_fullvoc.lua|
198% \item |arabluatex_novoc.lua|
199% \item |arabluatex_trans.lua|
200% \item |arabluatex.bib|
201% \end{compactitem}
202%
181% \section{Introduction} 203% \section{Introduction}
182% In comparison to Prof. Lagally's outstanding Arab\TeX,\footnote{See 204% In comparison to Prof. Lagally's outstanding Arab\TeX,\footnote{See
183% \url{http://ctan.org/pkg/arabtex}} Arab\LuaTeX\ is at present 205% \url{http://ctan.org/pkg/arabtex}} Arab\LuaTeX\ is at present
@@ -227,6 +249,7 @@
227% transliterated into whichever romanization standard the user may 249% transliterated into whichever romanization standard the user may
228% choose. 250% choose.
229% 251%
252% \label{ref:tei-to-come}
230% But there may be more to be said on this point, as encoding Arabic 253% But there may be more to be said on this point, as encoding Arabic
231% also naturally encourages the coder to vocalize the texts---without 254% also naturally encourages the coder to vocalize the texts---without
232% compelling him to do so, of course. Accurate coding may even have 255% compelling him to do so, of course. Accurate coding may even have
@@ -248,12 +271,13 @@
248% \LuaLaTeX. \TeX\ and \LaTeX\ have \package{arabtex}, and \XeLaTeX\ 271% \LuaLaTeX. \TeX\ and \LaTeX\ have \package{arabtex}, and \XeLaTeX\
249% has \package{arabxetex}. Both of them are much more advanced than 272% has \package{arabxetex}. Both of them are much more advanced than
250% \package{arabluatex}, as they can process a number of different 273% \package{arabluatex}, as they can process a number of different
251% languages,\footnote{To date, both packages support Arabic, Maghribi, 274% languages,\footnote{\label{fn:arabtex-languages}To date, both
252% Urdu, Pashto, Sindhi, Kashmiri, Uighuric and Old Malay; in addition 275% packages support Arabic, Maghribi, Urdu, Pashto, Sindhi, Kashmiri,
253% to these, \package{arabtex} also has a Hebrew mode, including 276% Uighuric and Old Malay; in addition to these, \package{arabtex} also
254% Judeo-Arabic and Yiddish.} whereas \package{arabluatex} can process 277% has a Hebrew mode, including Judeo-Arabic and Yiddish.} whereas
255% only Arabic for the time being. More languages will be included in 278% \package{arabluatex} can process only Arabic for the time
256% future releases of \package{arabluatex}. 279% being. More languages will be included in future releases of
280% \package{arabluatex}.
257% 281%
258% In comparison to \package{arabxetex}, \package{arabluatex} works in 282% In comparison to \package{arabxetex}, \package{arabluatex} works in
259% a very different way. The former relies on the 283% a very different way. The former relies on the
@@ -847,7 +871,7 @@ consonants, though three of them are also used as vowels
847% always follows a vowelless consonant which is passed over in 871% always follows a vowelless consonant which is passed over in
848% pronunciation and assimilated to a following consonant. It may be 872% pronunciation and assimilated to a following consonant. It may be
849% found \parencite[i. 15 B--16 C]{Wright}:--- 873% found \parencite[i. 15 B--16 C]{Wright}:---
850% \begin{enumerate}[(a)] 874% \begin{compactenum}[(a)]
851% \item With the \emph{solar} letters \arb[novoc]{t}, \arb[novoc]{_t}, 875% \item With the \emph{solar} letters \arb[novoc]{t}, \arb[novoc]{_t},
852% \arb[novoc]{d}, \arb[novoc]{_d}, \arb[novoc]{r}, \arb[novoc]{z}, 876% \arb[novoc]{d}, \arb[novoc]{_d}, \arb[novoc]{r}, \arb[novoc]{z},
853% \arb[novoc]{s}, \arb[novoc]{^s}, \arb[novoc]{.s}, \arb[novoc]{.d}, 877% \arb[novoc]{s}, \arb[novoc]{^s}, \arb[novoc]{.s}, \arb[novoc]{.d},
@@ -895,7 +919,7 @@ consonants, though three of them are also used as vowels
895% \arb[voc]{labi_ttu} \arb[trans]{labi_ttu}, will be discarded here, 919% \arb[voc]{labi_ttu} \arb[trans]{labi_ttu}, will be discarded here,
896% as it is largely condemned by the 920% as it is largely condemned by the
897% grammarians \parencite[see][i. 16 B--C]{Wright}. 921% grammarians \parencite[see][i. 16 B--C]{Wright}.
898% \end{enumerate} 922% \end{compactenum}
899% 923%
900% \paragraph{The definite article and the \arb[trans]{'alifu 'l-wa.sli}} 924% \paragraph{The definite article and the \arb[trans]{'alifu 'l-wa.sli}}
901% At the beginning of a sentence, \txarb{\char"0671} is never written, 925% At the beginning of a sentence, \txarb{\char"0671} is never written,
@@ -913,7 +937,7 @@ consonants, though three of them are also used as vowels
913% doing this automatically provided that the vowel which is to be 937% doing this automatically provided that the vowel which is to be
914% absorbed by the final vowel of the preceding word is properly 938% absorbed by the final vowel of the preceding word is properly
915% encoded, like so:--- 939% encoded, like so:---
916% \begin{enumerate}[(a)] 940% \begin{compactenum}[(a)]
917% \item Definite article at the beginning of a sentence is encoded\\ 941% \item Definite article at the beginning of a sentence is encoded\\
918% \arabluaverb{al-}, or \arabluaverb{a<solar letter>-}\\ if one 942% \arabluaverb{al-}, or \arabluaverb{a<solar letter>-}\\ if one
919% wishes to mark the assimilation---which is in no way required, as 943% wishes to mark the assimilation---which is in no way required, as
@@ -923,7 +947,7 @@ consonants, though three of them are also used as vowels
923% \item In all remaining cases of elision, the \arb[trans]{'alifu 947% \item In all remaining cases of elision, the \arb[trans]{'alifu
924% 'l-wa.sli} is expressed by the vowel that accompanies the omitted 948% 'l-wa.sli} is expressed by the vowel that accompanies the omitted
925% \arb[trans]{hamzaT}: \meta{u, a, i}. 949% \arb[trans]{hamzaT}: \meta{u, a, i}.
926% \end{enumerate} 950% \end{compactenum}
927% \begin{quote} 951% \begin{quote}
928% \textbf{Article}: |bAbu| |'l-madrasaTi| \arb[fullvoc]{bAbu 952% \textbf{Article}: |bAbu| |'l-madrasaTi| \arb[fullvoc]{bAbu
929% 'l-madrasaTi} \arb[trans]{bAbu 'l-madrasaTi}, |al-maqAlaTu| 953% 'l-madrasaTi} \arb[trans]{bAbu 'l-madrasaTi}, |al-maqAlaTu|
@@ -940,7 +964,7 @@ consonants, though three of them are also used as vowels
940% \arb[trans]{fa-lammA ra'aW 'l-najma}. 964% \arb[trans]{fa-lammA ra'aW 'l-najma}.
941% 965%
942% \textbf{Particles}:--- 966% \textbf{Particles}:---
943% \begin{enumerate}[(a)] 967% \begin{compactenum}[(a)]
944% \item \arb[trans]{li-}: \arb[trans]{'alifu 'l-wa.sli} is omitted 968% \item \arb[trans]{li-}: \arb[trans]{'alifu 'l-wa.sli} is omitted
945% in the article \arb[fullvoc]{al} when it is preceded by the 969% in the article \arb[fullvoc]{al} when it is preceded by the
946% preposition \arb[fullvoc]{li}: |li-l-rajuli| 970% preposition \arb[fullvoc]{li}: |li-l-rajuli|
@@ -960,7 +984,7 @@ consonants, though three of them are also used as vowels
960% |bi-'l-qalami| \arb[fullvoc]{bi-'l-qalami} 984% |bi-'l-qalami| \arb[fullvoc]{bi-'l-qalami}
961% \arb[trans]{bi-'l-qalami}, |bi-'l-ru`bi| 985% \arb[trans]{bi-'l-qalami}, |bi-'l-ru`bi|
962% \arb[fullvoc]{bi-'l-ru`bi} \arb[trans]{bi-'l-ru`bi}. 986% \arb[fullvoc]{bi-'l-ru`bi} \arb[trans]{bi-'l-ru`bi}.
963% \end{enumerate} 987% \end{compactenum}
964% 988%
965% \textbf{Perfect active, imperative, nomen actionis}: |qAla| 989% \textbf{Perfect active, imperative, nomen actionis}: |qAla|
966% |isma`| \arb[fullvoc]{qAla isma`} \arb[trans]{qAla isma`}, |qAla| 990% |isma`| \arb[fullvoc]{qAla isma`} \arb[trans]{qAla isma`}, |qAla|
@@ -1159,7 +1183,7 @@ consonants, though three of them are also used as vowels
1159% 1183%
1160% \paragraph{\texttt{novoc}} In this mode, \enquote{quoting} 1184% \paragraph{\texttt{novoc}} In this mode, \enquote{quoting}
1161% essentially means make visible something that ought not to be so. 1185% essentially means make visible something that ought not to be so.
1162% \begin{enumerate}[(a)] 1186% \begin{compactenum}[(a)]
1163% \item Quoting a vowel, either short or long, makes the 1187% \item Quoting a vowel, either short or long, makes the
1164% \arb[trans]{.dammaT}, \arb[trans]{fat.haT} or \arb[trans]{kasraT} 1188% \arb[trans]{.dammaT}, \arb[trans]{fat.haT} or \arb[trans]{kasraT}
1165% appear above the appropriate consonant:--- 1189% appear above the appropriate consonant:---
@@ -1193,13 +1217,13 @@ consonants, though three of them are also used as vowels
1193% "inhazama} \arb[trans]{huwa "inhazama}, |al-"intiqA.du| 1217% "inhazama} \arb[trans]{huwa "inhazama}, |al-"intiqA.du|
1194% \arb[novoc]{al-"intiqA.du} \arb[trans]{al-"intiqA.du}. 1218% \arb[novoc]{al-"intiqA.du} \arb[trans]{al-"intiqA.du}.
1195% \end{quote} 1219% \end{quote}
1196% \end{enumerate} 1220% \end{compactenum}
1197% 1221%
1198% \paragraph{\texttt{voc}} 1222% \paragraph{\texttt{voc}}
1199% In accordance with the general rule, in this mode, \enquote{quoting} 1223% In accordance with the general rule, in this mode, \enquote{quoting}
1200% makes the vowels and the \arb[trans]{tanwIn} disappear, should this 1224% makes the vowels and the \arb[trans]{tanwIn} disappear, should this
1201% feature be required for some reason:--- 1225% feature be required for some reason:---
1202% \begin{enumerate}[(a)] 1226% \begin{compactenum}[(a)]
1203% \item Short and long vowels:--- 1227% \item Short and long vowels:---
1204% \begin{quote} 1228% \begin{quote}
1205% |q"Ala q"A'iluN| \arb[voc]{q"Ala q"A'iluN} \arb[trans]{q"Ala 1229% |q"Ala q"A'iluN| \arb[voc]{q"Ala q"A'iluN} \arb[trans]{q"Ala
@@ -1214,12 +1238,12 @@ consonants, though three of them are also used as vowels
1214% \arb[voc]{hud"aN_A} \arb[trans]{hud"aN_A}, |^say'"iN| 1238% \arb[voc]{hud"aN_A} \arb[trans]{hud"aN_A}, |^say'"iN|
1215% \arb[voc]{^say'"iN} \arb[trans]{^say'"iN}. 1239% \arb[voc]{^say'"iN} \arb[trans]{^say'"iN}.
1216% \end{quote} 1240% \end{quote}
1217% \end{enumerate} 1241% \end{compactenum}
1218% One may more usefully \enquote{quote} the initial vowels to write 1242% One may more usefully \enquote{quote} the initial vowels to write
1219% the \arb[trans]{hamzaT} above the \arb[trans]{'alif} or insert a 1243% the \arb[trans]{hamzaT} above the \arb[trans]{'alif} or insert a
1220% straight double quote after a consonant not followed by a vowel to 1244% straight double quote after a consonant not followed by a vowel to
1221% make the \arb[trans]{sukUn} appear:--- 1245% make the \arb[trans]{sukUn} appear:---
1222% \begin{enumerate}[(a)] 1246% \begin{compactenum}[(a)]
1223% \item \arb[trans]{'alifu 'l-wa.sli}:--- 1247% \item \arb[trans]{'alifu 'l-wa.sli}:---
1224% \begin{quote} 1248% \begin{quote}
1225% |fI "istisqA'a| \arb[voc]{fI "istisqA'a} \arb[trans]{fI 1249% |fI "istisqA'a| \arb[voc]{fI "istisqA'a} \arb[trans]{fI
@@ -1238,7 +1262,7 @@ consonants, though three of them are also used as vowels
1238% \arb[trans]{kam" qad" ma.dat" min" 1262% \arb[trans]{kam" qad" ma.dat" min"
1239% laylaTiN}.\label{ref:quoted-sukun-e} 1263% laylaTiN}.\label{ref:quoted-sukun-e}
1240% \end{quote} 1264% \end{quote}
1241% \end{enumerate} 1265% \end{compactenum}
1242% 1266%
1243% \paragraph{\texttt{fullvoc}} 1267% \paragraph{\texttt{fullvoc}}
1244% In this mode, \enquote{quoting} may be used to take away any short 1268% In this mode, \enquote{quoting} may be used to take away any short
@@ -1329,7 +1353,7 @@ consonants, though three of them are also used as vowels
1329% (\cpageref{ref:necessary-tashdid}) from being applied. 1353% (\cpageref{ref:necessary-tashdid}) from being applied.
1330% 1354%
1331% \subsection{\texorpdfstring{Stretching characters: the 1355% \subsection{\texorpdfstring{Stretching characters: the
1332% \arb[trans]{.ta.twIl}}{Stretching characters: the aṭwīl}} 1356% \arb[trans]{ta.twIl}}{Stretching characters: the taṭwīl}}
1333% \label{sec:tatwil} 1357% \label{sec:tatwil}
1334% A double hyphen \meta{-\,-} stretches the ligature in which one 1358% A double hyphen \meta{-\,-} stretches the ligature in which one
1335% letter is bound to another. Although it is always better to rely on 1359% letter is bound to another. Although it is always better to rely on
@@ -1339,8 +1363,7 @@ consonants, though three of them are also used as vowels
1339% \begin{quote} 1363% \begin{quote}
1340% |.hunaynu| |bnu| |'is.h--_aqa| \arb[voc]{.hunaynu bnu 'is.h--_aqa} 1364% |.hunaynu| |bnu| |'is.h--_aqa| \arb[voc]{.hunaynu bnu 'is.h--_aqa}
1341% \arb[trans]{\cap{.hunaynu} bnu \cap{'is.h--_aqa}} 1365% \arb[trans]{\cap{.hunaynu} bnu \cap{'is.h--_aqa}}
1342% \end{quote} 1366% \end{quote}
1343%
1344% 1367%
1345% \subsection{Digits} 1368% \subsection{Digits}
1346% \label{sec:digits} 1369% \label{sec:digits}
@@ -1400,7 +1423,7 @@ consonants, though three of them are also used as vowels
1400% \fi 1423% \fi
1401% 1424%
1402% \subsection{Additional characters} 1425% \subsection{Additional characters}
1403% \label{sec:additional-letters} 1426% \label{sec:additional-characters}
1404% In the manuscripts, the unpointed letters, \arb[trans]{al-.hurUfu 1427% In the manuscripts, the unpointed letters, \arb[trans]{al-.hurUfu
1405% 'l-muhmalaTu}, are sometimes further distinguished from the pointed 1428% 'l-muhmalaTu}, are sometimes further distinguished from the pointed
1406% by various contrivances, as explained in \textcite[i. 4 1429% by various contrivances, as explained in \textcite[i. 4
@@ -1459,6 +1482,20 @@ consonants, though three of them are also used as vowels
1459% \arb[trans]{45: kitAbu-hu fI 'l-\cap{`AdAti}}. 1482% \arb[trans]{45: kitAbu-hu fI 'l-\cap{`AdAti}}.
1460% \end{quote} 1483% \end{quote}
1461% 1484%
1485% \section{Special applications}
1486% \label{sec:special-applications}
1487% \paragraph{Linguistics}
1488% The same horizontal stroke as the \arb[trans]{ta.twIl} (see
1489% \vref{sec:tatwil}) may be encoded \meta{B}; \meta{BB} will receive
1490% the \arb[trans]{ta^sdId}. This is useful to make linguistic
1491% annotations and comments on vowels:---
1492% \begin{quote}
1493% |Bu| |Ba| |Bi| |BuN| |BaN| |BiN| \arb[voc]{Bu Ba Bi BuN BaN BiN}
1494% \arb[trans]{Bu Ba Bi BuN BaN BiN}, |BBu| |BBa| |BBi| \arb[voc]{BBu
1495% BBa BBi} \arb[trans]{BBu BBa BBi}, |B--aN| \arb[voc]{B--aN}
1496% \arb[trans]{B--aN}, |B| \arb[voc]{B"}\,.
1497% \end{quote}
1498%
1462% \section{Transliteration} 1499% \section{Transliteration}
1463% \label{sec:transliteration} 1500% \label{sec:transliteration}
1464% It may be more appropriate to speak of \enquote{romanization} than 1501% It may be more appropriate to speak of \enquote{romanization} than
@@ -1728,7 +1765,30 @@ wa-ya.sIru ta.hta 'l-jildi
1728% 1765%
1729% \section{Future work} 1766% \section{Future work}
1730% \label{sec:future-work} 1767% \label{sec:future-work}
1731% 1768% A short, uncommented, list of what is planned in the versions of
1769% \package{arabluatex} to come follows:
1770% \begin{compactenum}[(a)]
1771% \item Short-term:
1772% \begin{compactenum}[i.]
1773% \item Support for typesetting Arabic poetry.
1774% \item The \arb[trans]{\cap{qur'An}}: support for typesetting the
1775% \arb[trans]{\cap{Qur'An}}.
1776% \item \texttt{TEI xml} support: \package{arabluatex} will
1777% interoperate with \texttt{TEI xml} through new global and local
1778% options that will output Arabic in a \texttt{TEI xml} compliant
1779% file in addition to the usual PDF output: see
1780% \vpageref{ref:tei-to-come}.
1781% \end{compactenum}
1782% \item Medium-term:
1783% \begin{compactenum}[i.]
1784% \item More languages: the list of supported languages will
1785% eventually be the same as \package{arabtex}: see
1786% \vref{fn:arabtex-languages}.
1787% \item Formulate propositions for extending the Arab\TeX\ notation
1788% and the transliteration tables. Include them in
1789% \package{arabluatex}. See \vref{sec:additional-characters}.
1790% \end{compactenum}
1791% \end{compactenum}
1732% 1792%
1733% \StopEventually{} 1793% \StopEventually{}
1734% 1794%
@@ -1737,23 +1797,28 @@ wa-ya.sIru ta.hta 'l-jildi
1737% \iffalse 1797% \iffalse
1738%<*package> 1798%<*package>
1739% \fi 1799% \fi
1740% 1800%
1801% The most important part of \package{arabluatex} relies on Lua
1802% functions and tables. Read the |.lua| files that accompany
1803% \package{arabluatex} for more information.
1741% \begin{macrocode} 1804% \begin{macrocode}
1742\NeedsTeXFormat{LaTeX2e} 1805\NeedsTeXFormat{LaTeX2e}
1743\ProvidesPackage{arabluatex}% 1806\ProvidesPackage{arabluatex}%
1744[2016/03/29 v1.0 ArabTeX-like interface for LuaLaTeX] 1807[2016/03/29 v1.0 ArabTeX-like interface for LuaLaTeX]
1745\RequirePackage{ifluatex} 1808\RequirePackage{ifluatex}
1746% \end{macrocode} 1809% \end{macrocode}
1747% \package{arabluatex} requires \LuaLaTeX\ of course. 1810% \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning
1811% if the document is processed with another engine.
1748% \begin{macrocode} 1812% \begin{macrocode}
1749\ifluatex\else 1813\ifluatex\else
1750 \PackageError{arabluatex}{lualatex needed}{% 1814 \PackageError{arabluatex}{lualatex needed}{%
1751 Package `arabluatex' needs LuaTeX.\MessageBreak 1815 Package `arabluatex' needs LuaTeX.\MessageBreak
1752 So you should use `lualatex' to process your document!\MessageBreak 1816 So you should use `lualatex' to process your document.\MessageBreak
1753 See documentation of `arabluatex' for further information.}% 1817 See documentation of `arabluatex' for further information.}%
1754 \expandafter\expandafter\expandafter\csname endinput\endcsname 1818 \expandafter\expandafter\expandafter\csname endinput\endcsname
1755\fi 1819\fi
1756% \end{macrocode} 1820% \end{macrocode}
1821% Declare the global options, and define them:
1757% \begin{macrocode} 1822% \begin{macrocode}
1758\DeclareOption{voc}{\def\al@mode{voc}} 1823\DeclareOption{voc}{\def\al@mode{voc}}
1759\DeclareOption{fullvoc}{\def\al@mode{fullvoc}} 1824\DeclareOption{fullvoc}{\def\al@mode{fullvoc}}
@@ -1765,13 +1830,23 @@ wa-ya.sIru ta.hta 'l-jildi
1765\def\al@mode@fullvoc{fullvoc} 1830\def\al@mode@fullvoc{fullvoc}
1766\def\al@mode@novoc{novoc} 1831\def\al@mode@novoc{novoc}
1767\def\al@mode@trans{trans} 1832\def\al@mode@trans{trans}
1833% \end{macrocode}
1834% The following line will be used in the next release of
1835% \package{arabluatex}:
1836% \begin{macrocode}
1768% \newif\ifal@mode@defined 1837% \newif\ifal@mode@defined
1838% \end{macrocode}
1839% Packages that are required by \package{arabluatex}:
1840% \begin{macrocode}
1769\RequirePackage{fontspec} 1841\RequirePackage{fontspec}
1770\RequirePackage{amsmath} 1842\RequirePackage{amsmath}
1771\RequirePackage{etoolbox} 1843\RequirePackage{etoolbox}
1772\RequirePackage{luacode} 1844\RequirePackage{luacode}
1773\RequirePackage{xparse} 1845\RequirePackage{xparse}
1774\RequirePackage{environ} 1846\RequirePackage{environ}
1847% \end{macrocode}
1848% Here begins the real work: load |arabluatex.lua|:
1849% \begin{macrocode}
1775\luadirect{dofile(kpse.find_file("arabluatex.lua"))} 1850\luadirect{dofile(kpse.find_file("arabluatex.lua"))}
1776% \end{macrocode} 1851% \end{macrocode}
1777% This is needed by the current versions of \package{polyglossia} and 1852% This is needed by the current versions of \package{polyglossia} and
@@ -1780,22 +1855,52 @@ wa-ya.sIru ta.hta 'l-jildi
1780% \begin{macrocode} 1855% \begin{macrocode}
1781\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))} 1856\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))}
1782% \end{macrocode} 1857% \end{macrocode}
1858% Font setup. If no Arabic font is selected, issue a warning message
1859% and attempt to load the Amiri font which is included in \TeX{}live:
1783% \begin{macrocode} 1860% \begin{macrocode}
1784\AtBeginDocument{\ifdefined\arabicfont\relax\else 1861\AtBeginDocument{\ifdefined\arabicfont\relax\else
1785\PackageWarning{arabluatex}{\string\arabicfont\ is not defined!^^JI 1862\PackageWarning{arabluatex}{\string\arabicfont\ is not defined!^^JI
1786 will try to load Amiri}% 1863 will try to load Amiri}%
1787\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}% 1864\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}%
1865% \end{macrocode}
1866% \begin{macro}{\setRL}
1867% This neutralizes what is defined by the same command in
1868% \package{luabidi}:
1869% \begin{macrocode}
1788\AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}} 1870\AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}}
1871% \end{macrocode}
1872% \end{macro}
1873% \begin{macro}{\setLR}
1874% The same applies to \cs{setLR}:
1875% \begin{macrocode}
1789\AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}} 1876\AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}}
1877% \end{macrocode}
1878% \end{macro}
1879% \begin{macro}{\LR} This command typesets its argument from left to
1880% right. As \cs{LR} may be already defined, we need to redefine for
1881% it to suit our purpose:
1882% \begin{macrocode}
1790\AtBeginDocument{\ifdef{\LR}% 1883\AtBeginDocument{\ifdef{\LR}%
1791 {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} 1884 {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}
1792 {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} 1885 {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}}
1886% \end{macrocode}
1887% \end{macro}
1888% \begin{macro}{\RL} This one typesets its argument from right to
1889% left. Same remark as above regarding the need of redefinition.
1890% \begin{macrocode}
1793\AtBeginDocument{\ifdef{\RL}% 1891\AtBeginDocument{\ifdef{\RL}%
1794 {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} 1892 {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}}
1795 {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} 1893 {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}}
1894% \end{macrocode}
1895% \end{macro}
1896% \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as well.
1897% \begin{macrocode}
1796\AtBeginDocument{\ifdef{\aemph}% 1898\AtBeginDocument{\ifdef{\aemph}%
1797 {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}} 1899 {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}
1798 {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}} 1900 {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}}
1901% \end{macrocode}
1902% \end{macro}
1903% \begin{macrocode}
1799\def\al@trans@style{\itshape}% 1904\def\al@trans@style{\itshape}%
1800\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}} 1905\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}}
1801\def\al@trans@convention{dmg} 1906\def\al@trans@convention{dmg}