File: apatch.sty

package info (click to toggle)
arabtex 3.10-5
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 2,848 kB
  • ctags: 4
  • sloc: makefile: 44; sh: 23
file content (881 lines) | stat: -rw-r--r-- 28,188 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% apatch.sty
% last minute corrections
% see \datum and \level at the end of the file
% template: 16.09.2001
\version = {3.10}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% this is just another *.sty file
% you do not have to do any manual patching
% just put this file onto the TEXINPUT path
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chardef \patchatcode = \catcode`\@            \catcode`\@ = 11
\chardef \patchdqcode = \catcode`\"            \catcode`\" = 12

\edef \next {\the\version}
\ifx \next \theversion \else \edef \next {\errmessage 
{This patch file only works with ArabTeX version \the\version }}
\next \def \a@patchlevel {-undefined-}
\xpa \endinput 
\fi

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

% presently no patches

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% two passes with LaTeX;  see: alatex.sty

%\iffalse			% no patches yet; otherwise: delete !
\ifx \LaTeX \undefined \else
\ifx \a@patchlevel \undefined % first patching run
\let \a@@@document \a@document
%\let \a@@document \document	
%\def \document {\a@@document \setnone \input {apatch.sty}}
%\def \document {\setnone \input {apatch.sty}\a@@document }
\a@extend \document {\setnone \input {apatch.sty}}
\else % second pass after loading all modules
\let \a@document \a@@@document
\fi\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% patch patterns:

\ifx \a@patchlevel \undefined % load only the first time
% patches on first pass
\else
% patches on second pass
\fi

\ifx \a@hebr \undefined \else
%\a@message {Hebrew mode patches}
\fi

\ifx \LaTeX \undefined \else
%\a@message {LaTeX mode patches}
\fi
%\fi 				% no patches yet; otherwise: delete !

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {17.09.2001}		\def \level {-}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% abidir.sty

\def \a@Rdimen #1{% get the dimensions of the first two words
\setbox\a@Rboxii \hbox {}\setbox\a@Rdummyii \box\a@Rboxii
\a@Rfirst #1 \to \a@wordi \a@Rrest
\xpa \a@Rwordtobox \a@wordi \to \a@Rboxi \a@Rdummyi
\ifx \space \a@Rrest \else
\ifx \relax \a@Rrest \relax \else 
\xpa \a@Rfirst \a@Rrest \to \a@wordii \a@Rrest 
\xpa \a@Rwordtobox \a@wordii \to \a@Rboxii \a@Rdummyii 
\fi\fi }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% atrans.sty

\gdef \x@s #1{\oalign{#1\crcr\hidewidth \sh@ft{34}% accent for _h
    \vbox to -.2ex {\hbox{\char'25}\vss}\hidewidth}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% acmd.sty

\def \a@c@protect {\test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabtex.sty

\ifx \@\undefined \def \@{@}\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabtex.tex

\ifx \LaTeX \undefined 
\font \xnash	=xnsh14       
\font \xnashbf	=xnsh14bf       
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% abidir.sty

% todo: check!

\def \a@RL {% RL insertion inside Ltext
%\lineskiplimit -20pt	% enforce uniform baselines 
% deleted, problems within \tabular
\bgroup \arab@codes \set@arabfont \@waslafalse \@wasfalse \a@@Rinsert }

\def \a@RL {% RTL insertion inside LRtext
\lineskiplimit -.9\baselineskip % enforce uniform baselines 
\bgroup \arab@codes \set@arabfont \@waslafalse \@wasfalse \a@@Rinsert }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx \a@hebr \undefined \else
% Hebrew patches
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hewrite.sty -> 3.10a

\gdef \h@put@mid #1#2+#3*#4<{% deposit character         
% c m1 + m2 * c <
%	\def \next {\heb@mid #4}%
\ifnum \act@cd = \hc@@ \relax \h@put@ill \else   % illegal character
\case #1\of
{	B{\put@maqqef \def \next {\heb@end #4}}
	K{\put@box {$|$}}
	M{\put@box {$\Box$}}
       WN{\put@phantom }
        y{\h@ylig #4<}
        w{\h@wlig #4<}
\default {\h@putchar }
}\endcase
\fi \heb@accent #2+#3*\h@kern 
\ifnum \act@cd = \hc@l \smash {\unhbox \ab@x }\else \unhbox \ab@x 
\fi }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% heparse.sty -> 3.10a

\gdef \test@cont #1{% vowel contact? put dummy if not cholem male
\ifx #1O\def \next {\syl@con #1}\else
\ifx #1U\def \next {\syl@con #1}\else
\if\is@vowel #1\def \next {\syl@con N#1}\else
\def \next {\syl@con #1}\fi\fi\fi \next }

\def \test@patf #1{% vowel contact? put dummy, test for guttural: 05.10.01
\ifx #1O\def \next {\test@p@tf #1}\else
\ifx #1U\def \next {\test@p@tf #1}\else
\if\is@vowel #1\def \next {\syl@con N#1}\else
\def \next {\test@p@tf #1}\fi\fi\fi \next }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\a@message {Hebrew mode patches}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {06.10.2001}		\def \level {a1}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% alatex.sty

\ifx \LaTeX \undefined \else

\def \@footnotetext {% new, do not yet read footnote text
\insert \footins \bgroup 
\ifx \footglue \undefined % prepare normal footnote
\interlinepenalty \interfootnotelinepenalty \floatingpenalty \@MM 
\splittopskip \footnotesep \splitmaxdepth \dp \strutbox 
\else \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }%
\setbox0=\hbox \bgroup % fnpara.sty is present
\floatingpenalty=20000 \footnotesize \fi 
\edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
\a@mkfntext }

\def \@mpfootnotetext {\global \setbox \@mpfootins \vbox \bgroup
\edef \@currentlabel {\csname p@mpfootnote\endcsname \@thefnmark }%
\unvbox \@mpfootins \reset@font \a@mkfntext }

\def \a@c@footnote {% ArabTeX-LaTeX version
\def \@foot {\ifx \footglue \undefined \unskip \strut % normal case
\else \penalty-10 \hskip\footglue \egroup % box 0
\dp0=0pt \ht0=\fudgefactor\wd0 \box0 % fnpara.sty is present
\fi \egroup \arab@codes \set@arabfont \test@token }%
\def \@footnotemark {\iftrans \unskip \,\nobreak \@makefnmark {\,}\fi 
\ifarab \a@spacefalse \putwordb@x \@makefnmark \a@spacetrue \fi }%
\footnote }

\def \a@c@footnotemark {% ArabTeX-LaTeX version
\def \@footnotemark {\iftrans \unskip \,\nobreak \@makefnmark {\,}\fi 
\ifarab \a@spacefalse \putwordb@x \@makefnmark \a@spacetrue \fi 
\arab@codes \test@token }%
\unarab@codes \footnotemark }

\def \a@c@footnotetext {%
\footnotetext }

\def \a@fntext {% common part for footnote text
\rm \parindent \a@parindent \unarab@codes 
\footnotesize \hsize \columnwidth \@parboxrestore \clubpenalty 5000
\@makefntext {\rule {\z@ }{\footnotesep }}\futurelet \next \fo@t }

\def \a@@fntext #1{% common part for footnote text
\def \@footnotemark {\a@spacefalse \putwordb@x \@makefnmark \a@spacetrue }%
\def \end {\a@par \egroup \test@token }%
\a@hsize \columnwidth \hsize \columnwidth \@parboxrestore 
\initlineb@x \putwordb@x \@makefnmark \a@spacetrue
\arabtrue \test@token #1 \end }

\def \LRfootnotes {% right to left, Arabic text
\def \a@mkfntext {\a@fntext }}

\LRfootnotes

\def \RLfootnotes {% right to left, Arabic document
\def \a@mkfntext {\a@@fntext }}

\def \arabfootnotes {% right to left, Arabic document
\def \a@mkfntext {\a@@fntext }}

\fi % LaTeX

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {12.02.2002}			\def \level {b}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabtex.sty

\ifx \nil \undefined \def \nil {NIL}\fi

\setarab % correct patching effect

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% alatex.sty

\ifx \LaTeX \undefined \else

\def \a@@mkfntext {% common part for LR footnote text
\footnotesize \hsize \columnwidth \@parboxrestore \clubpenalty 5000
\@makefntext {\rule {\z@ }{\footnotesep }}\futurelet \next \fo@t }

\def \a@fntext {% common part for LR footnote text, Roman mode
\rm \parindent \a@parindent \unarab@codes \a@@mkfntext }

\def \a@c@footnote {% ArabTeX-LaTeX version
\def \@foot {\ifx \footglue \undefined \unskip \strut % normal case
\else \penalty-10 \hskip\footglue \egroup % box 0
\dp0=0pt \ht0=\fudgefactor\wd0 \box0 % fnpara.sty is present
\fi \egroup \arab@codes \set@arabfont \test@token }%
\def \@footnotemark {\iftrans \unskip \,\nobreak \@makefnmark {\,}\fi 
\ifarab \a@spacefalse \putwordb@x \@makefnmark \a@spacetrue \fi }%
\let \a@mkfntext \a@mk@fntext \footnote }

\def \a@@@fntext #1{% common part for RL footnote text, Roman mode
\def \@footnotemark {\a@spacefalse \putwordb@x \@makefnmark \a@spacetrue }%
\def \end {\a@par \egroup }%
\a@hsize \columnwidth \hsize \columnwidth \@parboxrestore 
\the\arabtext@hook \putwordb@x \@makefnmark \a@spacetrue
\test@token #1 \end }

\def \a@c@footnotetext {%
\let \a@mkfntext \a@mk@fntext \footnotetext }

\def \LRfootnotes {% right to left, Arabic text
\def \a@mk@fntext {\a@fntext }
\def \a@mkfntext {\a@@mkfntext }}

\LRfootnotes

\def \RLfootnotes {% right to left, Arabic document
\def \a@mk@fntext {\a@@fntext }%
\def \a@mkfntext {\a@@@fntext }}

\def \arabfootnotes {% right to left, Arabic document
\def \a@mk@fntext {\a@@fntext }%
\def \a@mkfntext {\a@@@fntext }}

\fi % LaTeX

\iffalse
\def \def@arabstrut {\def \arab@strut {\if@vocals 
%\vrule height2.5ex depth2.0ex width\z@ \relax \else
\vrule height2ex depth1.5ex width\z@ \relax \else
%\vrule height3ex depth1.5ex width\z@ \relax \else
\vrule height2ex depth1.0ex width\z@ \relax \fi }}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabext.sty

\def \a@endtabular {\a@@endtabular \advance \parfillskip \rightskip 
\rightskip \leftskip \leftskip \parfillskip \parfillskip \z@ \par }

\def \a@c@hline {% \\ missing
\errmessage{table row not terminated: \string\\ inserted; proceed.}%
\test@token \\ \hline }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% abjad.sty

\def \abjad #1{% inside a Roman environment
\edef \the@bjad {\abj@d {#1}}%
\novocalize \arabtrue \transfalse \RL {\stdcode {\the@bjad }}%
\iftrans {\set@transfont \ \trans@text #1 \end }\fi }

\allowarab \the@bjad

% NOTE: \abj@d is fully expandable

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ascan.sty

\def \setcode #1{% switch the input encoding
\lowercase {\def \sc@code {#1}%
\ifx \sc@code \sc@oldcode \else
\begingroup \def \sc@lookup ##1#1##2##3\@@ {\endgroup ##2}%
\xpa \sc@lookup \sc@table #1\sc@default \@@ \fi }%
\let \sc@oldcode \sc@code }

\pdef \stdcode #1{% prepare temp switch to standard
\let \a@oldcode \sc@code \sc@standard \test@token #1 \@stdcode }

\def \a@c@@stdcode {\xpa\setcode\xpa{\a@oldcode }}

\all@w@ne \stdcode
\xpa \all@w@ne \csname stdcode \endcsname

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabrep.cls

\ifx \a@part \undefined \else

% tableofcontents = al-mu.htawayAtu
% listoffigures = qA'imaTu al-.suwaru
% listoftables = qA'imaTu al-^gadAwilu
% listofpictures = qA'imaTu al-rusUmu
% bibliography = al-marA^gi`u
% references = al-ma.sAdiru
% index = al-fihrisu (al-fihristu)
% chapter = al-fa.slu
% appendix = al-mul.haqu
% abstract = al-mula_h_ha.su
% attachments = al-murfaqAtu
% number = al-raqmu

\def\bibname        {\stdcode{al-marA^gi`u}}
\def\refname        {\stdcode{al-ma.sAdiru}}
\def\indexname      {\stdcode{al-fihristu}}
\def\figurename     {\stdcode{.sUraTuN}}
\def\tablename      {\stdcode{^gadwaluN}}
\def\partname       {\stdcode{al-^guz'u}}
\def\chaptername    {\stdcode{al-fa.slu}}
\def\appendixname   {\stdcode{al-mul.haqu}}
\def\abstractname   {\stdcode{al-mula_h_ha.su}}

\at@arabtext {% switch to Arabic terms
\def\contentsname   {\stdcode{al-mu.htawayAtu}}
\def\listfigurename {\stdcode{qA'imaTu al-.suwari}}
\def\listtablename  {\stdcode{qA'imaTu al-^gadAwili}}
}
\fi

\def\a@makechapterhead #1{% make heading with number
	\null \vskip 50\p@ 
\begingroup \let \end \a@@par \a@@raggedright \interlinepenalty\@M
	\a@normalfont \bfseries
	\ifnum \c@secnumdepth >\m@ne
	\if@mainmatter
		\edef \thechapter {\thechapter }%
		\huge \set@arabfont \test@token \@chapapp {\thechapter} \end 
		\nobreak \vskip 20\p@
	\fi\fi
	\Huge \set@arabfont \test@token #1 \end 
	\nobreak \vskip 40\p@
\endgroup }

\allowarab \@chapapp

\def\a@c@appendix{%\par
	\setcounter{section}{0}%
	\renewcommand\@chapapp {\appendixname }%
\ifa@article \renewcommand\thesection {\@abjad \c@section }%
	\setcounter{subsection}{0}%
\else \renewcommand\thechapter {\@abjad \c@chapter }%
	\setcounter{chapter}{0}%
\fi \test@token }

\def \a@chapter [#1]#2{% numbered chapter
\ifnum \c@secnumdepth >\m@ne
	\if@mainmatter
		\refstepcounter {chapter}%
		\typeout {\@chapapp \space \thechapter.}%
		\addcontentsline {toc}{chapter}%
		{\protect\numberline 
		{\protect\RL{\protect\stdcode{\thechapter }}}%
		\protect\RL {#1}}%
	\else \addcontentsline {toc}{chapter}{\protect\RL {#1}}%
	\fi		     
\else \addcontentsline {toc}{chapter}{\protect\RL {#1}}%
\fi
\chaptermark{\RL {#1}}%
\addtocontents {lof}{\protect\addvspace {10\p@}}%
\addtocontents {lot}{\protect\addvspace {10\p@}}%
\if@twocolumn \@topnewpage [\a@makechapterhead {#2}]%
\else 	\a@makechapterhead {#2}\a@afterheading
\fi \test@token }

\long\def \a@@caption #1[#2]#3{\par 
	\addcontentsline {\csname ext@#1\endcsname}{#1}
	{\protect\numberline {\csname the#1\endcsname}\protect\RL {#2}}%
\begingroup \@parboxrestore \normalsize
	\def \protect {\nxp\protect\nxp}
	\edef \thecaption {\csname fnum@#1\endcsname }%
	\let \protect \relax
	\@makecaption {\RL {\thecaption }}{\RL {#3}}\par
\endgroup \test@token }

\long\def \a@makecaption #1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\RL{#1: #2}}%
  \ifdim \wd\@tempboxa >\hsize
\begin{arabtext}    #1: #2
\end{arabtext}
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip }

\allowarab \caption
\allowarab \thecaption

\at@arabtext {\let \@caption \a@@caption 
\let \@makecaption \a@makecaption }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% alists.sty: move to abjad.sty or alatex.sty!
% see arabrep.cls

\def \Abjad #1{\xpa \@Abjad \csname c@#1\endcsname }

\let \@Abjad \abj@d

%\let \@abjad \@abj 	\let \@Abj \@abj 	

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% asect.sty

\def\a@sect #1#2#3#4#5#6[#7]#8{% Arabic mode
\ifnum #2 > \c@secnumdepth \let \@svsec \@empty 
\else \refstepcounter{#1}%
	\edef \@svsec 
	{\nxp\RL {\nxp\stdcode {\csname the#1\endcsname }\hskip 1em}}%
\fi
\@tempskipa #5\relax
\ifdim \@tempskipa > \z@
	\begingroup \let \end \a@@par 
		#6\relax \set@arabfont % style
	        \a@hangfrom {\hskip #3\relax \@svsec }% section number
		\test@token #8 \end
	\endgroup
	\csname #1mark\endcsname {\RL {#7}}%
	\addcontentsline {toc}{#1}%
		{\ifnum #2 > \c@secnumdepth \else \protect\numberline 
		{\protect\RL{\protect\stdcode{\csname the#1\endcsname }}}\fi
		\protect\RL {#7}}%
\else \def \@svsechd {% saved head, executed by \everypar
	#6\relax \set@arabfont % style
	\let \a@@end \end \def \end {\let \end \a@@end }%
	\test@token \@svsec % saved section number
	\hskip #3\relax #8 \end
        \csname #1mark\endcsname {\RL {#7}}%
	\addcontentsline {toc}{#1}%
		{\ifnum #2>\c@secnumdepth \else \protect\numberline 
		{\protect\RL{\protect\stdcode{\csname the#1\endcsname }}}\fi
		\protect\RL {#7}}}% \@svsechd
\fi \a@xsect {#5}}

\allowarab \@svsec
 
\def\a@xsect #1{% Arabic mode
\@tempskipa #1\relax
\ifdim \@tempskipa>\z@ \a@@par \nobreak \vskip \@tempskipa
       \a@afterheading
\else \global\@nobreakfalse \global\@noskipsectrue
\a@@everypar {\if@noskipsec \global\@noskipsecfalse \clubpenalty \@M 
        	\putwordb@x {\hskip -\a@parindent }\@svsechd
        	\putwordb@x {\hskip -#1\relax }%
             \else \clubpenalty \@clubpenalty \a@@everypar {}%
             \fi}
\fi \a@spacefalse \test@token }

\def \a@c@numberline #1{% external Arabic command
\a@c@hspace {-\@tempdima }\spreadbox \@tempdima {#1 \hfill }}

\def \a@@lsection #1#2#3{% Text, Pageno, Font
% common part for \part and \section
	\begin{arabtext}
	#3\tocp@rs {\z@ }{\@tempdima }#1 \hfill \thep@geno {#2}
	\end{arabtext}}

\def \a@dottedtocline #1#2#3#4#5{% Level, Indent, Numwidth, Text, Pageno
% for Arabic mode
\ifnum #1>\c@tocdepth 
\else \vskip \z@ plus.2\p@
	\begin{arabtext}
	\tocp@rs {#2}{#3}#4 {\le@ders \thep@geno {#5}}
	\end{arabtext}
\fi }

\def \a@c@tocp@rs #1#2{% Indent, Numwidth
% change toc parameters
\leftskip #1\relax \advance \leftskip #2\relax 
\advance \rightskip \@tocrmarg 
\@tempdima #2\relax % for \numberline, width of number
\a@parindent \z@ \parfillskip \z@ \test@token }

\at@arabtext {% modify LaTeX for Arabic mode
	\let \numberline \a@numberline
	\let \@dottedtocline \a@dottedtocline
}

\c@secnumdepth \c@tocdepth % for test TOC

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabrep.cls

\def \a@l@section #1#2{% Text, Pageno
% for arabic mode
\ifnum \c@tocdepth >\z@
	\addpenalty {\@secpenalty }%
	\addvspace {1.0em plus\p@ }%
%	\@tempdima 1.5em 
	\@tempdima 1.0em 
%	\@tempdima \if@twocolumn 1.0em \else 1.5em \fi \relax
	\a@@lsection {#1}{#2}{\a@normalfont \bfseries }%
\fi }

\def \a@l@part #1#2{% Text, Pageno
% for arabic mode
\ifnum \c@tocdepth >-2\relax
	\addpenalty {-\@highpenalty }%
	\addvspace {2.25em plus\p@ }%
	\@tempdima 2.0em 
%	\@tempdima \if@twocolumn 2.0em \else 3.0em \fi \relax
	\a@@lsection {#1}{#2}{\a@normalfont \large \bfseries }%
\fi }

\def \a@l@chapter #1#2{% Text, Pageno
% for arabic mode
\ifnum \c@tocdepth >\m@ne
	\addpenalty {-\@highpenalty }%
	\addvspace {1.0em plus\p@ }%
%	\@tempdima 1.5em 
	\@tempdima 1.0em 
%	\@tempdima \if@twocolumn 1.0em \else 1.5em \fi \relax
	\a@@lsection {#1}{#2}{\a@normalfont \bfseries }%
      	\penalty\@highpenalty
\fi }

\def \a@x@sect {% arabic section TOC formats if article
	\def\a@l@subsection{\@dottedtocline{2}{1.0em}{1.5em}}
	\def\a@l@subsubsection{\@dottedtocline{3}{2.5em}{2.1em}}
	\def\a@l@paragraph{\@dottedtocline{4}{4.6em}{2.8em}}
	\def\a@l@subparagraph{\@dottedtocline{5}{9.4em}{3.4em}}
}

\def \a@y@sect {% arabic section TOC formats if report or book
	\def\a@l@section{\@dottedtocline{1}{1.0em}{1.5em}}
	\def\a@l@subsection{\@dottedtocline{2}{2.5em}{2.1em}}
	\def\a@l@subsubsection{\@dottedtocline{3}{4.6em}{2.8em}}
	\def\a@l@paragraph{\@dottedtocline{4}{9.4em}{3.4em}}
	\def\a@l@subparagraph{\@dottedtocline{5}{23.8em}{4.1em}}
}

\def \a@xy@sect {% arabic section TOC formats
\ifa@article \a@x@sect \else \a@y@sect \fi }

\def \a@c@tableofcontents {\a@xy@sect % define arabic section TOC formats
\a@t@ble {\contentsname }{toc}}

% CAUTION: \a@xy@sect must be executed before expanding \the\arabtex@hook
%          and prior to \@starttoc within \a@t@ble, see arabrep.cls

\def\a@l@figure{\@dottedtocline{1}{1.0em}{1.5em}}
\def\a@l@table{\@dottedtocline{1}{1.0em}{1.5em}}

\at@arabtext {% switch to Arabic terms, execute from asect::a@t@ble
	\let \l@part \a@l@part
	\let \l@chapter \a@l@chapter
	\let \l@section \a@l@section
	\let \l@subsection \a@l@subsection
	\let \l@subsubsection \a@l@subsubsection
	\let \l@paragraph \a@l@paragraph
	\let \l@subparagraph \a@l@subparagraph
	\let \l@figure \a@l@figure
	\let \l@table  \a@l@table
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {03.03.2002}			\def \level {c}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hebchrs.sty

\ifx \gedatcode \undefined \else
\a@extend \def@hebchars {% for gedalin.sty
\tc@def \a@M {\act@cd \hc@mf }				% mem sofit
\tc@def \a@N {\act@cd \hc@nf }				% nun sofit
\tc@def \a@K {\act@cd \hc@kf }				% kaf sofit
\tc@def \a@P {\act@cd \hc@ff }				% peh sofit
\tc@def \a@Z {\act@cd \hc@sf }				% tsadeh sofit
}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {04.03.2002}			\def \level {c1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% asmo449.sty

\ifx \asmoatcode \undefined \else 

\def \asmo@beg #1#2{% start ASMO 449 scanner
	\h@mzafalse  \iz@fetfalse \novocalize % because of explicit quoting
	\@ssimfalse
	\def \next {\asmo@word #1#2}%
	\def \l@@kup ##1\\#1##2\\##3\@@ {% look for special chars
		\ifx *##2\relax\xpa\xpa\xpa\iffalse\fi\fi % not found; else
		\def \next {##2#2}}%
\iftrue \xpa \l@@kup \asmo@tbliv \\#1*\\\@@ \else 
\ifx #1/\global \a@tokens ={#1}\def \next {\asmo@word #2}% /x
\fi\fi \next }

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% utfcode.sty

\ifx \utfatcode \undefined \else 

\def \utf@beg #1#2{% start UTF-8 scanner
\h@mzafalse  \iz@fetfalse \novocalize % because of explicit quoting
	\@ssimfalse
	\def \next {\utf@word #1#2}%
\ifnum `#1="D8 \ifnum `#2="27 \def \next {\utf@alif }\fi \else
%\ifx #1"\def \next {\utf@lquote #2}\else
\ifx #1/\global \a@tokens ={#1}\def \next {\utf@word #2}\else % x>
%\fi
\fi\fi \next }

\def \utf@dvii #1{% segment D7
	\a@lb `#1\relax \advance \a@lb -128 
	\a@lq \a@lb \divide \a@lq 8
\ifcase \a@lq \edef \sc@char 
	{\ifcase \a@lb
	K\or "\n@xp\a@Ze\or "\n@xp\a@Za\or :\or "\n@xp\a@Zi\or \or \or \or
	\fi }%
\or \advance \a@lb  -8 \edef \sc@char {}%
\or \advance \a@lb -16 \edef \sc@char 
	{\ifcase \a@lb
	Q\or b\or g\or d\or h\or w\or z\or X\or
	\fi }%
\or \advance \a@lb -24 \edef \sc@char 
	{\ifcase \a@lb
	C\or y\or k\or k\or l\or m\or m\or n\or
	\fi }%
\or \advance \a@lb -32 \edef \sc@char 
	{\ifcase \a@lb
	n\or s\or P\or p\or p\or S\or S\or q\or
	\fi }%
\or \advance \a@lb -40 \edef \sc@char 
	{\ifcase \a@lb
	r\or \n@xp\a@S \or t\or \or \or \or \or \or
	\fi }%
\or \advance \a@lb -48 \edef \sc@char 
	{\ifcase \a@lb
	w\n@xp\a@U w\or wy\or y\n@xp\a@U y\or '\or 
	''\or \or \or \or
	\fi }%
\or \advance \a@lb -56 \edef \sc@char 
	{\ifcase \a@lb
	\or \or \or \or \or \or \or "|\or
	\fi }%
\fi \utf@next }

\def \utf@dvii #1{% segment D7
	\u@lb `#1\relax \advance \u@lb -128 
	\u@lq \u@lb \divide \u@lq 8
\ifcase \u@lq \edef \sc@char 
	{\ifcase \u@lb
	K\or "\n@xp\a@Ze\or "\n@xp\a@Za\or :\or "\n@xp\a@Zi\or \or \or \or
	\fi }%
\or \advance \u@lb  -8 \edef \sc@char {}%
\or \advance \u@lb -16 \edef \sc@char 
	{\ifcase \u@lb
	Q\or b\or g\or d\or h\or w\or z\or X\or
	\fi }%
\or \advance \u@lb -24 \edef \sc@char 
	{\ifcase \u@lb
	C\or y\or k\or k\or l\or m\or m\or n\or
	\fi }%
\or \advance \u@lb -32 \edef \sc@char 
	{\ifcase \u@lb
	n\or s\or P\or p\or p\or S\or S\or q\or
	\fi }%
\or \advance \u@lb -40 \edef \sc@char 
	{\ifcase \u@lb
	r\or \n@xp\a@S \or t\or \or \or \or \or \or
	\fi }%
\or \advance \u@lb -48 \edef \sc@char 
	{\ifcase \u@lb
	w\n@xp\a@U w\or wy\or y\n@xp\a@U y\or '\or 
	''\or \or \or \or
	\fi }%
\or \advance \u@lb -56 \edef \sc@char 
	{\ifcase \u@lb
	\or \or \or \or \or \or \or "|\or
	\fi }%
\fi \utf@next }

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% cp1256.sty

\ifx \awinatcode \undefined \else 

\def \awin@catcodes {% assignments for MAC Hebrew
\countdef \is@m=2	\countdef \is@n=4       
\is@m = 128        \is@n = 64
\loop \ifnum \catcode \is@m = 11 \else \catcode \is@m = 11 \fi
\global\lccode \is@m = \is@n
\ifnum 159 > \is@m \advance \is@m 1 \advance \is@n 1 \repeat
\is@m = 160        \is@n = 32
\loop \ifnum \catcode \is@m = 11 \else \catcode \is@m = 11 \fi
\global\lccode \is@m = \is@n
\ifnum 255 > \is@m \advance \is@m 1 \advance \is@n 1 \repeat
\is@m=0 \is@n=0 \catcode `\^^a0 12 }

\gdef \awin@beg #1{% start CP 1256 scanner
\h@mzafalse  \iz@fetfalse \yahdots \novocalize % because of explicit quoting
	\@ssimfalse
%\urd@true
\ifx #1^^c7\def \next {\awin@alif}\else
\def \next {\awin@word #1}\fi \next }

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% isiri.sty

\ifx \isiriatcode \undefined \else 

\def \isiri@catcodes {% assignments for ISIRI 3342
\countdef \is@m=2	\countdef \is@n=4       
\is@m = 160        \is@n = 32
\loop \ifnum \catcode \is@m = 11 \else \catcode \is@m = 11 \fi
\global\lccode \is@m = \is@n
\ifnum 255 > \is@m \advance \is@m 1 \advance \is@n 1 \repeat
\is@m=0 \is@n=0 \catcode `\^ 7 \catcode `\^^a0 12 }

\gdef \isi@beg #1#2{% start ISIRI 3342 scanner
\h@mzafalse  \iz@fetfalse \yahdots \novocalize % because of explicit quoting
	\@ssimfalse
\case #1\of 
{      \@{\sc@endscan #2}                % finished
     ^^c1{\isi@alif@beg #2} 
     ^^e6{\isi@lquote #2}
\default {\isi@word #1#2}
}\endcase }

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% amac.sty

\ifx \amacatcode \undefined \else 

\def \amac@catcodes {% assignments for MAC Hebrew
\countdef \is@m=2	\countdef \is@n=4       
\is@m = 128        \is@n = 64
\loop \ifnum \catcode \is@m = 11 \else \catcode \is@m = 11 \fi
\global\lccode \is@m = \is@n
\ifnum 159 > \is@m \advance \is@m 1 \advance \is@n 1 \repeat
\is@m = 160        \is@n = 32
\loop \ifnum \catcode \is@m = 11 \else \catcode \is@m = 11 \fi
\global\lccode \is@m = \is@n
\ifnum 255 > \is@m \advance \is@m 1 \advance \is@n 1 \repeat
\is@m=0 \is@n=0 \catcode `\^^a0 12 }

\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabrep.cls
% restore LaTeX version, delete \a@caption!

\long\def\@caption#1[#2]#3{%
  \par
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
  \begingroup
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

\long\def \a@caption #1[#2]#3{\par 
	\addcontentsline {\csname ext@#1\endcsname}{#1}
	{\protect\numberline {\csname the#1\endcsname}\protect #2}%
\begingroup \@parboxrestore \normalsize
	\protected@edef \reserved@a {\csname fnum@#1\endcsname }%
	\xpa\@makecaption \xpa{\xpa\RL \xpa{\reserved@a }}{#3}\par
\endgroup}

%\let \@caption \a@caption 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% alists.sty

\def \a@@item [#1]{% for arabic lists running from right to left
\if@noparitem \a@@donoparitem \else 
	\if@inlabel \putwordb@x {\arab@space }\a@@par \fi
	\a@@par 
	\if@newlist \if@nobreak \@nbitem \else 
		\addpenalty \@beginparpenalty
		\addvspace \@topsep \addvspace {-\a@parskip }\fi
	\else \addpenalty \@itempenalty \addvspace \itemsep
	\fi \global \@inlabeltrue
\fi
\a@@everypar {\global \@minipagefalse \global \@newlistfalse
	\if@inlabel \global \@inlabelfalse \a@spacefalse
		\putwordb@x {\box \@labels \hskip -\a@parindent }%
	\fi \a@@everypar {}}%
\global \@nobreakfalse
\if@noitemarg \@noitemargfalse
	\if@nmbrlist \refstepcounter {\@listctr }\fi
\fi
\setbox \@tempboxa \hbox {\makelabel {#1}}%
\global \setbox \@labels \hbox
        {\hskip \labelsep
        \ifdim \wd \@tempboxa >\labelwidth \box \@tempboxa
               \else \hbox to\labelwidth {\unhbox \@tempboxa }\fi
        \hskip \itemindent \hskip -\labelwidth \hskip -\labelsep
        \unhbox \@labels }%
%\test@token }
\arab@tail }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabext.sty

\def \a@@table [#1]{% table within Arabic environment
\let \a@endtable \endtable \def \endtable {\a@par \a@endtable }%
\table [#1]%
%\arab@codes 
%\test@token }
\arab@tail }

\def \a@@figure [#1]{% figure within Arabic environment
\let \a@endfigure \endfigure \def \endfigure {\a@par \a@endfigure }%
\figure [#1]%
%\arab@codes 
%\test@token }
\arab@tail }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {07.03.2002}			\def \level {d}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifx \a@patchlevel \undefined % first patching run
\a@ident {apatch.sty} 
	{\the\version\level\space last minute patches } {\the\datum}
	\edef \a@patchlevel {\the\version \level \space (\the\datum)}
\else \a@message {version \a@patchlevel: second phase of patching}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\catcode`\" = \patchdqcode	\catcode`\@ = \patchatcode
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%