aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.dtx')
-rw-r--r--arabluatex.dtx134
1 files changed, 95 insertions, 39 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 435e905..d0fe36f 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -149,36 +149,95 @@
149% \url{http://ctan.org/pkg/arabtex}} Arab\LuaTeX\ is at present 149% \url{http://ctan.org/pkg/arabtex}} Arab\LuaTeX\ is at present
150% nothing more than a modest piece of software. Hopefully---if I may 150% nothing more than a modest piece of software. Hopefully---if I may
151% say so---it will eventually provide all of its valuable qualities to 151% say so---it will eventually provide all of its valuable qualities to
152% the \LuaLaTeX\ users. \package{arabtex} dates back to 1992. As far 152% the \LuaLaTeX\ users.
153% as I know, it was then the first and only way to typeset Arabic 153%
154% texts with \TeX\ and \LaTeX. To achieve this, \package{arabtex} 154% \package{arabtex} dates back to 1992. As far as I know, it was then
155% provided---and still does---an Arabic font in \emph{Nasḫī} style and 155% the first and only way to typeset Arabic texts with \TeX\ and
156% a macro package that defined its own input notation which was, as 156% \LaTeX. To achieve this, \package{arabtex} provided---and still
157% the author stated, \enquote{both machine, and human, readable, and 157% does---an Arabic font in \emph{Nasḫī} style and a macro package that
158% suited for electronic transmission and e-mail 158% defined its own input notation which was, as the author stated,
159% communication}.\footcite[2]{Lagally2004} Even if the same can be 159% \enquote{both machine, and human, readable, and suited for
160% said about Unicode, Arab\TeX\ \textsc{ASCII} input notation still 160% electronic transmission and e-mail
161% surpasses Unicode input, in my opinion, when it comes to typesetting 161% communication}.\footnote{\textcite[2]{Lagally2004}.} Even if the
162% complex documents, such as scientific documents or critical editions 162% same can be said about Unicode, Arab\TeX\ \textsc{ASCII} input
163% where footnotes and other kind of annotations can be particulary 163% notation still surpasses Unicode input, in my opinion, when it comes
164% abundant. It must also be said that most text editors have trouble 164% to typesetting complex documents, such as scientific documents or
165% in displaying Arabic script connected with preceding or following 165% critical editions where footnotes and other kind of annotations can
166% \LaTeX\ commands: it often happens that commands seem misplaced, not 166% be particulary abundant. It must also be said that most text editors
167% to mention punctuation marks, or opening or closing braces, brackets 167% have trouble in displaying Arabic script connected with preceding or
168% or parentheses that are unexpectedly displayed in the wrong 168% following \LaTeX\ commands: it often happens that commands seem
169% direction. Of course, some text editors provide ways to get around 169% misplaced, not to mention punctuation marks, or opening or closing
170% such difficulties by inserting invisible Unicode characters, such as 170% braces, brackets or parentheses that are unexpectedly displayed in
171% LEFT-TO-RIGHT or RIGHT-TO-LEFT MARKS (\texttt{U+200E}, 171% the wrong direction. Of course, some text editors provide ways to
172% \texttt{U+200F}), RTL/LTR \enquote{embed} characters 172% get around such difficulties by inserting invisible Unicode
173% (\texttt{U+202B}, \texttt{U+202A}) and RLO/LRO 173% characters, such as LEFT-TO-RIGHT or RIGHT-TO-LEFT MARKS
174% (\texttt{U+200E}, \texttt{U+200F}), RTL/LTR \enquote{embed}
175% characters (\texttt{U+202B}, \texttt{U+202A}) and RLO/LRO
174% \enquote{bidi-override} characters (\texttt{U+202E}, 176% \enquote{bidi-override} characters (\texttt{U+202E},
175% \texttt{U+202D}).\footnote{Yudit probably has the best Unicode 177% \texttt{U+202D}).\footnote{Gáspár Sinai's Yudit probably has the
176% support. See \url{www.yudit.org}.} Nonetheless, it remains that 178% best Unicode support. See \url{www.yudit.org}.} Nonetheless, it
177% inserting all the time these invisible characters in complex 179% remains that inserting all the time these invisible characters in
178% documents rapidly becomes confusing and cumbersome. 180% complex documents rapidly becomes confusing and cumbersome.
181%
182% The great advantage of Arab\TeX\ notation is that it is immune from
183% all these difficulties, let alone its being clear and
184% straightforward. One also must remember that computers are designed
185% to process code. Arab\TeX\ notation is a way of encoding Arabic
186% language, just as \TeX\ \enquote{mathematics mode} is a way of
187% processing code to display mathematics. As such, not only does it
188% allow greater control over typographical features, but it also can
189% be processed in several different ways: so without going into
190% details, depending on one's wishes, Arab\TeX\ input can be full
191% vocalized Arabic (\emph{scriptio plena}), vocalized Arabic or
192% non-vocalized Arabic (\emph{scriptio defectiva}); it further can be
193% transliterated into whichever romanization standard the user may
194% choose.
195%
196% But there may be more to be said on this point, as encoding Arabic
197% also naturally encourages the coder to vocalize the texts---without
198% compelling him to do so, of course. Accurate coding may even have
199% other virtuous effects. For instance, hyphens may be used for tying
200% particles or prefixes to words, or to mark inflectional endings, and
201% so forth. In other words, accurate coding produces accurate texts
202% that can stand to close grammatical scrutiny and to complex textual
203% searches as well.
204%
205% Having that in mind, I started \package{arabluatex}. With the help
206% of Lua, it will eventually interact with some other packages yet to
207% come to produce from \verb|.tex| source files, in addition to
208% printed books, \texttt{TEI xml} compliant critical editions and/or
209% lexicons that can be searched, analyzed and correlated in various
210% ways.
211%
212%
213%\subsection{\package{arabluatex} is for \LuaLaTeX}
214% It goes without saying that \package{arabluatex} requires
215% \LuaLaTeX. \TeX\ and \LaTeX\ have \package{arabtex}, and \XeLaTeX\
216% has \package{arabxetex}. Both of them are much more advanced than
217% \package{arabluatex}, as they can process a number of different
218% languages,\footnote{To date, both packages support Arabic, Maghribi,
219% Urdu, Pashto, Sindhi, Kashmiri, Uighuric and Old Malay; in addition
220% to these, \package{arabtex} also has a Hebrew mode, including
221% Judeo-Arabic and Yiddish.} whereas \package{arabluatex} can process
222% only Arabic for the time being. More languages will be included in
223% future releases of \package{arabluatex}.
224%
225% In comparison to \package{arabxetex}, \package{arabluatex} works in
226% a very different way. The former relies on the
227% \href{http://scripts.sil.org/TECkitIntro}{\texttt{TECkit}} engine
228% which converts Arab\TeX\ input on the fly into Unicode Arabic
229% script, whereas the latter passes Arab\TeX\ input on to a set of Lua
230% functions. At first, \LaTeX\ commands are taken care of in different
231% ways: some, as \cs{emph}, \cs{textbf} and the like are expected to
232% have Arabic text as arguments, while others, as \cs{LR}, for
233% \enquote{left-to-right text}, are not. Then, once what is Arabic is
234% carefully separated form what is not, it is processed by other Lua
235% functions which rely on different sets of correpondence tables to do
236% the actual conversion in accordance with one's wishes. Finally, Lua
237% returns to \TeX\ the converted strings---which may in turn contain
238% some other Arab\TeX\ input yet to be processed---for further
239% processing.
179% 240%
180%
181%
182% \section{Usage} 241% \section{Usage}
183% \newcommand{\dmg}[1]{% 242% \newcommand{\dmg}[1]{%
184% \SetTranslitConvention{dmg}% 243% \SetTranslitConvention{dmg}%
@@ -192,13 +251,16 @@
192% & Arab\TeX\ notation \\ 251% & Arab\TeX\ notation \\
193% & \texttt{dmg} & \texttt{loc} & \\ \midrule 252% & \texttt{dmg} & \texttt{loc} & \\ \midrule
194% \endhead \footnotetext{See below **} 253% \endhead \footnotetext{See below **}
195% \arb[novoc]{a} & \dmg{A} & \loc{A} & \verb|a| \\ 254% \arb[novoc]{a} & \dmg{A} & \loc{A} & \verb|A| \\
196% \arb[novoc]{b} & \dmg{b} & \loc{b} & \verb|b| \\ 255% \arb[novoc]{b} & \dmg{b} & \loc{b} & \verb|b| \\
197% \arb[novoc]{t} & \dmg{t} & \loc{t} & \verb|t| \\ 256% \arb[novoc]{t} & \dmg{t} & \loc{t} & \verb|t| \\
198% \arb[novoc]{_t} & \dmg{_t} & \loc{_t} & \verb|_t| \\ 257% \arb[novoc]{_t} & \dmg{_t} & \loc{_t} & \verb|_t| \\
199% \arb[novoc]{j} & \dmg{j} & \loc{j} & \verb|^g| or \verb|j| \\ 258% \arb[novoc]{j} & \dmg{j} & \loc{j} & \verb|^g| or \verb|j| \\
200% \arb[novoc]{.h} & \dmg{.h} & \loc{.h} & \verb|.h| \\ 259% \arb[novoc]{.h} & \dmg{.h} & \loc{.h} & \verb|.h| \\
201% \arb[novoc]{x} & \dmg{x} & \loc{x} & \verb|_h| or \verb|x|\\ 260% \arb[novoc]{x} & \dmg{x} & \loc{x} & \verb|_h| or \verb|x|\\
261% \arb[novoc]{d} & \dmg{d} & \loc{d} & \verb|d| \\
262% \arb[novoc]{_d} & \dmg{_d} & \loc{_d} & \verb|_d| \\
263% \arb[novoc]{r} & \dmg{r} & \loc{r} & \verb|r| \\
202% \bottomrule 264% \bottomrule
203% \caption{Standard notation for Arabic} 265% \caption{Standard notation for Arabic}
204% \end{longtable} 266% \end{longtable}
@@ -221,10 +283,10 @@
221% \package{arabluatex} requires \LuaLaTeX\ of course. 283% \package{arabluatex} requires \LuaLaTeX\ of course.
222% \begin{macrocode} 284% \begin{macrocode}
223\ifluatex\else 285\ifluatex\else
224 \PackageError{arabluatex}{lualatex needed}{% 286 \PackageError{arabluatex}{lualatex needed}{%
225 Package `arabluatex' needs LuaTeX.\MessageBreak 287 Package `arabluatex' needs LuaTeX.\MessageBreak
226 So you should use `lualatex' to process you document!\MessageBreak 288 So you should use `lualatex' to process your document!\MessageBreak
227 See documentation of `arabluatex' for further information.}% 289 See documentation of `arabluatex' for further information.}%
228 \expandafter\expandafter\expandafter\csname endinput\endcsname 290 \expandafter\expandafter\expandafter\csname endinput\endcsname
229\fi 291\fi
230% \end{macrocode} 292% \end{macrocode}
@@ -319,17 +381,11 @@
319 \luastringO{\al@trans@convention}))}\egroup% 381 \luastringO{\al@trans@convention}))}\egroup%
320 \else 382 \else
321 \fi\fi\fi\fi}[\par] 383 \fi\fi\fi\fi}[\par]
322% \robustify{\textbf}
323% \robustify{\emph}
324% \robustify{\footnote}
325% \robustify{\marginpar}
326\DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}} 384\DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}}
327\RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir 385\RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir
328 TLT\arabic{footnote}\egroup} 386 TLT\arabic{footnote}\egroup}
329\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir 387\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir
330 TLT\LR{\footnote{#1}}\egroup} 388 TLT\LR{\footnote{#1}}\egroup}
331% \AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}}
332% \AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}}
333\endinput 389\endinput
334% \end{macrocode} 390% \end{macrocode}
335% 391%