summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty38
1 files changed, 24 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
index fd3ab4d498d..1310532e324 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{10001}
+%% \CheckSum{10026}
%% \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
@@ -35,8 +35,8 @@
%% Right brace \} Tilde \~}
%%
\NeedsTeXFormat{LaTeX2e}
-\def\xepersianversion{v15.4}
-\def\xepersiandate{2014/11/15}
+\def\xepersianversion{v15.5}
+\def\xepersiandate{2014/11/17}
\ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space
Persian typesetting in XeLaTeX]
\RequirePackage{fontspec}
@@ -562,8 +562,8 @@ number is 999,999,999.}%
\providecommand*{\xpg@warning}[1]{%
\PackageWarning{XePersian}%
{#1}}
-\if@bidi@csundef{abjadnumeral}{%
-\def\abjadnumeral#1{%
+\if@bidi@csundef{@abjad}{%
+\def\@abjad#1{%
\ifnum#1>1999 \xpg@warning{Illegal value (#1) for abjad numeral} {#1}
\else
\ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for abjad numeral}%
@@ -582,6 +582,8 @@ number is 999,999,999.}%
\fi
\fi
}
+\def\abjad#1{\expandafter\@abjad\csname c@#1\endcsname}
+\let\abjadnumeral\@abjad
\def\abjad@zero{}
\def\abj@num@i#1{%
\ifcase#1\or آ\or ب\or ج\or د%
@@ -599,17 +601,12 @@ number is 999,999,999.}%
\ifcase#1\or غ\fi
\ifnum#1=\z@\fi\abj@num@iii}
}{}
- \let\@latinalph\@alph%
- \let\@latinAlph\@Alph%
-\def\PersianAlphs{%
- \let\@alph\@Abjad%
- \let\@Alph\@Abjad%
-}
+\let\@latinalph\@alph%
+\let\@latinAlph\@Alph%
\def\LatinAlphs{%
\let\@alph\@latinalph%
\let\@Alph\@latinAlph%
}
-\PersianAlphs
\bidi@AfterEndPreamble{%
\if@bidi@csundef{persianfont}{%
\PackageError{xepersian}{You have not specified any font\MessageBreak
@@ -751,6 +748,18 @@ number is 999,999,999.}%
\PackageError{xepersian}{“shell escape” (or “write18”) is not enabled. You need to run “xelatex --shell-escape” on your TeX document for this feature to work}{}
\fi
\fi}
+\define@choicekey{xepersian.sty}{abjadvariant}[\xepersian@tempa\xepersian@tempb]{one,two}{%
+ \ifcase\xepersian@tempb\relax
+ \def\PersianAlphs{%
+ \let\@alph\@abjad%
+ \let\@Alph\@abjad%
+ }
+ \or
+ \def\PersianAlphs{%
+ \let\@alph\@Abjad%
+ \let\@Alph\@Abjad%
+ }
+ \fi}
\DeclareOptionX{defaultlatinfontfeatures}{%
\defaultfontfeatures
[\latinfont]
@@ -760,7 +769,8 @@ number is 999,999,999.}%
\ExecuteOptionsX{%
RTLdocument=on,
footnotedirection=righttoleft,
- footnoterule=automatic
+ footnoterule=automatic,
+ abjadvariant=two
}
\ProcessOptionsX
@@ -771,7 +781,7 @@ number is 999,999,999.}%
\fi
\setlatintextfont[ExternalLocation,BoldFont={lmroman10-bold},BoldItalicFont={lmroman10-bolditalic},ItalicFont={lmroman10-italic},SmallCapsFont={lmromancaps10-regular},SlantedFont={lmromanslant10-regular},BoldSlantedFont={lmromanslant10-bold}]{lmroman10-regular}%
-
+\PersianAlphs
\endinput
%%
%% End of file `xepersian.sty'.