aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.dtx')
-rw-r--r--arabluatex.dtx115
1 files changed, 61 insertions, 54 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index cad42c7..a885799 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -31,7 +31,7 @@
31%</package-info> 31%</package-info>
32% 32%
33%<*driver> 33%<*driver>
34\documentclass{cnltx-doc} 34\documentclass{ltxdoc}
35\usepackage[english]{babel} 35\usepackage[english]{babel}
36\usepackage[letterpaper, includemp, reversemp, hmargin=.8in, 36\usepackage[letterpaper, includemp, reversemp, hmargin=.8in,
37 marginpar=.8in]{geometry} 37 marginpar=.8in]{geometry}
@@ -42,7 +42,7 @@
42\setmonofont[Scale=.9]{Libertinus Mono} 42\setmonofont[Scale=.9]{Libertinus Mono}
43\usepackage{arabluatex}[2016/01/26] 43\usepackage{arabluatex}[2016/01/26]
44\usepackage{hypdoc} 44\usepackage{hypdoc}
45%\hypersetup{colorlinks, allcolors=blue} 45\hypersetup{colorlinks, allcolors=blue}
46\usepackage{multicol} 46\usepackage{multicol}
47\newcommand{\package}[1]{\textsf{#1}} 47\newcommand{\package}[1]{\textsf{#1}}
48\usepackage{paralist} 48\usepackage{paralist}
@@ -51,6 +51,9 @@
51\usepackage{booktabs} 51\usepackage{booktabs}
52\usepackage{tikz} 52\usepackage{tikz}
53\usepackage[skins,listings]{tcolorbox} 53\usepackage[skins,listings]{tcolorbox}
54\newtcblisting{arabluacode}[1]{colback=white, boxrule=.15mm,
55 colframe=red!50!white, listing options={style=tcblatex,
56 numbers=left, numberstyle=\tiny}, #1}
54\usepackage{csquotes} 57\usepackage{csquotes}
55\usepackage[style=authoryear, natbib]{biblatex} 58\usepackage[style=authoryear, natbib]{biblatex}
56\addbibresource{arabluatex.bib} 59\addbibresource{arabluatex.bib}
@@ -124,7 +127,7 @@
124% transliteration. It is particularly well-suited for complex 127% transliteration. It is particularly well-suited for complex
125% documents such as technical documents or critical editions where a 128% documents such as technical documents or critical editions where a
126% lot of left-to-right commands intertwine with Arabic 129% lot of left-to-right commands intertwine with Arabic
127% writing. \pkg*{arabluatex} is able to process any Arab\TeX\ 130% writing. \package{arabluatex} is able to process any Arab\TeX\
128% input notation. Its output can be set in the same modes of 131% input notation. Its output can be set in the same modes of
129% vocalization as Arab\TeX\ ones, or in different roman 132% vocalization as Arab\TeX\ ones, or in different roman
130% transliterations. It further allows some typographical 133% transliterations. It further allows some typographical
@@ -133,9 +136,13 @@
133% 136%
134% \section*{License and disclamer} 137% \section*{License and disclamer}
135% \addcontentsline{toc}{section}{License and disclamer} Please send 138% \addcontentsline{toc}{section}{License and disclamer} Please send
136% error reports and suggestions for improvements to Robert Alessi 139% error reports and suggestions for improvements to Robert Alessi:
137% <\href{mailto:alessi@robertalessi.net?Subject=arabluatex}% 140% \begin{itemize}
138% {\texttt{alessi@{\allowbreak}robertalessi.net}}> 141% \item email: <\href{mailto:alessi@robertalessi.net?Subject=arabluatex}%
142% {\texttt{alessi@{\allowbreak}robertalessi.net}}>
143% \item website: \url{http://www.robertalessi.net/arabluatex}
144% \end{itemize}
145%
139% 146%
140% This program is free software; you can redistribute it and/or 147% This program is free software; you can redistribute it and/or
141% modify it under the terms of the GNU General Public License 148% modify it under the terms of the GNU General Public License
@@ -159,31 +166,30 @@
159% say so---it will eventually provide all of its valuable qualities to 166% say so---it will eventually provide all of its valuable qualities to
160% the \LuaLaTeX\ users. 167% the \LuaLaTeX\ users.
161% 168%
162% \pkg{arabtex} dates back to 1992. As far as I know, it was then 169% \package{arabtex} dates back to 1992. As far as I know, it was then the
163% the first and only way to typeset Arabic texts with \TeX\ and 170% first and only way to typeset Arabic texts with \TeX\ and \LaTeX. To
164% \LaTeX. To achieve this, \pkg{arabtex} provided---and still 171% achieve this, \package{arabtex} provided---and still does---an Arabic
165% does---an Arabic font in \emph{Nasḫī} style and a macro package that 172% font in \emph{Nasḫī} style and a macro package that defined its own
166% defined its own input notation which was, as the author stated, 173% input notation which was, as the author stated, \enquote{both
167% \enquote{both machine, and human, readable, and suited for 174% machine, and human, readable, and suited for electronic transmission
168% electronic transmission and e-mail 175% and e-mail communication}.\footnote{\textcite[2]{pkg:arabtex}.} Even
169% communication}.\footnote{\textcite[2]{Lagally2004}.} Even if the 176% if the same can be said about Unicode, Arab\TeX\ \textsc{ASCII}
170% same can be said about Unicode, Arab\TeX\ \textsc{ASCII} input 177% input notation still surpasses Unicode input, in my opinion, when it
171% notation still surpasses Unicode input, in my opinion, when it comes 178% comes to typesetting complex documents, such as scientific documents
172% to typesetting complex documents, such as scientific documents or 179% or critical editions where footnotes and other kind of annotations
173% critical editions where footnotes and other kind of annotations can 180% can be particulary abundant. It must also be said that most text
174% be particulary abundant. It must also be said that most text editors 181% editors have trouble in displaying Arabic script connected with
175% have trouble in displaying Arabic script connected with preceding or 182% preceding or following \LaTeX\ commands: it often happens that
176% following \LaTeX\ commands: it often happens that commands seem 183% commands seem misplaced, not to mention punctuation marks, or
177% misplaced, not to mention punctuation marks, or opening or closing 184% opening or closing braces, brackets or parentheses that are
178% braces, brackets or parentheses that are unexpectedly displayed in 185% unexpectedly displayed in the wrong direction. Of course, some text
179% the wrong direction. Of course, some text editors provide ways to 186% editors provide ways to get around such difficulties by inserting
180% get around such difficulties by inserting invisible Unicode 187% invisible Unicode characters, such as LEFT-TO-RIGHT or RIGHT-TO-LEFT
181% characters, such as LEFT-TO-RIGHT or RIGHT-TO-LEFT MARKS 188% MARKS (\texttt{U+200E}, \texttt{U+200F}), RTL/LTR \enquote{embed}
182% (\texttt{U+200E}, \texttt{U+200F}), RTL/LTR \enquote{embed}
183% characters (\texttt{U+202B}, \texttt{U+202A}) and RLO/LRO 189% characters (\texttt{U+202B}, \texttt{U+202A}) and RLO/LRO
184% \enquote{bidi-override} characters (\texttt{U+202E}, 190% \enquote{bidi-override} characters (\texttt{U+202E},
185% \texttt{U+202D}).\footnote{Gáspár Sinai's Yudit probably has the 191% \texttt{U+202D}).\footnote{Gáspár Sinai's Yudit probably has the
186% best Unicode support. See \url{www.yudit.org}.} Nonetheless, it 192% best Unicode support. See \url{http://www.yudit.org}.} Nonetheless, it
187% remains that inserting all the time these invisible characters in 193% remains that inserting all the time these invisible characters in
188% complex documents rapidly becomes confusing and cumbersome. 194% complex documents rapidly becomes confusing and cumbersome.
189% 195%
@@ -210,26 +216,26 @@
210% that can stand to close grammatical scrutiny and to complex textual 216% that can stand to close grammatical scrutiny and to complex textual
211% searches as well. 217% searches as well.
212% 218%
213% Having that in mind, I started \pkg*{arabluatex}. With the help 219% Having that in mind, I started \package{arabluatex}. With the help
214% of Lua, it will eventually interact with some other packages yet to 220% of Lua, it will eventually interact with some other packages yet to
215% come to produce from \verb|.tex| source files, in addition to 221% come to produce from \verb|.tex| source files, in addition to
216% printed books, \texttt{TEI xml} compliant critical editions and/or 222% printed books, \texttt{TEI xml} compliant critical editions and/or
217% lexicons that can be searched, analyzed and correlated in various 223% lexicons that can be searched, analyzed and correlated in various
218% ways. 224% ways.
219% 225%
220%\subsection{\pkg*{arabluatex} is for \LuaLaTeX} 226%\subsection{\package{arabluatex} is for \LuaLaTeX}
221% It goes without saying that \pkg*{arabluatex} requires 227% It goes without saying that \package{arabluatex} requires
222% \LuaLaTeX. \TeX\ and \LaTeX\ have \pkg*{arabtex}, and \XeLaTeX\ 228% \LuaLaTeX. \TeX\ and \LaTeX\ have \package{arabtex}, and \XeLaTeX\
223% has \pkg*{arabxetex}. Both of them are much more advanced than 229% has \package{arabxetex}. Both of them are much more advanced than
224% \pkg*{arabluatex}, as they can process a number of different 230% \package{arabluatex}, as they can process a number of different
225% languages,\footnote{To date, both packages support Arabic, Maghribi, 231% languages,\footnote{To date, both packages support Arabic, Maghribi,
226% Urdu, Pashto, Sindhi, Kashmiri, Uighuric and Old Malay; in addition 232% Urdu, Pashto, Sindhi, Kashmiri, Uighuric and Old Malay; in addition
227% to these, \pkg*{arabtex} also has a Hebrew mode, including 233% to these, \package{arabtex} also has a Hebrew mode, including
228% Judeo-Arabic and Yiddish.} whereas \pkg*{arabluatex} can process 234% Judeo-Arabic and Yiddish.} whereas \package{arabluatex} can process
229% only Arabic for the time being. More languages will be included in 235% only Arabic for the time being. More languages will be included in
230% future releases of \pkg*{arabluatex}. 236% future releases of \package{arabluatex}.
231% 237%
232% In comparison to \pkg*{arabxetex}, \pkg*{arabluatex} works in 238% In comparison to \package{arabxetex}, \package{arabluatex} works in
233% a very different way. The former relies on the 239% a very different way. The former relies on the
234% \href{http://scripts.sil.org/TECkitIntro}{\texttt{TECkit}} engine 240% \href{http://scripts.sil.org/TECkitIntro}{\texttt{TECkit}} engine
235% which converts Arab\TeX\ input on the fly into Unicode Arabic 241% which converts Arab\TeX\ input on the fly into Unicode Arabic
@@ -246,19 +252,20 @@
246% processing. 252% processing.
247% 253%
248% \section{Usage} 254% \section{Usage}
249% \subsection{Getting started} 255% \subsection{Activating \package{arabluatex}}
250% As usual put in your preamble: 256% As usual put in your preamble:
251% \begin{commands} 257% |\usepackage{arabluatex}|
252% \command{usepackage}[\Marg{arabluatex}] 258% The only requirement of \package{arabluatex} is \LuaLaTeX; it will
253% \end{commands} 259% complain if you try to compile your document with another
254% 260% engine. That aside, \package{arabluatex} does not load packages such
255% \begin{options} 261% as \package{polyglossia} or \package{luabidi}. It can work with
256% \opt{voc}\Default{voc} Vocalized Arabic 262% \package{polyglossia} but does not require it.
257% \opt{novoc} Full vocalized Arabic 263%
258% \end{options} 264% \begin{itemize}
259% \begin{sidebyside} 265% \item voc Vocalized Arabic
260% \arb{daxala} 266% \item novoc Full vocalized Arabic
261% \end{sidebyside} 267% \end{itemize}
268%
262% \newcommand{\dmg}[1]{% 269% \newcommand{\dmg}[1]{%
263% \SetTranslitConvention{dmg}% 270% \SetTranslitConvention{dmg}%
264% \arb[trans]{#1}} 271% \arb[trans]{#1}}
@@ -301,7 +308,7 @@
301[2016/01/26 v1.0 ArabTeX-like interface for LuaLaTeX] 308[2016/01/26 v1.0 ArabTeX-like interface for LuaLaTeX]
302\RequirePackage{ifluatex} 309\RequirePackage{ifluatex}
303% \end{macrocode} 310% \end{macrocode}
304% \pkg*{arabluatex} requires \LuaLaTeX\ of course. 311% \package{arabluatex} requires \LuaLaTeX\ of course.
305% \begin{macrocode} 312% \begin{macrocode}
306\ifluatex\else 313\ifluatex\else
307 \PackageError{arabluatex}{lualatex needed}{% 314 \PackageError{arabluatex}{lualatex needed}{%
@@ -330,8 +337,8 @@
330\RequirePackage{environ} 337\RequirePackage{environ}
331\luadirect{dofile(kpse.find_file("arabluatex.lua"))} 338\luadirect{dofile(kpse.find_file("arabluatex.lua"))}
332% \end{macrocode} 339% \end{macrocode}
333% This is needed by the current versions of \pkg*{polyglossia} and 340% This is needed by the current versions of \package{polyglossia} and
334% \pkg*{luabidi}. \pkg*{luabidi} provides a \cs{Footnote} 341% \package{luabidi}. \package{luabidi} provides a \cs{Footnote}
335% command. Use it as well if it is loaded. 342% command. Use it as well if it is loaded.
336% \begin{macrocode} 343% \begin{macrocode}
337\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))} 344\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))}
@@ -389,7 +396,7 @@
389% \end{macrocode} 396% \end{macrocode}
390% \end{macro} 397% \end{macro}
391% \begin{environment}{arab} 398% \begin{environment}{arab}
392% Here comes the description of the environment \env*{arab} 399% Here comes the description of the environment |arab|
393% \begin{macrocode} 400% \begin{macrocode}
394\NewEnviron{arab}[1][\al@mode]% 401\NewEnviron{arab}[1][\al@mode]%
395{\par\edef\@tempa{#1}% 402{\par\edef\@tempa{#1}%