From 421891c69e70537af4037e4f8fae0500ca34ffc1 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 19 Oct 2011 22:26:17 +0000
Subject: bidi (19oct11)

git-svn-id: svn://tug.org/texlive/trunk@24328 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/bidi/natbib-xetex-bidi.def | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

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

diff --git a/Master/texmf-dist/tex/latex/bidi/natbib-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/natbib-xetex-bidi.def
index 856309f0668..2b700158765 100644
--- a/Master/texmf-dist/tex/latex/bidi/natbib-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/natbib-xetex-bidi.def
@@ -15,23 +15,25 @@
 \ProvidesFile{natbib-xetex-bidi.def}[2011/06/04 v0.1 bidi adaptations for natbib package for XeTeX engine]
 \renewenvironment{LTRbibitems}[1][\labelsep]
                  {\par\@RTLfalse
+                  \if@RTLtab\parshape \@ne \@totalleftmargin \dimexpr(\linewidth-\leftmargin)\fi
                   \ifNAT@numbers
-                  \leftskip\labelwidth
+                  \if@bidi@list@minipage@parbox\rightskip\else\leftskip\fi\labelwidth
                   \else
-                  \leftskip\labelsep
+                  \if@bidi@list@minipage@parbox\rightskip\else\leftskip\fi\labelsep
                   \fi
-                  \advance\leftskip #1
-                  \advance\rightskip -\leftmargin
+                  \if@RTLtab\else\advance\if@bidi@list@minipage@parbox\rightskip\else\leftskip\fi #1\fi
+                  \advance\if@bidi@list@minipage@parbox\leftskip\else\if@RTLtab\leftskip\else\rightskip\fi\fi -\leftmargin
                   \ignorespaces}{\endtrivlist}
 \renewenvironment{RTLbibitems}[1][\labelsep]
                  {\par\@RTLtrue
+                  \if@RTLtab\parshape \@ne \dimexpr(\@totalleftmargin+\leftmargin) \dimexpr(\linewidth-\leftmargin)\fi
                   \ifNAT@numbers
-                  \rightskip\labelwidth
+                  \if@bidi@list@minipage@parbox\leftskip\else\rightskip\fi\labelwidth
                   \else
-                  \rightskip\labelsep
+                  \if@bidi@list@minipage@parbox\leftskip\else\rightskip\fi\labelsep
                   \fi
-                  \advance\rightskip #1
-                  \advance\leftskip -\leftmargin
+                  \if@RTLtab\else\advance\if@bidi@list@minipage@parbox\leftskip\else\rightskip\fi #1\fi
+                  \advance\if@bidi@list@minipage@parbox\rightskip\else\if@RTLtab\rightskip\else\leftskip\fi\fi -\leftmargin
                   \ignorespaces}{\endtrivlist}
 \renewenvironment{thebibliography}[1]{%
  \bibsection
-- 
cgit v1.2.3

