summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/arabtex/arabwin.sty
blob: 7143b3bf6f1d869fef85a1574bab2c0a54f9d225 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%% arabwin.sty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabwin.sty based on iso88596.sty 
% Scanner module for the encoding used by Windows with Arabic support 
% how to install it:
% with LaTeX2e, say "\usepackage {arabwin}"
% with LaTeX 2.09, add the style option "arabwin"
% with Plain TeX, say "\input arabwin.sty"
% how to activate it: say "\setcode {arabwin}"
% 10.04.1997
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Isam G. Ishaq
%     (isam0732@mailszrz.zrz.TU-Berlin.DE) 
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\UsePackage {asmo449}		\catcode `\@ = 11
\a@ident {arabwin.sty} {3.05 Arabic Windows encoding} {10.04.1997}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \win@scan #1>{% modified scanner call: token sequence -> \a@tokens
\iftest@scan \ifshow \else \lowercase {\a@verb #1>}\fi
\tracingmacros = 1 \fi
\gdef \a@rest {}\a@tokens = {}\lowercase {\sc@beg #1\@ \@@ }% transform
\iftest@scan \tracingmacros = 0 %
\expandafter \a@verb \expandafter (\the\a@tokens )>\fi }

\def \win@endscan \@@ {\gdef \a@scan {\win@scan }}

\def \win@back #1\@ \@@ {% end scanning, push back into input
\gdef \a@scan {\a@@scan }%
\gdef \a@rest {#1 \reset@win }%
\global\let \test@token \test@rest }

\def \reset@win {% after pushback
\gdef \a@scan {\win@scan }%
\gdef \sc@endscan {\win@endscan }}

\def \a@c@reset@win {% after pushback
\reset@win \test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcount \win@s  \newcount \win@d      

\def \awin@loop #1#2#3{% transform characters
\win@s = #1 \win@d = #2 \loop \lccode \win@s = \win@d
\advance \win@d 1 \advance \win@s 1     \ifnum \win@d < #3 \repeat }

\def \set@awin {% substitute scanner for Windows with Arabic support 
\awin@loop {160}{32}{44}	% arabic space (NBSP)
\awin@loop {161}{44}{45}	% arabic comma
\awin@loop {173}{45}{46}	% soft hyphen
\awin@loop {186}{59}{60}	% arabic semicolon
\awin@loop {191}{63}{87}
\awin@loop {216}{87}{91}
\awin@loop {220}{96}{100}
\awin@loop {225}{100}{101}	% lam
\awin@loop {227}{101}{105}
\awin@loop {236}{105}{107}
\awin@loop {240}{107}{111}
\awin@loop {245}{111}{113}
\awin@loop {248}{113}{114}
\awin@loop {250}{114}{115}

\win@d = 193   \win@s = 225
\loop \catcode \win@s = 11 \catcode \win@d = 11 % make letters
\advance \win@d 1 \advance \win@s 1     \ifnum \win@d < 224 \repeat

\catcode 192 = 10  \catcode 255 = 15  \catcode 220 = 12

\set@asmo          \global\let \a@scan \win@scan 
\a@first = {^^dc}
\let \sc@back \win@back	\let \sc@endscan \win@endscan 
\message {input encoding set to Windows cp1256 conventions}}

\xpa \def \xpa \sc@table \xpa {\sc@table % add the CP 1256 encoding
arabwin\set@awin	cp1256\set@awin	}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\message {scanner for Arabic Windows encoding (CP1256) installed.}
\setcode {arabwin}

\catcode `\@ = \asmoatcode % !!
\endinput
%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%