From 8369ad5a44fba9e4154c1a9d2e12b68bd53d35e5 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 15 Apr 2010 23:19:04 +0000
Subject: bidi update (14apr10)

git-svn-id: svn://tug.org/texlive/trunk@17886 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/bidi/plain-xetex-bidi.def | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/bidi/plain-xetex-bidi.def

(limited to 'Master/texmf-dist/tex/latex/bidi/plain-xetex-bidi.def')

diff --git a/Master/texmf-dist/tex/latex/bidi/plain-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/plain-xetex-bidi.def
new file mode 100644
index 00000000000..d20d4cc5840
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/bidi/plain-xetex-bidi.def
@@ -0,0 +1,107 @@
+%%
+%% This is file `plain-xetex-bidi.def',
+
+%% 
+%%   __________________________________
+%%   Copyright © 2009-2010 Vafa Khalighi
+%% 
+%%   License information appended.
+%% 
+%% 
+\ifx\TeXXeTstate\undefined\else%
+   \TeXXeTstate=1
+\fi
+\def\Bidi@RTL@everypar{\if@RTL{\setbox\z@\lastbox\beginR\box\z@}\fi}
+   \let\o@everypar=\everypar
+   \newtoks\n@everypar
+   \n@everypar\expandafter{\the\o@everypar}
+   \o@everypar{\Bidi@RTL@everypar\the\n@everypar}
+   \let\everypar=\n@everypar
+\def\moreLRE{\bracetext \aftergroup\endL \beginL\@RTLfalse}
+\def\moreRLE{\bracetext \aftergroup\endR \beginR\@RTLtrue}
+\protected\def\hboxR{\hbox\bgroup
+ \everyhbox{%
+  \aftergroup\egroup
+  \everyhbox{}%
+  \beginR
+  \bgroup
+  \aftergroup\endR
+  \aftergroup\egroup
+ }\hbox}
+\protected\def\hboxL{\hbox\bgroup
+ \everyhbox{%
+  \aftergroup\egroup
+  \everyhbox{}%
+  \beginL
+  \bgroup
+  \aftergroup\endL
+  \aftergroup\egroup
+ }\hbox}
+\protected\def\vboxR{\vbox\bgroup
+ \everyvbox{%
+  \aftergroup\egroup
+  \everyvbox{}%
+  \beginR
+  \bgroup
+  \aftergroup\endR
+  \aftergroup\egroup
+ }\vbox}
+\protected\def\vboxL{\vbox\bgroup
+ \everyvbox{%
+  \aftergroup\egroup
+  \everyvbox{}%
+  \beginL
+  \bgroup
+  \aftergroup\endL
+  \aftergroup\egroup
+ }\vbox}
+\def\LTR{\par\@RTLfalse\@RTL@footnotefalse\hsize\linewidth\parshape\z@}
+\def\endLTR{\par}
+\def\RTL{\par\@RTLtrue\@RTL@footnotetrue\hsize\linewidth\parshape\z@}
+\def\endRTL{\par}
+\def\ltr{\if@RTL\par\@RTLfalse\@RTL@footnotefalse\fi}
+\def\rtl{\if@RTL\relax\else\par\@RTLtrue\@RTL@footnotetrue\fi}
+\def\setRTL{\@RTLtrue\@RTL@footnotetrue}
+\def\setLTR{\@RTLfalse\@RTL@footnotefalse}
+\let\unsetRTL=\setLTR
+\let\unsetLTR=\setRTL
+\let\LR=\LRE
+\let\RL=\RLE
+\def\@ensure@RTL#1{\if@RTL#1\else\RLE{#1}\fi}
+\def\@ensure@LTR#1{\if@RTL\LRE{#1}\else#1\fi}
+\let\@ensure@RL=\@ensure@RTL
+\let\@ensure@LR=\@ensure@LTR
+\def\@ensure@dir#1{\if@RTL\RLE{#1}\else{#1}\fi}
+\let\@ensure@maindir=\@ensure@dir
+\def\@@RTL{RTL}
+\def\@@LTR{LTR}
+\def\save@dir{\if@RTL\gdef\saved@@dir{RTL}\else\gdef\saved@@dir{LTR}\fi}
+\def\reset@dir{\ifx\saved@@dir\@@RTL\setRTL\else\ifx\saved@@dir\@@LTR\setLTR\else\relax\fi\fi}
+\let\@@TeX\TeX
+\def\TeX{\@ensure@LTR{\@@TeX}}
+\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
+  \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
+\def\XeTeX{\LR{\leavevmode$\smash{\hbox{X\lower.5ex
+  \hbox{\kern-.125em\reflect{E}}\kern-.1667em \TeX}}$}}
+\let\setRL=\setRTL
+\let\setLR=\setLTR
+\let\unsetRL=\setLTR
+\everydisplay{\predisplaydirection=0 }
+\def\centerline#1{\line{\hss\if@RTL\beginR\fi#1\if@RTL\endR\fi\hss}}
+\def\leftline#1{\line{\if@RTL\beginR\fi#1\if@RTL\endR\fi\hss}}
+\def\rightline#1{\line{\hss\if@RTL\beginR\fi#1\if@RTL\endR\fi}}
+%% 
+%% Copyright © 2009-2010      by Vafa Khalighi     <vafakh84@gmail.com>
+%% 
+%% 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 `plain-xetex-bidi.def'.
-- 
cgit v1.2.3

