blob: 845b7398b75543ca3d6dbffc10359e49839fc0f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
%%
%% This is file `xepersian-mathsdigitspec.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xepersian.dtx (with options: `xepersian-mathsdigitspec.sty')
%%
%% __________________________________
%% Copyright © 2008-2009 Vafa Khalighi
%%
%% License information appended.
%%
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xepersian-mathsdigitspec}
[2009/04/22 v1.0.1 Unicode Persian maths digits in XeLaTeX (Author: Vafa Khalighi)]
\@zf@mathfalse
\def\@preamblecmds{}
\newcommand\not@onlypreamble[1]{{%
\def\do##1{\ifx#1##1\else\noexpand\do\noexpand##1\fi}%
\xdef\@preamblecmds{\@preamblecmds}}}
\def\gm@notprerr{ can be used only in preamble (\on@line)}
\AtBeginDocument{%
\def\do#1{\noexpand\do\noexpand#1}%
\edef\@preamblecmds{%
\def\noexpand\do##1{%
\def##1{\noexpand\PackageError{gmutils/LaTeX}%
{\noexpand\string##1 \noexpand\gm@notprerr}\noexpand\@eha}}%
\@preamblecmds}}
\def\nocite#1{%
\@bsphack{\setbox0=\hbox{\cite{#1}}}\@esphack}
\newcommand\xepersian@PackageInfo[1]{\PackageInfo{xepersian-mathsdigitspec}{#1}}
\newcommand\SetMathCode[4]{%
\XeTeXmathcode#1="\mathchar@type#2 \csname sym#3\endcsname #4\relax}
\newcommand\SetMathCharDef[4]{%
\XeTeXmathchardef#1="\mathchar@type#2 \csname sym#3\endcsname #4\relax}
\newcommand\setdigitfont[2][]{%
\let\glb@currsize\relax
\setkeys*[xepersian-mathsdigitspec]{options}{#1}%
\edef\@tempa{\noexpand\zf@fontspec{%
\XKV@rm}{#2}}\@tempa
\xepersian@PackageInfo{Defining the default Persian maths digits font as '#2'}
\DeclareSymbolFont{OPERATORS} {EU1}{\zf@family} {m}{n}
\SetSymbolFont{OPERATORS}{bold}{EU1}{\zf@family} {bx}{n}
\DeclareMathAlphabet {\mathit}{EU1}{\zf@family}{m}{it}
\DeclareSymbolFontAlphabet{\mathrm} {OPERATORS}
\DeclareMathAlphabet {\mathbf}{EU1}{\zf@family}{bx}{n}
\SetMathCode{`0}{\mathalpha}{OPERATORS}{"06F0}
\SetMathCode{`1}{\mathalpha}{OPERATORS}{"06F1}
\SetMathCode{`2}{\mathalpha}{OPERATORS}{"06F2}
\SetMathCode{`3}{\mathalpha}{OPERATORS}{"06F3}
\SetMathCode{`4}{\mathalpha}{OPERATORS}{"06F4}
\SetMathCode{`5}{\mathalpha}{OPERATORS}{"06F5}
\SetMathCode{`6}{\mathalpha}{OPERATORS}{"06F6}
\SetMathCode{`7}{\mathalpha}{OPERATORS}{"06F7}
\SetMathCode{`8}{\mathalpha}{OPERATORS}{"06F8}
\SetMathCode{`9}{\mathalpha}{OPERATORS}{"06F9}
\SetMathCharDef{\decimalseparator}{\mathpunct}{OPERATORS}{"066B}
}
\ifx\newcommand\undefined\else
\newcommand{\ZifferAn}{}
\fi
\mathchardef\ziffer@DotOri="013A
{\ZifferAn
\catcode`\.=\active\gdef.{\begingroup\obeyspaces\futurelet\n\ziffer@dcheck}}
\def\ziffer@dcheck{\ziffer@check\ZifferLeer\ziffer@DotOri}
\def\ziffer@check#1#2{%
\ifx\n1\endgroup#1\else
\ifx\n2\endgroup#1\else
\ifx\n3\endgroup#1\else
\ifx\n4\endgroup#1\else
\ifx\n5\endgroup#1\else
\ifx\n6\endgroup#1\else
\ifx\n7\endgroup#1\else
\ifx\n8\endgroup#1\else
\ifx\n9\endgroup#1\else
\ifx\n0\endgroup#1\else
\endgroup#2%
\fi
\fi
\fi
\fi
\fi
\fi
\fi
\fi
\fi
\fi}
\mathcode`.="8000\relax
\def\ZifferLeer{\ifx\decimalseparator\undefied .\else \decimalseparator\fi}
%%
%% Copyright © 2008-2009 by Vafa Khalighi <vafa@users.berlios.de>
%%
%% 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 Vafa Khalighi.
%%
%%
%%
%%
%%
%% End of file `xepersian-mathsdigitspec.sty'.
|