% \iffalse meta-comment % copyright (C) 2016 Robert Alessi % % Please send error reports and suggestions for improvements to % Robert Alessi % % This program is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License % as published by the Free Software Foundation; either version 2 % of the License, or (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA % 02111-1307, USA. % \fi % % \iffalse %<*driver> \ProvidesFile{arabluatex.dtx} % %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{arabluatex} %<*package-info> [2016/01/26 v1.0 This is ArabTeX for LuaLaTeX] % % %<*driver> \documentclass{ltxdoc} \usepackage[english]{babel} \usepackage{fontspec,luatextra,realscripts} \defaultfontfeatures{RawFeature={+liga}} \setmainfont{Libertinus Serif} \setsansfont{Libertinus Sans} \setmonofont[Scale=.9]{Libertinus Mono} \usepackage{arabluatex}[2016/01/26] \usepackage{hypdoc} \hypersetup{colorlinks, allcolors=blue} \usepackage{multicol} \newcommand{\package}[1]{\textsf{#1}} \usepackage{paralist} \setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash} \usepackage{tikz} \usepackage[skins]{tcolorbox} \usepackage{csquotes} \usepackage[style=authoryear]{biblatex} \addbibresource{arabluatex.bib} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{arabluatex.dtx} \PrintChanges \PrintIndex \end{document} % % \fi % % \CheckSum{0} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % % \changes{1.0}{2016/01/26}{Converted to DTX file} % % \DoNotIndex{\newcommand,\newenvironment,\renewcommand} % % \providecommand*{\url}{\texttt} % \GetFileInfo{arabluatex.dtx} % % \title{\tcbox[enhanced, tikznode, drop lifted shadow, colback=white, % boxrule=.25mm]% % {The \textsf{arabluatex} package\\ % \fileversion~from \filedate}} % % \newcommand*{\NEWfeature}[1]{% % \hskip 1sp \marginpar{\small\sffamily\raggedright % New feature\\#1}} % % \author{Robert Alessi \\ \url{alessi@robertalessi.net}} % \date{} % % \maketitle % % \begin{multicols}{2} % \footnotesize % \tableofcontents % \end{multicols} % % \begin{abstract} % This package provides for \LuaLaTeX\ an Arab{\TeX}-like interface % to generate Arabic writing from an \textsc{ascii} % transliteration. It is particularly well-suited for complex % documents such as technical documents or critical editions where a % lot of left-to-right commands intertwine with Arabic % writing. \package{arabluatex} is able to process any Arab\TeX\ % input notation. Its output can be set in the same modes of % vocalization as Arab\TeX\ ones, or in different roman % transliterations. It further allows some typographical % refinements. % \end{abstract} % % \section*{License and disclamer} % \addcontentsline{toc}{section}{License and disclamer} % Please send error reports and suggestions for improvements to % Robert Alessi <\url{alessi@robertalessi.net}> % % This program is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License % as published by the Free Software Foundation; either version 2 % of the License, or (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA % 02111-1307, USA. % % \section{Introduction} % In comparison to Prof. Lagally's outstanding Arab\TeX,\footnote{See % \url{http://ctan.org/pkg/arabtex}} Arab\LuaTeX\ is at present % nothing more than a modest piece of software. Hopefully---if I may % say so---it will eventually provide all of its valuable qualities to % the \LuaLaTeX\ users. \package{arabtex} dates back to 1992. As far % as I know, it was then the first and only way to typeset Arabic % texts with \TeX\ and \LaTeX. To achieve this, \package{arabtex} % provides an Arabic font in \emph{Nasḫī} style and a macro package % that defines its own input notation which is, as the author states, % \textcquote[2]{Lagally2004}{both machine, and human, readable, and % suited for electronic transmission and e-mail communication}. % % \section{Usage} % % Usage goes here. % % \StopEventually{} % % \section{Implementation} % % \iffalse %<*package> % \fi % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{arabluatex}% [2016/01/26 v1.0 ArabTeX-like interface for LuaLaTeX] \RequirePackage{ifluatex} % \end{macrocode} % \package{arabluatex} requires \LuaLaTeX\ of course. % \begin{macrocode} \ifluatex\else \PackageError{arabluatex}{lualatex needed}{% Package `arabluatex' needs LuaTeX.\MessageBreak So you should use `lualatex' to process you document!\MessageBreak See documentation of `arabluatex' for further information.}% \expandafter\expandafter\expandafter\csname endinput\endcsname \fi % \end{macrocode} % \begin{macrocode} \DeclareOption{voc}{\def\al@mode{voc}} \DeclareOption{novoc}{\def\al@mode{novoc}} \DeclareOption{fullvoc}{\def\al@mode{fullvoc}} \ExecuteOptions{voc} \ProcessOptions\relax \def\al@mode@voc{voc} \def\al@mode@fullvoc{fullvoc} \def\al@mode@novoc{novoc} % \newif\ifal@mode@defined \RequirePackage{amsmath} \RequirePackage{etoolbox} \RequirePackage{luacode} \RequirePackage{xparse} \RequirePackage{environ} \luadirect{dofile(kpse.find_file("arabluatex.lua"))} % \end{macrocode} % This is needed by the current versions of \package{polyglossia} and % \package{luabidi}. \package{luabidi} provides a \cs{Footnote} % command. Use it as well if it is loaded. % \begin{macrocode} \luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))} % \end{macrocode} % \begin{macrocode} \AtBeginDocument{\ifdefined\arabicfont\relax\else \PackageWarning{arabluatex}{\string\arabicfont\ is not defined!^^JI will try to load Amiri}% \newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}% \AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}} \AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}} \AtBeginDocument{\ifdef{\LR}% {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} \AtBeginDocument{\ifdef{\RL}% {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} \AtBeginDocument{\ifdef{\aemph}% {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}} {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}} \DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir TRT\arabicfont#1\egroup} \DeclareDocumentCommand{\arb}{O{\al@mode} +m}% {\edef\@tempa{#1}% \ifx\@tempa\al@mode@voc% \bgroup\textdir TRT\arabicfont% \luadirect{tex.sprint(processvoc(\luastringN{#2}))}\egroup% \else% \ifx\@tempa\al@mode@fullvoc% \bgroup\textdir TRT\arabicfont% \luadirect{tex.sprint(processfullvoc(\luastringN{#2}))}\egroup% \else% \ifx\@tempa\al@mode@novoc% \bgroup\textdir TRT\arabicfont% \luadirect{tex.sprint(processnovoc(\luastringN{#2}))}\egroup% \else% \fi\fi\fi} \NewEnviron{arab}[1][\al@mode]% {\par\edef\@tempa{#1}% \ifx\@tempa\al@mode@voc% \bgroup\pardir TRT\textdir TRT\arabicfont% \luadirect{tex.sprint(processvoc(\luastringO{\BODY}))}\egroup% \else% \ifx\@tempa\al@mode@fullvoc% \bgroup\pardir TRT\textdir TRT\arabicfont% \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY}))}\egroup% \else% \ifx\@tempa\al@mode@novoc% \bgroup\pardir TRT\textdir TRT\arabicfont% \luadirect{tex.sprint(processnovoc(\luastringO{\BODY}))}\egroup% \else \BODY% \fi\fi\fi}[\par] % \robustify{\textbf} % \robustify{\emph} % \robustify{\footnote} % \robustify{\marginpar} \DeclareDocumentCommand{\Marginpar}{m}{\marginpar{\textdir TLT #1}} \RenewDocumentCommand{\thefootnote}{}{\bgroup\textdir TLT\arabic{footnote}\egroup} \DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir TLT\LR{\footnote{#1}}\egroup} % \AtBeginDocument{\ifdef{\abjad}{\robustify{\abjad}}{}} % \AtBeginDocument{\ifdef{\Footnote}{\robustify{\Footnote}}{}} \endinput % \end{macrocode} % % \printbibliography % % \iffalse % % \fi % % \Finale \endinput