%%
%% This is file `arabxetex.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% arabxetex.dtx  (with options: `package')
%% 
%%   ____________________________
%%   The arabxetex package
%%   © 2007–2015  François Charette
%%   License information appended
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{arabxetex}
  [2015/09/04 v1.2.1 ArabTeX-like interface for XeLaTeX]
\DeclareOption{fullvoc}{\def\ax@mode{fullvoc}}
\DeclareOption{voc}{\def\ax@mode{voc}}
\DeclareOption{novoc}{\def\ax@mode{novoc}}
\DeclareOption{trans}{\def\ax@mode{trans}}
\DeclareOption{utf}{\def\ax@mode{utf}}
\DeclareOption{fdf2alif}{} % deprecated
\DeclareOption{fdf2noalif}{} % deprecated
\newif\ifmirror@punct\mirror@punctfalse
\DeclareOption{mirrorpunct}{\mirror@puncttrue}
\ExecuteOptions{novoc}
\ProcessOptions
\def\ax@mode@fullvoc{fullvoc}
\def\ax@mode@voc{voc}
\def\ax@mode@novoc{novoc}
\def\ax@mode@trans{trans}
\def\ax@mode@utf{utf}
\newif\ifax@mode@defined
\def\ax@ismode@defined#1{%
\ifcsname ax@mode@#1\endcsname%
\ax@mode@definedtrue%
\else
\ax@mode@definedfalse%
\fi}
\def\ax@lang{arab}%default language (for macros like \aemph)
\RequirePackage{amsmath}%because of macro \overline used in \aemph
\RequirePackage{fontspec}
\RequirePackage{bidi}
\AtBeginDocument{\ifdefined\arabicfont\relax\else
\PackageWarning{arabxetex}{\string\arabicfont\ is not defined!^^JI will try to load Amiri}%
\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}%
\def\ax@trans@style{\itshape}%
\newcommand{\SetTranslitStyle}[1]{\def\ax@trans@style{#1}}
\newcommand{\SetTranslitConvention}[1]{\def\ax@trans@convention{#1}}
\def\ax@trans@convention{loc}% Library of Congress is default
\newcommand{\SetAllahWithAlif}{} % deprecated
\newcommand{\SetAllahWithoutAlif}{} % deprecated
\def\utf@fontfeature{\ifmirror@punct\addfontfeature{Mapping=mirrorpunct}\else\relax\fi}
\def\arabtex@codes{\catcode`^=11\relax\catcode`_=11\relax}
\def\UC{\char"E000} % This is used to capitalize the following letter (ignoring
    % article al-) in transliteration mode
%%%Font setup
\def\ax@farsi@font{\ifdefined\farsifont\farsifont\else\arabicfont\fi}
\def\ax@urdu@font{\ifdefined\urdufont\urdufont\else\arabicfont\fi}
\def\ax@pashto@font{\ifdefined\pashtofont\pashtofont\else\arabicfont\fi}
\def\ax@maghribi@font{\ifdefined\maghribifont\maghribifont\else\arabicfont\fi}
\def\ax@sindhi@font{\ifdefined\sindhifont\sindhifont\else\arabicfont\fi}
\def\ax@kashmiri@font{\ifdefined\kashmirifont\kashmirifont\else\arabicfont\fi}
\def\ax@ottoman@font{\ifdefined\ottomanfont\ottomanfont\else\arabicfont\fi}
\def\ax@kurdish@font{\ifdefined\kurdishfont\kurdishfont\else\arabicfont\fi}
\def\ax@malay@font{\ifdefined\malayfont\malayfont\else\arabicfont\fi}
\def\ax@uighur@font{\ifdefined\uighurfont\uighurfont\else\arabicfont\fi}
\def\ax@urdu@font{\ifdefined\urdufont\urdufont\else\arabicfont\fi}

\newenvironment{arab}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{arab}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\arabicfont\utf@fontfeature%
\else
\par\setRL\arabicfont\arabtex@codes%
\addfontfeature{Mapping=arabtex-\@tempa}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\arabicfont\arabtex@codes%
\addfontfeature{Mapping=arabtex-\ax@mode}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
\let\Arabic=\arab%
%%%
\newenvironment{maghribi}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{maghribi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@maghribi@font\utf@fontfeature%
\else
\par\setRL\ax@maghribi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-maghribi-\@tempa}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@maghribi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-maghribi-\ax@mode}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
%%%
\newenvironment{farsi}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{farsi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-farsi-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@farsi@font\utf@fontfeature%
\else
\par\setRL\ax@farsi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-farsi-\@tempa}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@farsi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-farsi-\ax@mode}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
\let\persian=\farsi
%%%
\newenvironment{urdu}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{urdu}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-urdu-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@urdu@font\addfontfeature{Language=Urdu}%Mapping=arabtex-utf}%
\else
\par\setRL\ax@urdu@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-urdu-\@tempa}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@urdu@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-urdu-\ax@mode}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
%%%
\newenvironment{pashto}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{pashto}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-pashto-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@pashto@font\utf@fontfeature%
\else
\par\setRL\ax@pashto@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-pashto-\@tempa}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@pashto@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-pashto-\ax@mode}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
%%%
\newenvironment{sindhi}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{sindhi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
\par\arabtex@codes\ax@trans@style%
\addfontfeature{Mapping=arabtex-sindhi-trans-\ax@trans@convention}%
\else
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@sindhi@font\addfontfeature{Language=Sindhi}%Mapping=arabtex-utf}%
\else
\par\setRL\ax@sindhi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-sindhi-\@tempa,Language=Sindhi}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@sindhi@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-sindhi-\ax@mode,Language=Sindhi}%
\fi}
{\ifx\@tempa\ax@mode@trans\relax\else\unsetRL\fi\par}
%%%
\newenvironment{ottoman}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{ottoman}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@ottoman@font\utf@fontfeature%
\else
\par\setRL\ax@ottoman@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-turk-\@tempa}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@ottoman@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-turk-\ax@mode}%
\fi}
{%\ifx\@tempa\ax@mode@trans\relax\else
\unsetRL%\fi
\par}
\let\turk=\ottoman
%%%
\newenvironment{kurdish}[1][]%
{\def\ax@lang{kurdish}%
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@kurdish@font\addfontfeature{Language=Kurdish}%Mapping=arabtex-utf}%
\else
\par\setRL\ax@kurdish@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-kurdish,Language=Kurdish}%
\fi}
{%\ifx\@tempa\ax@mode@trans\relax\else
\unsetRL%\fi
\par}
%%%
\newenvironment{kashmiri}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{kashmiri}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@kashmiri@font\utf@fontfeature%
\else
\par\setRL\ax@kashmiri@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-kashmiri-\@tempa}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@kashmiri@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-kashmiri-\ax@mode}%
\fi}
{%\ifx\@tempa\ax@mode@trans\relax\else
\unsetRL%\fi
\par}
%%%
\newenvironment{malay}[1][\ax@mode]%
{\edef\@tempa{#1}%
\def\ax@lang{malay}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@malay@font\utf@fontfeature%
\else
\par\setRL\ax@malay@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-malay-\@tempa}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\par\setRL\ax@malay@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-malay-\ax@mode}%
\fi}
{%\ifx\@tempa\ax@mode@trans\relax\else
\unsetRL%\fi
\par}
\let\jawi=\malay
%%%
\newenvironment{uighur}[1]%
{%\edef\@tempa{#1}%
\def\ax@lang{uighur}%
\ifx\@tempa\ax@mode@utf%
\par\setRL\ax@uighur@font\utf@fontfeature%
\else
\par\setRL\ax@uighur@font\arabtex@codes%
\addfontfeature{Mapping=arabtex-uighur}%
\fi}
{%\ifx\@tempa\ax@mode@trans\relax\else
\unsetRL%\fi
\par}
%%%
\def\textarab{\bgroup\arabtex@codes\text@arab}
\let\textarabic=\textarab
\def\textmaghribi{\bgroup\arabtex@codes\text@maghribi}
\def\textfarsi{\bgroup\arabtex@codes\text@farsi}
\let\textpersian=\textfarsi
\def\texturdu{\bgroup\arabtex@codes\text@urdu}
\def\textsindhi{\bgroup\arabtex@codes\text@sindhi}
\def\textpashto{\bgroup\arabtex@codes\text@pashto}
\def\textottoman{\bgroup\arabtex@codes\text@ottoman}
\let\textturk=\textottoman
\def\textkurdish{\bgroup\arabtex@codes\text@kurdish}
\def\textkashmiri{\bgroup\arabtex@codes\text@kashmiri}
\def\textmalay{\bgroup\arabtex@codes\text@malay}
\let\textjawi=\textmalay
\def\textuighur{\bgroup\arabtex@codes\text@uighur}
\newcommand\text@arab[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{arab}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-trans-\ax@trans@convention}\scantokens{#2\noexpand}}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\arabicfont\utf@fontfeature #2}%
\else
\RL{\arabicfont\addfontfeature{Mapping=arabtex-\@tempa}\scantokens{#2\noexpand}}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\arabicfont\addfontfeature{Mapping=arabtex-\ax@mode}\scantokens{#2\noexpand}}%
\fi\egroup}
\newcommand\text@maghribi[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{maghribi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-trans-\ax@trans@convention}#2}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\ax@maghribi@font\utf@fontfeature #2}%
\else
\RL{\ax@maghribi@font%
\addfontfeature{Mapping=arabtex-maghribi-\@tempa}#2}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@maghribi@font\addfontfeature{Mapping=arabtex-maghribi-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@farsi[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{farsi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-farsi-trans-\ax@trans@convention}#2}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\ax@farsi@font\utf@fontfeature #2}%
\else
\RL{\ax@farsi@font%
\addfontfeature{Mapping=arabtex-farsi-\@tempa}#2}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@farsi@font\addfontfeature{Mapping=arabtex-farsi-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@urdu[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{urdu}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-urdu-trans-\ax@trans@convention}#2}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\ax@urdu@font\addfontfeature{Language=Urdu}#2}%eventually Mapping=arabtex-utf
\else
\RL{\ax@urdu@font%
\addfontfeature{Mapping=arabtex-urdu-\@tempa,Language=Urdu}#2}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@urdu@font\addfontfeature{Mapping=arabtex-urdu-\ax@mode,Language=Urdu}#2}%
\fi\egroup}
\newcommand\text@sindhi[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{sindhi}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-sindhi-trans-\ax@trans@convention}#2}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\ax@sindhi@font\addfontfeature{Language=Sindhi} #2}%eventually Mapping=arabtex-utf
\else
\RL{\ax@sindhi@font%
\addfontfeature{Mapping=arabtex-sindhi-\@tempa,Language=Sindhi}#2}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@sindhi@font\addfontfeature{Mapping=arabtex-sindhi-\ax@mode,Language=Sindhi}#2}%
\fi\egroup}
\newcommand\text@pashto[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{pashto}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@trans%
{\ax@trans@style\addfontfeature{Mapping=arabtex-pashto-trans-\ax@trans@convention}#2}%
\else
\ifx\@tempa\ax@mode@utf%
\RL{\ax@pashto@font\utf@fontfeature #2}%
\else
\RL{\ax@pashto@font%
\addfontfeature{Mapping=arabtex-pashto-\@tempa}#2}%
\fi\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@pashto@font\addfontfeature{Mapping=arabtex-pashto-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@ottoman[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{ottoman}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\RL{\ax@ottoman@font\utf@fontfeature #2}%
\else
\RL{\ax@ottoman@font%
\addfontfeature{Mapping=arabtex-turk-\@tempa}#2}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@ottoman@font\addfontfeature{Mapping=arabtex-turk-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@kurdish[2][]{%
\edef\@tempa{#1}%
\def\ax@lang{kurdish}%
\ifx\@tempa\ax@mode@utf%
\RL{\ax@kurdish@font\utf@fontfeature #2}%
\else
\RL{\ax@kurdish@font%
\addfontfeature{Mapping=arabtex-kurdish,Language=Kurdish}#2}%
\fi%\fi
\egroup}
\newcommand\text@kashmiri[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{kashmiri}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\RL{\ax@kashmiri@font\utf@fontfeature #2}%
\else
\RL{\ax@kashmiri@font%
\addfontfeature{Mapping=arabtex-kashmiri-\@tempa}#2}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \@ax@mode}%
\RL{\ax@kashmiri@font\addfontfeature{Mapping=arabtex-kashmiri-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@malay[2][\ax@mode]{%
\edef\@tempa{#1}%
\def\ax@lang{malay}%
\ax@ismode@defined{\@tempa}%
\ifax@mode@defined%
\ifx\@tempa\ax@mode@utf%
\RL{\ax@malay@font\utf@fontfeature #2}%
\else
\RL{\ax@malay@font%
\addfontfeature{Mapping=arabtex-malay-\@tempa}#2}%
\fi%\fi
\else
\PackageWarning{arabxetex}{Mode \@tempa\ not defined, defaulting to \ax@mode}%
\RL{\ax@malay@font\addfontfeature{Mapping=arabtex-malay-\ax@mode}#2}%
\fi\egroup}
\newcommand\text@uighur[2][]{%
\edef\@tempa{#1}%
\def\ax@lang{uighur}%
\ifx\@tempa\ax@mode@utf%
\RL{\ax@uighur@font\utf@fontfeature #2}%
\else
\RL{\ax@uighur@font%
\addfontfeature{Mapping=arabtex-uighur}#2}%
\fi%\fi
\egroup}
\newcommand{\textLR}[1]{\LR{\rmfamily #1}}
\providecommand*{\aemph}[1]{%
  \edef\@tempb{\expandafter\noexpand\csname text\ax@lang\endcsname}%
  $\overline{\text{\@tempb{#1}}}$}
%% 
%% Copyright © 2007–2015 by François Charette <firmicus04 at gmail dot com>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by François Charette.
%% 
%% This work consists of the file arabxetex.dtx
%% and the derived files arabxetex.sty and arabxetex.pdf.
%% as well as an extensive collection of TECKit files
%% (*.map, compiled as *.tec).
%% 
%%
%% End of file `arabxetex.sty'.
