%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% apatch.sty
% last minute corrections
% see \version, \datum and \level at the end of the file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version = {3.02}             	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% presently no patches

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {14.07.94}		\def \level {}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chardef \patchatcode = \catcode`\@            \catcode`\@ = 11

% arabtex.sty

\ifx \a@@document \undefined
\let \a@@document \a@document % sentinel
\def \a@document {\a@@document \setnone \input apatch.sty } % load twice
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% aparse.sty

% correct tanwin + alif maqsura
\def \syl@ignore #1{% kill the rest after Tanwin except U, A, and Y
	\let \next \syl@ignore 
\ifx #1-\else
\ifx #1U\put@con w\put@syl \else
\ifx #1A\put@con a\put@syl \else
\ifx #1Y\put@con Y\put@syl \else
\ifcat #1a\else % tie
       \def \next {\syl@con #1}%
\fi\fi\fi\fi\fi \next }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hescan.sty

\ifx \sethed@codes \undefined \else % load only if Hebrew loaded
% correct Chet versus He
% dynamic definitions for Hebrew
{\catcode `\ =9 \catcode `\^^M=9 \catcode `\^^I=9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef \sethed@codes {\seta@codes % activate and change some codes
\globaldefs=1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \sc@A {v}   \def \sc@B {g}   \def \sc@C {d}   \def \sc@D {h}
\def \sc@E {w}   \def \sc@F {z}   \def \sc@G {X}   \def \sc@H {V}
\def \sc@I {y}   \def \sc@J {k}   \def \sc@K {k}   \def \sc@L {l}
\def \sc@M {m}   \def \sc@N {m}   \def \sc@O {n}   \def \sc@P {n}
\def \sc@Q {s}   \def \sc@R {P}   \def \sc@S {f}   \def \sc@T {f}
\def \sc@U {S}   \def \sc@V {S}   \def \sc@W {q}   \def \sc@X {r}
\def \sc@Y {\n@xp \a@S }  	  \def \sc@Z {t}	  
\def \sc@s {\n@xp \a@S }  	  \def \sc@@ {QQ}
\a@digits = {0123456789}	\a@paren  = {()[]}		
\a@first = {"`}
\globaldefs=0 
\lccode `-=`<% for Maqqeph 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}% end of dynamic definitions for Hebrew

% improved handling of Maqqeph
\def \hed@word #1#2{% transform input into internal notation
\def \next {\hed@word #2}%
\ifx #1>\let \next \relax \else
\ifx #1<\def \sc@char {B}\sc@put \else
\ifcat \noexpand #1a\ifx #1#2\def \next {\hed@word -#2}\fi
	\edef \sc@char {\csname sc@#1\endcsname }\sc@put
\else \def \sc@char {#1}\sc@put
\fi\fi\fi \next }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hewrite.sty

% special handling of apostrophe
\def \h@put@spec #1#2*#3<{% special character		% c m * c <
\ifx #1|\else \ifx #1--\else
\ifx #1!#1\else \ifx #1,#1\else \ifx #1.#1\else \ifx #1:#1\else
\ifx #1][\else \ifx #1[]\else
#1%
\fi\fi\fi\fi\fi\fi \kern 1pt%
\fi\fi 
\h@test@chr #3%
\ifx #1'\def \next {\heb@mid #3}\else \def \next {\heb@end #3}\fi }

\message {(hebtex.sty patched)}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {19.07.94}		\def \level {a}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% awrite.sty
% try to economize on diacritics

\def \tat@skip {0.04ex plus 0.2fil }

\def \put@hi #1{% upper modifier
\setbox0 \hbox {#1}\dimen@ \a@wd 
\advance \dimen@ -\wd0 \divide \dimen@ \tw@
\ifdim \z@ > \dimen@ \setbox0 \rlap {#1}\fi
\global\advance \a@ht \ht0 \global\advance \a@ht \dp0 
\global\setbox \ab@x   \vbox 
{\moveright \dimen@ \box0 \nointerlineskip
\ifvbox \ab@x \unvbox \ab@x \else \box \ab@x \fi }}

\def \put@lo #1{% lower modifier
\setbox0 \hbox {#1}\dimen@ \a@wd 
\advance \dimen@ -\wd0 \divide \dimen@ \tw@
\ifdim \z@ > \dimen@ \setbox0 \rlap {#1}\fi
\global\advance \a@dp \ht0 \global\advance \a@dp \dp0 
\global\setbox \ab@x   \vbox 
{\ifvbox \ab@x \unvbox \ab@x \else \box \ab@x \fi 
\nointerlineskip \moveright \dimen@ \box0 }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif \if@updia % \ifa@kern kann weg	!!!

\def \test@updia #1+#2*{% test for upper diacritic		% m21 + m22 *
\global\red@mod   #1 \relax
	\ifnum #1 > 9 \global\advance \red@mod -10 \fi
\@updiafalse
\ifnum \red@mod = 0 \else \ifnum \red@mod = 5 \else \@updiatrue
\fi\fi
\if@updia \else
	\ifnum #2 = 0 \else \ifnum #2 = 3 \else
	\ifnum #2 = 6 \else \ifnum #2 = 11 \else \@updiatrue 
	\fi\fi\fi\fi
\fi }

\def \under@cut #1*{% if no upper diacritic		% m2 *
\ifdim \a@dp > .5ex \@updiafalse \else \test@updia #1*\fi 
\if@updia \unkern \a@mkern \fi }

% aligs.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \aw@endligs #1#2*#3#4{% test for final ligatures
% c1 m1 * c2 c3
\ifcase \act@cls 
     \lam@lig #3#4% % 0 l
\or \test@in@list #1YyKL\a@E \a@y \a@Y >%	% 1 YntCbyp
	\ifin@list \yah@end #1#3#4\else
	\ifx #1E\yah@p@end #3#4\else
		\test@in@list #1n\a@N a@n >%
	\ifin@list \nun@end #1#3#4\else 
		\bah@end #1%
	\fi\fi\fi
\or \sin@lig #1#4%              		% 2 sxSD
\or \gim@lig #1#3#4%            		% 3 GHXJ
\or \global\@highfalse \set@mod@chr \put@tatwil % 4 cR
\or \kaf@end #3#4%              		% 5 kgM 
\or \fah@end #1%                		% 6 fqv
\or \sin@lig #1#4%              		% 7 VZ
\or \rah@end #1#2*#3#4%         		% 8 rzj \a@r \a@R
\or 	\ifx #1\a@n \nun@end #1#3#4\else	% 9 \a@t \a@n
	\ifx #1\a@N \nun@end #1#3#4\else \bah@end #1%
	\fi\fi
\else \global\@highfalse			% 10 ...
	\ifx #1\a@h \hah@urd #3%
	\else \set@mod@chr
		\ifx #1m\mim@end #2*#3#4\else
		\ifx #1d\gim@test #4\put@tatwil \else
		\ifx #1F\gim@test #4\put@tatwil \else \put@tatwil 
		\fi\fi\fi
	\fi
\fi }

%%%%%%%%%%%%%%%%%%%%%% gim %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \gim@one #1#2#3{% gim, hhah, khah, tchah
% and one char
% c1 c2 c3
%\ifligs
\ifcase \chr@cls            
    \act@gim #1\chr@tie = \a@lam@on@gim 	% 0 l
	\chr@cd = \a@space@spec
\or \act@gim #1\chr@tie = \a@g@to@bb 		% 1 YntCbyp
	\chr@cd = \a@space@spec 
\or \act@gim #1\chr@tie = \a@g@to@s 		% 2 sxSD
	\chr@sin #2\@raisetietrue
\or \act@gim #1%				% 3 GHXJ
\or % \act@gim #1%				% 4 cR
\or \act@gim #1%				% 5 kgM
\or \act@gim #1%				% 6 fqv
\else \ifx #2m\act@gim #1\chr@cd = \a@mim@spec \else \put@tatwil 
      \fi
%\fi
\fi }

\def \gim@more #1#2#3{% gim, hhah, khah, tchah
% and more than one char
% c1 c2 c3
\ifligs
\ifcase \chr@cls            
    \act@gim #1\chr@cd = \a@lam@spec@yah 	% 0 l
\or \act@gim #1\chr@tie = \a@g@to@mb 		% 1 YntCbyp
	\chr@cd = \a@bah@spec@yah
\or \act@gim #1\chr@tie = \a@g@to@s 		% 2 sxSD
	\chr@sin #2\@raisetietrue
\or % \act@gim #1%				% 3 GHXJ
\or % \act@gim #1%				% 4 cR
\or \act@gim #1%				% 5 kgM
\else \ifx #2m\ifx #3l\act@gim #1\chr@cd = \a@mim@lam@gim 
      \fi\fi
\fi
\fi }

%%%%%%%%%%%%%%%%%%%%%% lam %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \lam@lig #1#2{% lam family
% c2 c3
\ifnum \act@cd = \a@lam@spec@low \else
\set@mod@chr \gim@kaf@test #1#2%
\ifnum \act@cd = \a@lam@spec@yah \@raisetrue
\fi\fi }

%%%%%%%%%%%%%%%%%%%%%% mim %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \mim@end #1*#2#3{% final mIm 
% m1 * c2 c3
%\ifligs
\ifcase \chr@cls            		
    \act@cd = \a@mim@spec \test@end@char #3%	% 0 l
 	\ifend@char \else \chr@cd = \a@lam@spec@mim
	\fi
\or \act@cd = \a@mim@spec \test@end@char #3%	% 1 YntCbyp
	\ifend@char \chr@cd = \a@space@spec \chr@tie = \a@em@to@bb
	\else \chr@cd = \a@bah@end@mim
	\fi
\or \act@cd = \a@mim@spec 			% 2 sxSD
	\chr@tie = \a@em@to@s \chr@sin #2%
\or \act@cd = \a@mim@spec			% 3 GHXJ
\or \act@cd = \a@mim@spec			% 4 cR
\or \test@updia #1*% upper diacritic?		% 5 kgM
	\if@updia \put@tatwil 
	\else \act@cd = \a@mim@spec \chr@kaf #2%
	\fi
\or \act@cd = \a@mim@spec			% 6 fqv
\else	\ifx #2h\test@end@char #3%
		\ifend@char \act@cd = \a@mim@spec 
		\else \put@tatwil 
		\fi
	\else
	\ifx #2m\act@cd = \a@mim@spec \test@end@char #3%
		\ifend@char \chr@cd = \a@mim@spec
		\else \chr@cd = \a@mim@spec@high
		\fi
	\else \put@tatwil 
	\fi\fi
%\fi
\fi }

\def \mim@mid #1*#2#3{% medial mIm
% m1 * c2 c3
\ifligs
\ifnum \act@cd = \a@mim@spec@alif % s-m-a
	\ifnum \chr@cls = 2 \chr@sin #2%
	\fi
\else
\ifcase \chr@cls
    \test@end@char #3%				% 0 l
    \ifnum \act@cd = \a@mim@lam@gim \@raisetrue % l-m-^g
	\ifend@char \chr@cd = \a@lam@spec@hah
	\else \chr@cd = \a@lam@spec@yah
	\fi
	\test@updia #1*% upper diacritic?
	\if@updia \act@cd = \a@mim@spec@long
	\fi
    \else
    \ifend@char \act@mim@spec #1*\chr@cd = \a@lam@spec@mim
    \fi\fi
\or \act@mim@spec #1*\chr@cd = \a@bah@mid@mim	% 1 YntCbyp
\or \act@mim@spec #1*\chr@tie = \a@bah@mid@mim 	% 2 sxSD
	\@raisetietrue \chr@sin #2%
\or \act@cd = \a@mim@spec@high \gim@test #3%	% 3 GHXJ
\else	\ifnum 8 > \chr@cls \act@cd = \a@mim@spec@high \else
   	\ifx #2m\test@end@char #3%
	      \ifend@char \act@mim@spec #1*\chr@cd = \a@mim@spec@mim
	      \fi
   	\fi\fi
\fi
\fi
\else \put@tatwil 
\fi % ifligs
\ifnum \act@cd = \a@mim@spec \@raisetrue \else
\ifnum \act@cd = \a@mim@spec@long \@raisetrue \else
\ifnum \act@cd = \a@mim@spec@high \@raisetrue \else
\ifnum \act@cd = \a@mim@lam@gim \@raisetrue \else
\fi\fi\fi\fi }

\def \act@mim@spec #1*{% lam-mim etc.
\test@updia #1*% upper diacritic
\if@updia \act@cd = \a@mim@spec@long
\else \act@cd = \a@mim@spec % no diacritic
\fi }

%%%%%%%%%%%%%%%%%%%%%% rah %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \rah@end #1#2*#3#4{% final r, z, j 
% c1 m1 * c2 c3
\set@mod@chr
\ifcase \chr@cls            	
    \put@tatwil 				% 0 l
\or \test@end@char #4%				% 1 YntCbyp
    \ifend@char \else \chr@cd = \a@bah@spec \set@high@chr
    \fi
\or \chr@tie = \a@er@to@s \chr@sin #3%		% 2 sxSD
\or \put@tatwil 				% 3 GHXJ
\or \put@tatwil 				% 4 cR
\or \ifligs 					% 5 kgM
	\ifx #1r\test@updia #2*%
		\if@updia \put@tatwil \else \chr@kaf #3%
		\fi
	\else \put@tatwil 
	\fi
    \else \put@tatwil 
    \fi
\else \put@tatwil 
\fi }

%%%%%%%%%%%%%%%%%%%%%% hah %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \hah@end #1#2+#3*#4{% hah, prfen auf Ligatur
% c2 m21 + m22 * c3
\set@mod@chr \global\@highfalse
\ifurd@ \act@cd = \a@hah@urd \test@end@char #1%
	\ifend@char \else \@raisetrue
	\fi
\else
\ifx #1l\ifx #4l%				% 0 l
	\ifnum #2 = \c@shadda \chr@cd = \a@lam@spec@low    
	% special short form of lam for the Name of God
	\else \put@tatwil 
	\fi                          
	\else \put@tatwil 
	\fi                          
\else 
\ifnum \chr@cls = 1 \chr@cd = \a@bah		% 1 YntCbyp
\else 
\ifnum \chr@cls = 3 				% 3 GHX
	\test@updia #2+#3*% upper diacritic
	\if@updia \chr@tie = \a@tatwil \else \put@tatwil 
	\fi
\else \gim@test #4\put@tatwil 
\fi\fi\fi\fi }

%%%%%%%%%%%%%%%%%%%%%% hah %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \hah@mid #1#2#3{% hah in der Mitte
% c1 c2 c3
%\ifligs
\ifcase \chr@cls
	\act@cd = \a@hah@spec@lam 		% 0 l
	\test@end@char #3%
	\ifend@char \chr@cd = \a@lam@spec@hah
	\else \chr@cd = \a@lam@spec@mim
	\fi
\or \act@hah \chr@cd = \a@bah@end@hah		% 1 YntCbyp
\or \act@hah \chr@tie = \a@mh@to@s \chr@sin #2%	% 2 sxSD
\else 	\ifnum \chr@cls = 9 			% \a@t \a@n
	\act@hah \chr@cd = \a@bah@end@hah
	\else \put@tatwil 
	\fi
\fi
%\fi % ifligs
\ifnum \act@cd = \a@hah@spec@lam \@raisetrue
\fi }

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

\def \arab@space {\space \hskip 0pt plus 0.001fil \relax }

\def \arab@insert #1>{% Arabic insertion in Roman text
\ifshow \a@verb #1>\fi % verbating listing
\ifarab \arab@sequence #1> \fi % arabic writing
\iftrans \set@transfont \trans@text #1 \end \/\fi
\ifnum \tracingarab > \@ne \message {>}\fi
\unskip \egroup }

\def \def@arabstrut {\def \arab@strut {\if@vocals 
\vrule height2ex depth1.5ex width\z@ \relax \else
%\vrule height3ex depth1.5ex width\z@ \relax \else
\vrule height2ex depth1.0ex width\z@ \relax    }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% aparse.sty

\def \syl@quote@beg #1#2{% start word with quote: " #1 #2
\ifx #1'\put@con Q\def \next {\syl@voctest #2}\else
\ifx #1Q\put@con Q\def \next {\syl@voctest }\else
\ifx #1|\put@spec W\def \next {\syl@beg #2}\else % start new word
	\put@con a% alif implied
   \xpa \ifx \csname sv@\string #1\endcsname \relax % consonant follows
		\togglev@c \add@wasla \put@syl 
		\def \next {\syl@con #1#2}% wasla
     	\else \if@wasla \v@ctrue \else \add@wasla \togglev@c \fi
		\def \next {\syl@voc #1#2}% explicit vowel
	\fi
\fi\fi\fi \next }

\def \syl@hamzamid #1#2#3{% intermediate hamza, context #1'#2#3
   \@ayfalse \def \next {\syl@voctest #2}%
   \ifx #2a\ifx #3y\@aytrue \fi\fi
%\if@ay \put@con Y\add@hamza \else
\ifx #1I\ifqur@n \put@con B\else \put@con Y\fi \add@hamza \else
   \test@in@list #1iy>%
\ifin@list \put@con Y\add@hamza \else
   \test@in@list #2iIE>%
\ifin@list \put@con Y\add@hamza
   \ifqur@n \add@hamzalow \fi \else
   \test@in@list #1uo>%
\ifin@list \put@con w\add@hamza \else
   \test@in@list #2uo>%
\ifin@list \put@con w\add@hamza \else
   \test@in@list #2UO>%
\ifin@list \ifqur@n \put@Q #1\else \put@con w\add@hamza \fi \else
   \test@in@list #1AUO>%
\ifin@list \put@Q #1\else
   \test@in@list #2A>%
%   \test@in@list #2AY>%
\ifin@list \put@con a\add@madda \put@syl \def \next {\syl@con }\else
\ifx #1a\put@con a\add@hamza \else
\ifx #2a\ifqur@n \put@Q #1\else \put@con a\add@hamza \fi \else
   \put@Q #1% deposit Hamza
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
%\fi
\ifx #2Q\def \next {\syl@doublehamza }%
\fi \next }

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

\ifx \RL \undefined \else % load only if "abidir.sty" is loaded

\iffalse
\def \a@Rsplit #1{% splice RL words into the current paragraph
\bgroup \def \next@command {\test@special}\transfalse \showfalse 
%\tracingmacros=1
\a@splitdimen % 	get the dimensions of \arab@strut
\a@Rdimen #1 \@@ % 	get the length of the first RL word
\tracingmacros=0
\ifdim \a@Rlength = \z@ 
\unhbox0 \else % done with the insertion
%\arab@sequence #1>\else
\a@Ldimen % 		get the dimensions of the last line
\a@Rtobox {#1}% 	pack the insertion lines into a \vbox
\a@Runpack % 		unpack and splice into the current paragraph
\fi \egroup }
\fi

\fi

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

\ifx \sethed@codes \undefined \else % load only if Hebrew loaded
% correct handling of double consonants; hacked
% dynamic definitions for Hebrew
{\catcode `\ =9 \catcode `\^^M=9 \catcode `\^^I=9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef \sethed@codes {\seta@codes % activate and change some codes
\globaldefs=1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \sc@A {va}   \def \sc@B {ga}   \def \sc@C {da}   \def \sc@D {ha}
\def \sc@E {wa}   \def \sc@F {za}   \def \sc@G {Xa}   \def \sc@H {Va}
\def \sc@I {ya}   \def \sc@J {ka}   \def \sc@K {ka}   \def \sc@L {la}
\def \sc@M {ma}   \def \sc@N {ma}   \def \sc@O {na}   \def \sc@P {na}
\def \sc@Q {sa}   \def \sc@R {Pa}   \def \sc@S {fa}   \def \sc@T {fa}
\def \sc@U {Sa}   \def \sc@V {Sa}   \def \sc@W {qa}   \def \sc@X {ra}
\def \sc@Y {\n@xp \a@S a}  	  \def \sc@Z {ta}	  
\def \sc@s {\n@xp \a@S a}  	  \def \sc@@ {QQ}
\a@digits = {0123456789}	\a@paren  = {()[]}		
\a@first = {"`}
\globaldefs=0 
\lccode `-=`<% for Maqqeph 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}% end of dynamic definitions for Hebrew
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {12.08.94}		\def \level {b}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% new versions 10.08.94
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif \ifR@split
\ifx \RL \undefined \else % load only if "abidir.sty" is loaded

\newbox \a@Rboxi	\newbox \a@Rboxii
\newbox \a@Rdummyi	\newbox \a@Rdummyii
\newbox \a@spacebox

\def \a@Rsplit #1{% splice RL words into the current paragraph
\bgroup \def \next@command {\test@special}\transfalse \showfalse 
\def \arab@space {\space }% no infinite stretch !!
\def \tat@skip {0.04ex plus 0.5ex }%
\a@splitht 1.4\baselineskip 
\a@splitht 3.5ex
\a@Rdimen {#1}% 	get the length of the first 2 RL words
\ifdim \wd\a@Rboxii = \z@ 
\unhbox\a@Rboxi \else % done with the insertion
\a@Ldimen % 		get the dimensions of the last line
\a@Rtobox {#1}% 	pack the insertion lines into a \vbox
\a@Runpack % 		unpack and splice into the current paragraph
\fi \egroup }

\def \a@Ldimen {% get the dimensions of the preceding line
\setbox\a@spacebox \hbox {\arab@space}%
\R@splitfalse \leavevmode \copy \a@Rdummyi 
\arab@space \copy \a@Rdummyii
\lineskiplimit \lineskip \parfillskip \z@ plus 1fill
$$\global \a@Llength \predisplaysize % 		dummy display
\global \a@Lwidth \displaywidth \global \a@Lindent \displayindent 
\hbox to \a@Lwidth {}\postdisplaypenalty \@M
$$ \endgraf \a@Ladjust % update \a@Llength
\ifinner \a@killdisplay \else \a@skipback \fi }

\def \a@Ladjust {% correct \a@Llength
\ifdim \a@Llength = \maxdimen \a@Llength \hsize %	flexible line
\else \advance \a@Llength -2em \fi % 			fixed line
\advance \a@Llength -\a@Lindent 
\advance \a@Llength -\wd\a@Rdummyii
\ifdim \a@Llength = \z@ \a@Llength \hsize \R@splittrue 
\else \advance \a@Llength -\wd\a@spacebox
\fi \advance \a@Llength -\wd\a@Rdummyi }

\def \a@killdisplay {% get back to the old position
%\fontdimen 4\font \z@ % no shrink
\unskip \unskip \unpenalty \setbox0 \lastbox % get rid of garbage
\ifR@split \unskip \unskip \unpenalty \setbox0 \lastbox \fi
\unskip \unskip \unpenalty \setbox0 \lastbox % last line
\dimen0 \baselineskip \advance \dimen0 -\ht0
\advance \dimen0 -\lastskip \prevdepth \dimen0
\unskip \vskip -\parskip 
\noindent \unhbox0 % open and trim last line 
\unskip \unskip \unpenalty \setbox0 \lastbox 
\ifR@split \else \unskip \setbox0 \lastbox \fi }

\def \a@skipback {% get back to the old position
\vskip -\belowdisplayskip \vskip -\baselineskip 
\vskip -\abovedisplayskip \vskip -\baselineskip \vskip -\parskip 
\ifR@split \vskip -\ht\a@Rdummyii \vskip -\dp\a@Rdummyii \vskip -\lineskip
\fi \noindent \arab@strut \nobreak \hskip \a@Llength }

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

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

\def \a@Rwordtobox #1\to #2#3{% Rword to \box#2, Rdummy to \box#3
\setbox#2\hbox {\arab@strut \arab@sequence #1>}%
\setbox#3\hbox to \wd#2{\hfill }\ht#3\ht#2\dp#3\dp#2}

\def \a@Rfirst #1 #2\to #3#4{% split off first word
\ifx \relax #1\relax \a@Rfirst #2\to #3#4\else
\def #3{#1}\def #4{#2}\fi }
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\datum   = {13.08.94}		\def \level {b1}	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\edef \arabtexversion {\the\version \level \space (\the\datum)}
\message {\arabtexversion }
\edef \arabtexconfig {\arabtexconfig 
apatch.sty \the\version \level \space (\the\datum) }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\catcode`\@ = \patchatcode
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



