summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty145
1 files changed, 145 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
new file mode 100644
index 00000000000..376e47952b5
--- /dev/null
+++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
@@ -0,0 +1,145 @@
+%%
+%% This is file `arabluatex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% arabluatex.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2016 Robert Alessi
+%%
+%% Please send error reports and suggestions for improvements to
+%% Robert Alessi <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.
+%%
+%% This release of 'arabluatex' consists of the following source files:
+%% - arabluatex.ins
+%% - arabluatex.dtx
+%% - arabluatex.lua
+%% - arabluatex_voc.lua
+%% - arabluatex_fullvoc.lua
+%% - arabluatex_novoc.lua
+%% - arabluatex_trans.lua
+%% - arabluatex.bib
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{arabluatex}%
+[2016/03/31 v1.0.1 ArabTeX-like interface for LuaLaTeX]
+\RequirePackage{ifluatex}
+\ifluatex\else
+ \PackageError{arabluatex}{lualatex needed}{%
+ Package `arabluatex' needs LuaTeX.\MessageBreak
+ So you should use `lualatex' to process your document.\MessageBreak
+ See documentation of `arabluatex' for further information.}%
+ \expandafter\expandafter\expandafter\csname endinput\endcsname
+\fi
+\DeclareOption{voc}{\def\al@mode{voc}}
+\DeclareOption{fullvoc}{\def\al@mode{fullvoc}}
+\DeclareOption{novoc}{\def\al@mode{novoc}}
+\DeclareOption{trans}{\def\al@mode{trans}}
+\ExecuteOptions{voc}
+\ProcessOptions\relax
+\def\al@mode@voc{voc}
+\def\al@mode@fullvoc{fullvoc}
+\def\al@mode@novoc{novoc}
+\def\al@mode@trans{trans}
+\RequirePackage{fontspec}
+\RequirePackage{amsmath}
+\RequirePackage{etoolbox}
+\RequirePackage{luacode}
+\RequirePackage{xparse}
+\RequirePackage{environ}
+\luadirect{dofile(kpse.find_file("arabluatex.lua"))}
+\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))}
+\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}}$}}}
+\def\al@trans@style{\itshape}%
+\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}}
+\def\al@trans@convention{dmg}
+\NewDocumentCommand{\SetTranslitConvention}{m}{\def\al@trans@convention{#1}}
+\DeclareDocumentCommand{\cap}{m}%
+ {\luadirect{tex.sprint(cap(\luastringN{#1}))}}
+\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir
+ TRT\arabicfont#1\egroup}
+\DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir
+ TLT\rmfamily#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%
+ \ifx\@tempa\al@mode@trans%
+ \bgroup\textdir TLT\al@trans@style%
+ \luadirect{tex.sprint(processtrans(\luastringN{#2},
+ \luastringO{\al@trans@convention}))}\egroup%
+ \else%
+ \fi\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 \ifx\@tempa\al@mode@trans%
+ \bgroup\pardir TLT\textdir TLT\al@trans@style%
+ \luadirect{tex.sprint(processtrans(\luastringO{\BODY},
+ \luastringO{\al@trans@convention}))}\egroup%
+ \else \fi\fi\fi\fi}[\par]
+\DeclareDocumentCommand{\LRmarginpar}{m}{\marginpar{\textdir TLT #1}}
+\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir
+ TLT\LR{\footnote{#1}}\egroup}
+\DeclareDocumentCommand{\RLfootnote}{m}{\bgroup\pardir
+ TRT\LR{\footnote{#1}}\egroup}
+\NewDocumentCommand{\FixArbFtnmk}{}{%
+ \@ifpackageloaded{scrextend}%
+ {\AtBeginDocument{\deffootnote{2em}{1.6em}{\LR{\thefootnotemark}.\enskip}}}%
+ {\RequirePackage{scrextend}
+ \AtBeginDocument{\deffootnote{2em}{1.6em}{\LR{\thefootnotemark}.\enskip}}}}
+\endinput
+%%
+%% End of file `arabluatex.sty'.