summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-09 16:33:55 +0000
committerKarl Berry <karl@freefriends.org>2013-04-09 16:33:55 +0000
commita29c55aa7b233e8eba45a3959c851e9898c0ce93 (patch)
treee63b034856c111dc635bec27749bbae4de99c3a2
parentca6438c53266207afc490d67c130e337b0816cb7 (diff)
bidi (9apr13)
git-svn-id: svn://tug.org/texlive/trunk@29790 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/bidi/ChangeLog21
-rw-r--r--Master/texmf-dist/doc/latex/bidi/README5
-rw-r--r--Master/texmf-dist/doc/latex/bidi/bidi.pdfbin195298 -> 202102 bytes
-rwxr-xr-xMaster/texmf-dist/source/latex/bidi/bidi.dtx633
-rw-r--r--Master/texmf-dist/source/latex/bidi/bidi.ins3
-rw-r--r--Master/texmf-dist/tex/latex/bidi/bidi.sty7
-rw-r--r--Master/texmf-dist/tex/latex/bidi/bidi.tex2
-rw-r--r--Master/texmf-dist/tex/latex/bidi/biditools.sty3
-rw-r--r--Master/texmf-dist/tex/latex/bidi/color-xetex-bidi.def6
-rw-r--r--Master/texmf-dist/tex/latex/bidi/cuted-xetex-bidi.def13
-rw-r--r--Master/texmf-dist/tex/latex/bidi/fix2col-xetex-bidi.def10
-rw-r--r--Master/texmf-dist/tex/latex/bidi/floatrow-xetex-bidi.def33
-rw-r--r--Master/texmf-dist/tex/latex/bidi/ftnright-xetex-bidi.def9
-rw-r--r--Master/texmf-dist/tex/latex/bidi/hyperref-xetex-bidi.def12
-rw-r--r--Master/texmf-dist/tex/latex/bidi/lettrine-xetex-bidi.def11
-rw-r--r--Master/texmf-dist/tex/latex/bidi/loadingorder-bidi.def14
-rw-r--r--Master/texmf-dist/tex/latex/bidi/mdframed-xetex-bidi.def97
-rw-r--r--Master/texmf-dist/tex/latex/bidi/midfloat-xetex-bidi.def232
-rw-r--r--Master/texmf-dist/tex/latex/bidi/picinpar-xetex-bidi.def100
-rw-r--r--Master/texmf-dist/tex/latex/bidi/titletoc-xetex-bidi.def7
-rw-r--r--Master/texmf-dist/tex/latex/bidi/xcolor-xetex-bidi.def6
-rw-r--r--Master/texmf-dist/tex/latex/bidi/xetex-bidi.def55
22 files changed, 1112 insertions, 167 deletions
diff --git a/Master/texmf-dist/doc/latex/bidi/ChangeLog b/Master/texmf-dist/doc/latex/bidi/ChangeLog
index d85c892f73f..3324b04d38b 100644
--- a/Master/texmf-dist/doc/latex/bidi/ChangeLog
+++ b/Master/texmf-dist/doc/latex/bidi/ChangeLog
@@ -1,3 +1,24 @@
+2013/04/16 version 12.4 Persian TeX Group
+ * Version 12.4 released.
+ * `midfloat' package supported.
+ * Fixed reported bug in `biditools' package.
+ * Fixed redefinitions of `\l@part' and `\l@chapter' when `titletoc' package loaded.
+ * Synced `lettrine-xetex-bidi.def' with version 1.64 of `lettrine' package.
+
+2013/04/08 version 12.3 Persian TeX Group
+ * Version 12.3 released.
+ * Fixed `c' position of `window' environment of `picinpar' package in RTL.
+ * Disabled some frequently-used commands of `bidi' package in pdfstring
+ when `hyperref' package is used.
+ * Disabled footnote-rules when `ftnright' package is used.
+ * Fixed the issue of `\ref' not working in math-mode in RTL when `hyperref'
+ package is used.
+ * `biditufte' bundle and `bidi-longtable' package documented.
+ * Fixed wrong spacing of `\color' in RTL.
+ * `mdframed' package supported.
+ * `floatrow' package supported.
+ * Loaded `ftnright' package automatically in `bidi' package for two-columns documents.
+
2013/04/04 version 12.2 Persian TeX Group
* Version 12.2 released.
* Fixed the issue of `\ref' in math mode when `hyperref' loaded.
diff --git a/Master/texmf-dist/doc/latex/bidi/README b/Master/texmf-dist/doc/latex/bidi/README
index 177ff299dd3..f0c9b462cf8 100644
--- a/Master/texmf-dist/doc/latex/bidi/README
+++ b/Master/texmf-dist/doc/latex/bidi/README
@@ -1,6 +1,6 @@
___________________
The bidi package
-v12.2
+v12.4
This package provides a convenient interface for typesetting
bidirectional texts in Plain TeX and LaTeX.
@@ -17,8 +17,7 @@ In doing so, please always explain your issue well enough, always include
a minimal working examples showing the issue, and always choose the appropriate
label for your query (i.e. if you are reporting any bugs, choose `bug' label).
-Current version release date: 2013/04/04
-Expected next version release date: 2013/05/20
+Current version release date: 2013/04/16
___________________
Persian TeX Group
diff --git a/Master/texmf-dist/doc/latex/bidi/bidi.pdf b/Master/texmf-dist/doc/latex/bidi/bidi.pdf
index 0a9ab4f627d..f27bb7fcff4 100644
--- a/Master/texmf-dist/doc/latex/bidi/bidi.pdf
+++ b/Master/texmf-dist/doc/latex/bidi/bidi.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/bidi/bidi.dtx b/Master/texmf-dist/source/latex/bidi/bidi.dtx
index 7e8f6141043..52fac4720ac 100755
--- a/Master/texmf-dist/source/latex/bidi/bidi.dtx
+++ b/Master/texmf-dist/source/latex/bidi/bidi.dtx
@@ -5,7 +5,7 @@
%<*readme>
___________________
The bidi package
-v12.2
+v12.4
This package provides a convenient interface for typesetting
bidirectional texts in Plain TeX and LaTeX.
@@ -24,8 +24,7 @@ a minimal working examples showing the issue, and always choose the appropriate
label for your query (i.e. if you are reporting any bugs, choose `bug' label).
-Current version release date: 2013/04/04
-Expected next version release date: 2013/05/20
+Current version release date: 2013/04/16
___________________
Persian TeX Group
@@ -40,6 +39,27 @@ This work is “maintained” (as per LPPL maintenance status)
by Persian TeX Group.
%</readme>
%<*changelog>
+2013/04/16 version 12.4 Persian TeX Group
+ * Version 12.4 released.
+ * `midfloat' package supported.
+ * Fixed reported bug in `biditools' package.
+ * Fixed redefinitions of `\l@part' and `\l@chapter' when `titletoc' package loaded.
+ * Synced `lettrine-xetex-bidi.def' with version 1.64 of `lettrine' package.
+
+2013/04/08 version 12.3 Persian TeX Group
+ * Version 12.3 released.
+ * Fixed `c' position of `window' environment of `picinpar' package in RTL.
+ * Disabled some frequently-used commands of `bidi' package in pdfstring
+ when `hyperref' package is used.
+ * Disabled footnote-rules when `ftnright' package is used.
+ * Fixed the issue of `\ref' not working in math-mode in RTL when `hyperref'
+ package is used.
+ * `biditufte' bundle and `bidi-longtable' package documented.
+ * Fixed wrong spacing of `\color' in RTL.
+ * `mdframed' package supported.
+ * `floatrow' package supported.
+ * Loaded `ftnright' package automatically in `bidi' package for two-columns documents.
+
2013/04/04 version 12.2 Persian TeX Group
* Version 12.2 released.
* Fixed the issue of `\ref' in math mode when `hyperref' loaded.
@@ -149,6 +169,7 @@ by Persian TeX Group.
\generate{\file{fix2col-xetex-bidi.def}{\from{\jobname.dtx}{fix2col-xetex-bidi.def}}}
\generate{\file{fleqn-xetex-bidi.def}{\from{\jobname.dtx}{fleqn-xetex-bidi.def}}}
\generate{\file{float-xetex-bidi.def}{\from{\jobname.dtx}{float-xetex-bidi.def}}}
+\generate{\file{floatrow-xetex-bidi.def}{\from{\jobname.dtx}{floatrow-xetex-bidi.def}}}
\generate{\file{flowfram-xetex-bidi.def}{\from{\jobname.dtx}{flowfram-xetex-bidi.def}}}
\generate{\file{footnote-luatex-bidi.def}{\from{\jobname.dtx}{footnote-luatex-bidi.def}}}
\generate{\file{footnote-xetex-bidi.def}{\from{\jobname.dtx}{footnote-xetex-bidi.def}}}
@@ -165,7 +186,9 @@ by Persian TeX Group.
\generate{\file{loadingorder-bidi.def}{\from{\jobname.dtx}{loadingorder-bidi.def}}}
\generate{\file{longtable-xetex-bidi.def}{\from{\jobname.dtx}{longtable-xetex-bidi.def}}}
\generate{\file{luatex-bidi.def}{\from{\jobname.dtx}{luatex-bidi.def}}}
+\generate{\file{mdframed-xetex-bidi.def}{\from{\jobname.dtx}{mdframed-xetex-bidi.def}}}
\generate{\file{memoir-xetex-bidi.def}{\from{\jobname.dtx}{memoir-xetex-bidi.def}}}
+\generate{\file{midfloat-xetex-bidi.def}{\from{\jobname.dtx}{midfloat-xetex-bidi.def}}}
\generate{\file{minitoc-xetex-bidi.def}{\from{\jobname.dtx}{minitoc-xetex-bidi.def}}}
\generate{\file{multicol-xetex-bidi.def}{\from{\jobname.dtx}{multicol-xetex-bidi.def}}}
\generate{\file{multienum-xetex-bidi.def}{\from{\jobname.dtx}{multienum-xetex-bidi.def}}}
@@ -236,7 +259,7 @@ by Persian TeX Group.
%</internal>
%
%<*driver>
-\documentclass{ltxdoc}
+\documentclass{artikel3}
\usepackage{calc}
\usepackage{pifont}
\usepackage{bbding}
@@ -288,7 +311,7 @@ by Persian TeX Group.
% Support for bidirectional typesetting in plain \TeX{} and \LaTeXe}
% \author{Persian TeX Group\\
% \url{persian-tex@tug.org}}
-% \date{\today\qquad Version 12.2}
+% \date{\today\qquad Version 12.4}
%\maketitle
% \tableofcontents
%\section*{Introduction}
@@ -303,7 +326,7 @@ by Persian TeX Group.
%in plain TeX and LaTeX. The package includes adaptations for use
%with many other commonly-used packages.
%Copyright (c) 2009-2013 Persian TeX Group
-%v12.2, 2013/04/04
+%v12.4, 2013/04/16
%License: LaTeX Project Public License, version 1.3c or higher (your choice)
%Location on CTAN: /macros/latex/contrib/bidi
%\end{lstlisting}
@@ -714,11 +737,11 @@ by Persian TeX Group.
%\subsection{Equation Numbers}
%For \texttt{reqno}, equation numbers are on the right hand side and for \texttt{leqno}, equation numbers are on the left hand side, independent on the current mode.
%\section{Support For Various Packages and Classes}
-%The \textsf{bidi} package supports \textsf{amsmath}, \textsf{amstext}, \textsf{amsthm}, \textsf{array}, \textsf{arydshln}, \textsf{breqn}, \textsf{caption}, \textsf{color}, \textsf{colortbl}, \textsf{crop}, \textsf{cuted}, \textsf{cutwin}, \textsf{dblfnote} \textsf{draftwatermark}, \textsf{empheq}, \textsf{fancyhdr}, \textsf{fix2col}, \textsf{float}, \textsf{flowfram}, \textsf{framed}, \textsf{ftnright}, \textsf{geometry}, \textsf{graphicx}, \textsf{hvfloat}, \textsf{hyperref}, \textsf{lettrine}, \textsf{listings}, \textsf{minitoc}, \textsf{multicol}, \textsf{multienum}, \textsf{pdfpages}, \textsf{pstricks}, \textsf{quotchap}, \textsf{picinpar}, \textsf{ragged2e}, \textsf{sidecap}, \textsf{stabular}, \textsf{subfig}, \textsf{subfigure}, \textsf{supertabular}, \textsf{xtab}, \textsf{tabls}, \textsf{tabulary}, \textsf{PGF \&\ TIKZ}, \textsf{tocbibind}, \textsf{tocloft}, \textsf{tocstyle}, \textsf{wrapfig}, \textsf{xcolor}, \textsf{xltxtra} packages, \textsf{amsart}, \textsf{amsbook}, \textsf{artikel1}, \textsf{artikel2}, \textsf{artikel3}, \textsf{extarticle}, \textsf{flashcards}, \textsf{standrad article}, \textsf{boek}, \textsf{boek3}, \textsf{standard book}, \textsf{bookest}, \textsf{extbook}, \textsf{extletter}, \textsf{scrlettr},\textsf{standard letter}, \textsf{memoir}, \textsf{extreport}, \textsf{rapport1}, \textsf{rapport3}, \textsf{refrep}, \textsf{standard report}, \textsf{scrartcl}, \textsf{scrbook}, \textsf{scrreprt} classes and any other packages and classes that relies on these packages and classes. This means, you can use all these packages and classes in addition to other packages and classes that rely on these packages and classes and use their functionality fully for your bidirectional documents.
+%The \textsf{bidi} package supports \textsf{amsmath}, \textsf{amstext}, \textsf{amsthm}, \textsf{array}, \textsf{arydshln}, \textsf{breqn}, \textsf{caption}, \textsf{color}, \textsf{colortbl}, \textsf{crop}, \textsf{cuted}, \textsf{cutwin}, \textsf{dblfnote} \textsf{draftwatermark}, \textsf{empheq}, \textsf{fancyhdr}, \textsf{fix2col}, \textsf{float}, \textsf{floatrow}, \textsf{flowfram}, \textsf{framed}, \textsf{ftnright}, \textsf{geometry}, \textsf{graphicx}, \textsf{hvfloat}, \textsf{hyperref}, \textsf{lettrine}, \textsf{listings}, \textsf{mdframed}, \textsf{midfloat}, \textsf{minitoc}, \textsf{multicol}, \textsf{multienum}, \textsf{pdfpages}, \textsf{pstricks}, \textsf{quotchap}, \textsf{picinpar}, \textsf{ragged2e}, \textsf{sidecap}, \textsf{stabular}, \textsf{subfig}, \textsf{subfigure}, \textsf{supertabular}, \textsf{xtab}, \textsf{tabls}, \textsf{tabulary}, \textsf{PGF \&\ TIKZ}, \textsf{tocbibind}, \textsf{tocloft}, \textsf{tocstyle}, \textsf{wrapfig}, \textsf{xcolor}, \textsf{xltxtra} packages, \textsf{amsart}, \textsf{amsbook}, \textsf{artikel1}, \textsf{artikel2}, \textsf{artikel3}, \textsf{extarticle}, \textsf{flashcards}, \textsf{standrad article}, \textsf{boek}, \textsf{boek3}, \textsf{standard book}, \textsf{bookest}, \textsf{extbook}, \textsf{extletter}, \textsf{scrlettr},\textsf{standard letter}, \textsf{memoir}, \textsf{extreport}, \textsf{rapport1}, \textsf{rapport3}, \textsf{refrep}, \textsf{standard report}, \textsf{scrartcl}, \textsf{scrbook}, \textsf{scrreprt} classes and any other packages and classes that relies on these packages and classes. This means, you can use all these packages and classes in addition to other packages and classes that rely on these packages and classes and use their functionality fully for your bidirectional documents.
%
%We now give some details that you should know about the supported packages or classes.
%\subsection{Color}
-%You can use \textsf{color} and \textsf{xcolor} packages to typeset texts in colours and colour boxes produced by \Lcs{colorbox} and \Lcs{fcolorbox} commands. Please note that your Coloured text should not span more than a line, if your text spans more than a line, you will be in trouble which means your whole document, page or paragraph may be coloured. If your texts spans more than a line, then you should use \textsf{xecolour} package.
+%You can use \textsf{color} and \textsf{xcolor} packages to typeset texts in colours and colour boxes produced by \Lcs{colorbox} and \Lcs{fcolorbox} commands. Please note that your Coloured text should not span more than a line, if your text spans more than a line, you will be in trouble which means your whole document, page or paragraph may be coloured. If your texts spans more than a line, then you should use \textsf{xecolor} package.
%
%Also if you are going to use \Lcs{color} command to colour the text at the beginning of a paragraph, then you should have \Lcs{leavevmode} before \Lcs{color} command.
%
@@ -745,6 +768,21 @@ by Persian TeX Group.
%
%In addition, you also can use \textsf{vwcol} package for variable width bidirectional column typesetting.
%\section{Extra \textsf{bidi} Packages and Classes}
+%\subsection{\textsf{bidi-longtable} package}
+% For typesetting RTL tables with \textsf{longtable} package, an experimental package, \textsf{bidi-longtable} package, is provided. \textsf{bidi-longtable} package should be loaded after \textsf{longtable} package.
+%\subsection{\textsf{biditufte} bundle}
+%A modified version of \textsf{tufte-latex}, \textsf{biditufte} bundle, mainly for RTL typesetting, is provided. If you never used \textsf{biditufte} bundle or \textsf{tufte-latex} package and you want to use \textsf{biditufte} bundle, then you need to look at \textsf{tufte-latex} package's manual and examples. In addition, for using \textsf{biditufte} bundle, you need to know the following notes:
+%\begin{itemize}
+%\item You need to use \textsf{biditufte-book} class instead \textsf{tufte-book} class and \textsf{biditufte-handout} class instead \textsf{tufte-handout} class.
+%\item \textsf{biditufte} bundle provides the following extra commands:
+%\begin{BDef}
+%\Lcs{LTRsidenote}\quad\Lcs{RTLsidenote}\quad\Lcs{LTRmarginnote}\quad\Lcs{RTLmarginnote}
+%\end{BDef}
+%\item \textsf{biditufte-book} and \textsf{biditufte-handout} classes provide two extra options; \textsf{RTLgeometry} (active when loading either of classes) and \textsf{LTRgeometry}.
+%\item \textsf{biditufte} bundle unlike \textsf{tufts-latex} package, only provides justified lines.
+%\item Some features of \textsf{tufte-latex} that does not make any sense in RTL, do not exist in \textsf{biditufte} bundle (no need for \textsf{soul}, \textsf{letterspace} and \textsf{macrotype} packages).
+%\item If you want to configure \textsf{biditufte-book} class for your own needs, then you can create a file with the name \texttt{biditufte-book.cfg} and put your \LaTeX{} macros in that file; similarly, if you want to configure \textsf{biditufte-handout} class for your own needs, then you can create a file with the name \texttt{biditufte-handout.cfg} and put your \LaTeX{} macros in that file.
+%\end{itemize}
%\subsection{Typesetting \TeX{} and \LaTeX{} Codes}
%The \LaTeX{} codes in this manual are typeset using the \textsf{bidicode} package.
%In standard \LaTeX\, you can not use footnotes inside \Lcs{chapter}, \Lcs{part}, \Lcs{section}, \Lcs{subsection}, \Lcs{subsection} and any other section-like commands, \Lcs{caption} and tabular environment.
@@ -2611,8 +2649,8 @@ by Persian TeX Group.
% \subsection{\textsf{bidi.sty}}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\def\bididate{2013/04/04}
-\def\bidiversion{v12.2}
+\def\bididate{2013/04/16}
+\def\bidiversion{v12.4}
\ProvidesPackage{bidi}[\bididate\space \bidiversion\space
Bidirectional typesetting in plain TeX and LaTeX]
\edef\bidiinfo{%
@@ -2632,6 +2670,9 @@ Location on CTAN: /macros/latex/contrib/bidi}
\RequirePackage{zref-abspage}
\RequirePackage{auxhook}
\RequirePackage{ltxcmds}
+\if@twocolumn
+ \RequirePackage{ftnright}
+\fi
\eqnewif{\if@RTLmain}{\if@rlmain}
\eqnewif{\if@RTL}{\if@rl}
\newif\if@RTLmaths
@@ -2680,7 +2721,7 @@ Location on CTAN: /macros/latex/contrib/bidi}
%\fi
% \subsection{\textsf{bidi.tex}}
% \begin{macrocode}
-\def\bididate{2013/04/04}
+\def\bididate{2013/04/16}
\def\bidiversion{v0.2}
\catcode`@=11
\let \protect \relax
@@ -3469,7 +3510,7 @@ Location on CTAN: /macros/latex/contrib/bidi}
% \subsection{\textsf{biditools.sty}}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biditools}[2012/05/01 v0.1 Programming tools for bidi package]
+\ProvidesPackage{biditools}[2013/04/16 v0.2 Programming tools for bidi package]
\providecommand{\@bidi@saveprimitive}[2]{\begingroup\escapechar`\\\relax
\edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
\ifx\@tempa\@tempb \global\let#2#1%
@@ -3561,6 +3602,7 @@ Location on CTAN: /macros/latex/contrib/bidi}
\expandafter\@secondoftwo
\fi}
\newcommand{\if@bidi@csprimitive}[1]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup%
\expandafter\ifprimitive\csname#1\endcsname%
\expandafter\@firstoftwo
\else
@@ -6776,7 +6818,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{color-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{color-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for color package for XeTeX engine]
+\ProvidesFile{color-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for color package for XeTeX engine]
\long\def\color@b@x#1#2#3{%
\leavevmode\ifmmode\else\if@RTL\beginL\fi\fi
\setbox\z@\hbox{\kern\fboxsep{\set@color\if@RTL\beginR\fi#3\if@RTL\endR\fi}\kern\fboxsep}%
@@ -6793,13 +6835,13 @@ bidi implementation of tufte title]
{\expandafter\let\expandafter\current@color
\csname\string\color @#1\endcsname
\set@color}%
- \ignorespaces\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\def\@undeclaredcolor[#1]#2{%
\@ifundefined{color@#1}%
{\c@lor@error{model `#1'}}%
{\csname color@#1\endcsname\current@color{#2}%
\set@color}%
- \ignorespaces\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\DeclareRobustCommand\bidicolor{%
\@ifnextchar[\@bidiundeclaredcolor\@bidideclaredcolor}
\def\@bidiundeclaredcolor[#1]#2{%
@@ -7047,11 +7089,14 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{cuted-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{cuted-xetex-bidi.def}[2013/04/01 v0.1 bidi adaptations for cuted package for XeTeX engine]
+\ProvidesFile{cuted-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for cuted package for XeTeX engine]
\def\RTL@outputdblcol{%
\if@firstcolumn \global\@firstcolumnfalse
\global\setbox\@leftcolumn \box\@outputbox
-\else \global\@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
\setbox\@outputbox \vbox {\hbox to\textwidth {%
\hskip \columnwidth
\hfil \vrule width\columnseprule \hfil
@@ -7086,8 +7131,10 @@ bidi implementation of tufte title]
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
- \else
- \global \@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hb@xt@\columnwidth {%
@@ -10404,7 +10451,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{fix2col-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{fix2col-xetex-bidi.def}[2012/12/12 v0.1 bidi adaptations for fix2col package for XeTeX engine]
+\ProvidesFile{fix2col-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for fix2col package for XeTeX engine]
\def\RTL@outputdblcol{%
\if@firstcolumn
\global\@firstcolumnfalse
@@ -10423,7 +10470,9 @@ bidi implementation of tufte title]
\let\firstmark\@firstcolfirstmark
\let\topmark\@firstcoltopmark}%
\fi
-\else \global\@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+\else \preparefootins \global\@firstcolumntrue
\setbox\@outputbox \vbox {\hbox to\textwidth {%
\hskip \columnwidth
\hfil \vrule width\columnseprule \hfil
@@ -10455,7 +10504,9 @@ bidi implementation of tufte title]
\let\firstmark\@firstcolfirstmark
\let\topmark\@firstcoltopmark}%
\fi
- \else
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
@@ -10529,6 +10580,18 @@ bidi implementation of tufte title]
% \end{macrocode}
% \iffalse
%</float-xetex-bidi.def>
+%<*floatrow-xetex-bidi.def>
+%\fi
+% \subsection{\textsf{floatrow-xetex-bidi.def}}
+% \begin{macrocode}
+\ProvidesFile{floatrow-xetex-bidi.def}[2013/04/08 v0.1 bidi adaptations for floatrow package for XeTeX engine]
+\renewcommand\flnew@within[1]{\@addtoreset{\FB@captype}{#1}%
+ \expandafter\edef\csname the\FB@captype\endcsname{%
+ \expandafter\noexpand\csname
+ the#1\endcsname\@SepMark\noexpand\arabic{\FB@captype}}}
+% \end{macrocode}
+% \iffalse
+%</floatrow-xetex-bidi.def>
%<*flowfram-xetex-bidi.def>
%\fi
% \subsection{\textsf{flowfram-xetex-bidi.def}}
@@ -11182,7 +11245,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{ftnright-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{ftnright-xetex-bidi.def}[2013/04/01 v0.1 bidi adaptations for ftnright package for XeTeX engine]
+\ProvidesFile{ftnright-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for ftnright package for XeTeX engine]
\def\LTR@outputdblcol{\if@firstcolumn
\global\@firstcolumnfalse
\global\setbox\@leftcolumn\box\@outputbox
@@ -11227,7 +11290,12 @@ bidi implementation of tufte title]
{\@outputpage\@startdblcolumn}%
\endgroup
\fi}
-\g@addto@macro\document{\let\footnoterule\@empty}
+\let\left@footnoterule\@empty
+\let\right@footnoterule\@empty
+\let\textwidth@footnoterule\@empty
+\long\def\@makefntext#1{\parindent 1em
+ \noindent\hbox to 2em{}%
+ \llap{\@thefnmark\hbox{.}\,\,}#1}
% \end{macrocode}
% \iffalse
%</ftnright-xetex-bidi.def>
@@ -11697,7 +11765,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{hyperref-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{hyperref-xetex-bidi.def}[2013/04/04 v0.6 bidi adaptations for hyperref package for XeTeX engine]
+\ProvidesFile{hyperref-xetex-bidi.def}[2013/04/08 v0.7 bidi adaptations for hyperref package for XeTeX engine]
\AtBeginDocument{%
\def\contentsline#1#2#3#4{%
\ifx\\#4\\%
@@ -11906,7 +11974,7 @@ bidi implementation of tufte title]
}%
\fi
\def\hyper@link#1#2#3{%
- \ifmmode\else\beginL\fi\hyper@linkstart{#1}{#2}\if@RTL\beginR\fi#3\if@RTL\endR\fi\hyper@linkend\ifmmode\else\endL\fi
+ \ifmmode\else\beginL\fi\hyper@linkstart{#1}{#2}\ifmmode\else\if@RTL\beginR\fi\fi#3\ifmmode\else\if@RTL\endR\fi\fi\hyper@linkend\ifmmode\else\endL\fi
}
\def\url@#1{\beginL\hyper@linkurl{\Hurl{#1}}{#1}\endL}
\def\hyper@natlinkstart#1{%
@@ -11930,6 +11998,14 @@ bidi implementation of tufte title]
\endgroup
}%
\endgroup
+\pdfstringdefDisableCommands{%
+\let\LRE\@firstofone
+\let\LR\@firstofone
+\let\RLE\@firstofone
+\let\RL\@firstofone
+\def\XeTeX{Xe\TeX}
+\def\XeLaTeX{Xe\LaTeX}
+}
% \end{macrocode}
% \iffalse
%</hyperref-xetex-bidi.def>
@@ -11979,7 +12055,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{lettrine-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{lettrine-xetex-bidi.def}[2011/09/16 v0.1 bidi adaptations for lettrine package for XeTeX engine]
+\ProvidesFile{lettrine-xetex-bidi.def}[2013/04/16 v0.2 bidi adaptations for lettrine package for XeTeX engine]
\def\@lettrine[#1]#2#3{%
\setcounter{L@lines}{\theDefaultLines}%
\renewcommand*{\L@hang}{\DefaultLhang}%
@@ -12063,11 +12139,10 @@ bidi implementation of tufte title]
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
\if@RTL \edef\L@parshape{\L@parshape 0pt \the\linewidth}\else\edef\L@parshape{\L@parshape \rightmargin \the\linewidth}\fi
- \noindent\leavevmode
- \parshape=\L@parshape
- $\smash{\if@RTL\rlap{\hskip \the\L@Findent\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- }\else\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- \hskip \the\L@Findent}\fi}$%
+ \noindent
+ \parshape=\L@parshape\relax
+ \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
+ \hskip \the\L@Findent}}%
\usebox{\L@tbox}}
% \end{macrocode}
% \iffalse
@@ -12092,7 +12167,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{loadingorder-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{loadingorder-bidi.def}[2012/12/12 v0.9 making sure that bidi is the last package loaded]
+\ProvidesFile{loadingorder-bidi.def}[2013/04/16 v0.92 making sure that bidi is the last package loaded]
\bidi@isloaded{amsmath}
\bidi@isloaded{amstext}
\bidi@isloaded{amsthm}
@@ -12106,6 +12181,7 @@ bidi implementation of tufte title]
\bidi@isloaded{xcolor}
\bidi@isloaded{colortbl}
\bidi@isloaded{float}
+\bidi@isloaded{floatrow}
\bidi@isloaded{flowfram}
\bidi@isloaded{framed}
\bidi@isloaded{ftnright}
@@ -12115,6 +12191,8 @@ bidi implementation of tufte title]
\bidi@isloaded{graphicx}
\bidi@isloaded{geometry}
\bidi@isloaded{hvfloat}
+\bidi@isloaded{mdframed}
+\bidi@isloaded{midfloat}
\bidi@isloaded{ntheorem}
\bidi@isloaded{ntheorem-hyper}
\bidi@isloaded{hyperref}
@@ -12194,6 +12272,9 @@ bidi implementation of tufte title]
\if@bidi@floatloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package float after bidi package. Please load package float before bidi package, and then try to run xelatex on your document again}{}]{float}
\fi%
+ \if@bidi@floatrowloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package floatrow after bidi package. Please load package floatrow before bidi package, and then try to run xelatex on your document again}{}]{floatrow}
+ \fi%
\if@bidi@flowframloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package flowfram after bidi package. Please load package flowfram before bidi package, and then try to run xelatex on your document again}{}]{flowfram}
\fi%
@@ -12221,6 +12302,12 @@ bidi implementation of tufte title]
\if@bidi@hvfloatloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package hvfloat after bidi package. Please load package hvfloat before bidi package, and then try to run xelatex on your document again}{}]{hvfloat}
\fi%
+ \if@bidi@mdframedloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package mdframed after bidi package. Please load package mdframed before bidi package, and then try to run xelatex on your document again}{}]{mdframed}
+ \fi%
+ \if@bidi@midfloatloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package midfloat after bidi package. Please load package midfloat before bidi package, and then try to run xelatex on your document again}{}]{midfloat}
+ \fi%
\if@bidi@ntheoremloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package ntheorem after bidi package. Please load package ntheorem before bidi package, and then try to run xelatex on your document again}{}]{ntheorem}
\fi%
@@ -12428,6 +12515,84 @@ bidi implementation of tufte title]
% \end{macrocode}
% \iffalse
%</luatex-bidi.def>
+%<*mdframed-xetex-bidi.def>
+%\fi
+% \subsection{\textsf{mdframed-xetex-bidi.def}}
+% \begin{macrocode}
+\ProvidesFile{mdframed-xetex-bidi.def}[2013/04/08 v0.1 bidi adaptations for mdframed package for XeTeX engine]
+\newif\if@bidi@mdf@RTL
+\def\mdf@lrbox#1{%
+%%patch to work with amsthm
+ \mdf@patchamsthm
+%%%end patch
+ \edef\mdf@restoreparams{%
+ \parindent=\the\parindent\relax \parskip=\the\parskip\relax}%
+ \if@RTL\@bidi@mdf@RTLtrue\fi%
+ \@RTLfalse%
+ \setbox#1\vbox\bgroup%
+ \color@begingroup%
+ \if@bidi@mdf@RTL\@RTLtrue\fi%
+ \mdf@horizontalmargin@equation%
+ \columnwidth=\hsize%
+ \textwidth=\hsize%
+ \let\if@nobreak\iffalse%
+ \let\if@noskipsec\iffalse%
+ \let\par\@@par%
+ \let\-\@dischyph%
+ \let\'\@acci\let\`\@accii\let\=\@acciii%
+ \parindent\z@ \parskip\z@skip%
+ \linewidth\hsize%
+ \@totalleftmargin\z@%
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip%
+ \parfillskip\@flushglue \lineskip\normallineskip%
+ \baselineskip\normalbaselineskip%
+%% \sloppy%
+ \let\\\@normalcr%
+ \mdf@restoreparams\relax%
+ \@afterindentfalse%
+ \@afterheading%
+}
+\newrobustcmd*\mdf@left@footnoterule{%
+ \kern0\p@%
+ \hrule \@width 1in \kern 2.6\p@}
+
+\newrobustcmd*\mdf@right@footnoterule{%
+ \hbox to \columnwidth
+ {\beginR \vbox{\kern0\p@%
+ \hrule \@width 1in \kern 2.6\p@}\hfil\endR}}
+
+\newrobustcmd*\mdf@textwidth@footnoterule{\kern0\p@%
+ \hrule \@width \columnwidth \kern 2.6\p@}
+
+\newrobustcmd*\mdf@leftfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@left@footnoterule}}
+
+\newrobustcmd*\mdf@rightfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@right@footnoterule}}
+
+\newrobustcmd*\mdf@textwidthfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@textwidth@footnoterule}}
+
+
+
+\renewrobustcmd*\mdf@footnoteinput{%
+ \def\@mpfn{mpfootnote}%
+ \def\thempfn{\thempfootnote}%
+ \c@mpfootnote\z@%
+ \let\@footnotetext\@mpfootnotetext%
+ \let\@LTRfootnotetext\@mpLTRfootnotetext%
+ \let\@RTLfootnotetext\@mpRTLfootnotetext%
+ \let\leftfootnoterule\mdf@leftfootnoterule%
+ \let\LRfootnoterule=\leftfootnoterule%
+ \let\rightfootnoterule\mdf@rightfootnoterule%
+ \let\textwidthfootnoterule\mdf@textwidthfootnoterule%
+}
+% \end{macrocode}
+% \iffalse
+%</mdframed-xetex-bidi.def>
%<*memoir-xetex-bidi.def>
%\fi
% \subsection{\textsf{memoir-xetex-bidi.def}}
@@ -12591,6 +12756,219 @@ bidi implementation of tufte title]
% \end{macrocode}
% \iffalse
%</memoir-xetex-bidi.def>
+%<*midfloat-xetex-bidi.def>
+%\fi
+% \subsection{\textsf{midfloat-xetex-bidi.def}}
+% \begin{macrocode}
+\ProvidesFile{midfloat-xetex-bidi.def}[2013/04/16 v0.1 bidi adaptations for midfloat package for XeTeX engine]
+\def\RTL@outputdblcol{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \global\c@colht\@colht\global\c@addvipersep\z@
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \ifdim\right@cor>\z@
+ \global\advance\@colht by\right@cor
+ \fi
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \fi
+ \global \setbox\@rightcolumn \vbox{}%
+ \else
+ \ifdim\c@colht>\@colht
+ \@tempdima\@colht
+ \ifdim\@colht>\z@
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vbox to\@tempdima{%
+ \vskip\c@addvipersep\unvbox\@outputbox}%
+ \vskip\stripsep
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \global\c@addvipersep\m@addvipersep
+ \else
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \fi
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \global\advance\@colht by -\ht\@rightcolumn
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \else
+ \global\advance\c@colht by-\ht\@rightcolumn
+ \global\@colht\c@colht
+ \fi
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
+ \global\setbox\@outputbox\vbox to\ht\@leftcolumn{%
+ \unvbox\@rightcolumn
+ \vskip\c@addvipersep
+ \unvbox\@outputbox
+ }%
+ \setbox\@outputbox \vbox {%
+ \hb@xt@\textwidth {%
+ \hskip \columnwidth
+ \hfil
+ \vrule \@width\columnseprule
+ \hfil
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hskip-\textwidth
+ \hb@xt@\columnwidth {%
+ \box\@outputbox \hss}%
+ \hskip\columnwidth
+ \hskip\columnsep}%
+ }%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \global\juo@sk=0\global\juo@sar={}%
+ \global\cor@height\z@\global\c@addvipersep\z@
+ \fi
+ \fi
+}
+
+
+\def\LTR@outputdblcol{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \global\c@colht\@colht\global\c@addvipersep\z@
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \ifdim\right@cor>\z@
+ \global\advance\@colht by\right@cor
+ \fi
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \fi
+ \global \setbox\@rightcolumn \vbox{}%
+ \else
+ \ifdim\c@colht>\@colht
+ \@tempdima\@colht
+ \ifdim\@colht>\z@
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vbox to\@tempdima{%
+ \vskip\c@addvipersep\unvbox\@outputbox}%
+ \vskip\stripsep
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \global\c@addvipersep\m@addvipersep
+ \else
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \fi
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \global\advance\@colht by -\ht\@rightcolumn
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \else
+ \global\advance\c@colht by-\ht\@rightcolumn
+ \global\@colht\c@colht
+ \fi
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
+ \global\setbox\@outputbox\vbox to\ht\@leftcolumn{%
+ \unvbox\@rightcolumn
+ \vskip\c@addvipersep
+ \unvbox\@outputbox
+ }%
+ \setbox\@outputbox \vbox {%
+ \hb@xt@\textwidth {%
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hfil
+ \vrule \@width\columnseprule
+ \hfil
+ \hb@xt@\columnwidth {%
+ \box\@outputbox \hss}%
+ }%
+ }%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \global\juo@sk=0\global\juo@sar={}%
+ \global\cor@height\z@\global\c@addvipersep\z@
+ \fi
+ \fi
+}
+
+
+\def\@strip[#1/#2]{\global\@tempdima=#1\global\@tempdimb=#2%
+ \global \setbox\@viper\vbox\bgroup\if@RTLmain\moveleft\dimexpr(\columnwidth+\columnsep)\fi\vbox\bgroup%
+ \hsize\textwidth
+ \@parboxrestore
+ \col@number \@ne
+ \vrule height\topskip width0pt depth0pt
+}
+
+\def\endstrip{%
+ \egroup\egroup
+ \if@firstcolumn
+ \ifdim\pagetotal>\z@
+ \vskip\stripsep
+ \global\ht@strip\pagegoal
+ \global\advance\ht@strip by-\pagetotal
+ \global\advance\ht@strip by-\stripsep
+ \global\advance\ht@strip by-\ht\@viper
+ \global\advance\ht@strip by-\stripsep
+ \global\juo@ht=\ht\@viper
+ \else
+ \global\ht@strip\z@
+ \fi
+ \ifdim\ht@strip>\z@
+ \unvbox\@viper
+ \vskip\stripsep
+ \add@strip{\the\pagetotal}{\the\juo@ht}{\the\@tempdima}{\the\@tempdimb}%
+ \global\advance\juo@sk by1
+ \else
+ \@latex@error{Strip needs more place!}\@ehc
+ \if@vihproof
+ \framebox[\columnwidth]{??? Strip ???}%
+ \fi
+ \fi
+ \else
+ \@latex@error{Strip is used only on left column!}\@ehc
+ \if@vihproof
+ \framebox[\columnwidth]{??? Strip ???}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \iffalse
+%</midfloat-xetex-bidi.def>
%<*minitoc-xetex-bidi.def>
%\fi
% \subsection{\textsf{minitoc-xetex-bidi.def}}
@@ -12981,7 +13359,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{picinpar-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{picinpar-xetex-bidi.def}[2011/11/05 v0.1 bidi adaptations for picinpar package for XeTeX engine]
+\ProvidesFile{picinpar-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for picinpar package for XeTeX engine]
\long\def\@makewincaption#1#2{%
\setbox\@tempboxa\hbox{\footnotesize{\bf #1:\enspace}{#2}}%
\ifdim\wd\@tempboxa>\picwd
@@ -12989,6 +13367,125 @@ bidi implementation of tufte title]
\else
\hbox to\picwd{\if@RTL\beginR\fi\hfil\box\@tempboxa\hfil\if@RTL\endR\fi}
\fi}
+\def\endwindow{%
+ \global\tcd=\tcdsav
+ \egroup\vskip\parskip\parshape=0 % reset parshape; end \box\rawtext
+ \vbadness=10000
+ \splittopskip=0pt
+%
+% Typeset the lines above the window
+%
+\ifnum\tcd>0\setbox\holder=\vsplit\rawtext to \tcd\baselineskip
+\tcn=\tcd
+\loop\advance\tcn -1
+\setbox\fslice=\vsplit\holder to\baselineskip
+\prune\fslice\linewidth
+\topheight=0pt
+\ifnum\dp\fslice>\dp\wstrutbox
+ \advance\topheight-\dp\fslice
+ \advance\topheight\dp\wstrutbox
+ \advance\topheight\ilg\fi
+\hbox to\linewidth{\box\fslice}
+\vskip-\topheight
+\ifdim\ht\holder>0pt\repeat
+\fi
+%
+% Now we build the boxes beside the window
+%
+\global\topheight=\tcl\baselineskip
+\ifnum\cumpartcl>0\global\tcl=\cumtcl
+ \global\topheight=\vpic
+\fi
+\ifnum\bl>0 \ifnum\br>0 \multiply\topheight by 2\fi\fi
+\ifnum\bl>0\setbox\holder=\vsplit\rawtext to\topheight
+\else\ifnum\br>0\setbox\holder=\vsplit\rawtext to\topheight\fi\fi
+\tcn=\tcl \na=0 \nb=0
+\ifnum\bl>0 \ifnum\br>0 \multiply\tcn by 2\fi\fi
+\ifnum\bl>0\na=\tcn\ifnum\br>0\divide\na by 2\fi\fi
+\ifnum\br>0\nb=\tcn\ifnum\bl>0\divide\nb by 2\fi\fi
+\ifnum\na=0\ifnum\nb=0
+ \setbox\waslice=\vbox to\vpic{\vss}
+ \setbox\wbslice=\vbox to\vpic{\vss}
+ \bl=1\br=1
+ \vskip\ilg
+\fi\fi
+%
+% both sides
+%
+\ifnum\na>0 \ifnum\nb>0
+\loop\advance\nb -1
+\advance\na -1
+\if@RTL%
+\setbox\bslice=\vsplit\holder to\baselineskip
+\prune\bslice\rtside
+\setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+to\rtside{\box\bslice\hfil}}
+\setbox\aslice=\vsplit\holder to\baselineskip
+\prune\aslice\lftside
+\setbox\waslice=\vbox{\unvbox\waslice\hbox
+to\lftside{\box\aslice\hfil}}
+\else%
+\setbox\aslice=\vsplit\holder to\baselineskip
+\prune\aslice\lftside
+\setbox\waslice=\vbox{\unvbox\waslice\hbox
+to\lftside{\box\aslice\hfil}}
+\setbox\bslice=\vsplit\holder to\baselineskip
+\prune\bslice\rtside
+\setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+to\rtside{\box\bslice\hfil}}
+\fi%
+\ifnum\nb>0\repeat
+\fi\fi
+%
+% only text on the left side
+%
+\ifnum\na>0
+ \loop\advance\na -1
+ \setbox\aslice=\vsplit\holder to\baselineskip
+ \prune\aslice\lftside
+ \setbox\waslice=\vbox{\unvbox\waslice\hbox
+ to\lftside{\box\aslice\hfil}}
+ \ifdim\ht\holder>0pt\repeat
+\fi
+%
+% only text on the right side
+%
+\ifnum\nb>0
+ \loop\advance\nb -1
+ \setbox\bslice=\vsplit\holder to\baselineskip
+ \prune\bslice\rtside
+ \setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+ to\rtside{\box\bslice\hfil}}
+ \ifdim\ht\holder>0pt\repeat
+\fi
+%
+% fixing the dimensions of the window part
+%
+\ifnum\bl=0\topheight=\ht\wbslice
+\else\ifnum\br=0\topheight=\ht\waslice
+ \else\ifdim\ht\waslice>\ht\wbslice\topheight=\ht\waslice
+ \else\topheight=\ht\wbslice\fi\fi\fi
+%
+% ship out the window material to the main vertical list
+%
+\ifnum\bl>0 \ifnum\br>0 \ifdim\ht\wbslice<\topheight
+\setbox\wbslice=\vbox to\topheight{\box\wbslice\vfill}
+\fi\fi\fi
+\setbox\windowbox=\vbox{\hbox to\linewidth{%
+\ifnum\bl>0\box\waslice\hfill\fi%
+\vbox to\topheight{\hrule width\picwd height0pt depth0pt\vskip0pt%
+\vfill\unvbox\picbox%
+\ifnum\picwd>0\vfill\fi%
+\vss}\ifnum\br>0\hfill\vbox{\box\wbslice}\fi}}%
+\unvbox\windowbox%
+\loop
+ \setbox\bslice=\vsplit\rawtext to\baselineskip
+ \prune\bslice\linewidth
+ \setbox\wbslice=\vbox{\hbox to\linewidth{\box\bslice\hfil}}
+ \unvbox\wbslice
+ \ifdim\ht\rawtext>0pt
+\repeat
+}% FINITO
% \end{macrocode}
% \iffalse
%</picinpar-xetex-bidi.def>
@@ -15960,7 +16457,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{titletoc-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{titletoc-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for titletoc package for XeTeX engine]
+\ProvidesFile{titletoc-xetex-bidi.def}[2013/04/16 v0.2 bidi adaptations for titletoc package for XeTeX engine]
\renewcommand\filright{%
\gdef\ttl@filleft##1{\hskip##1}%
\gdef\ttl@filright##1{\hfill}%
@@ -16004,6 +16501,11 @@ bidi implementation of tufte title]
\advance\if@RTL\leftskip\else\rightskip\fi-\@pnumwidth\relax
\advance\if@RTL\leftskip\else\rightskip\fi#2\relax
\def\@pnumwidth{#2}}
+\let\ttl@savel@part\l@part
+\def\l@part{\ttl@lselect{part}}
+
+\let\ttl@savel@chapter\l@chapter
+\def\l@chapter{\ttl@lselect{chapter}}
% \end{macrocode}
% \iffalse
%</titletoc-xetex-bidi.def>
@@ -16749,7 +17251,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{xcolor-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{xcolor-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for xcolor package for XeTeX engine]
+\ProvidesFile{xcolor-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for xcolor package for XeTeX engine]
\long\def\color@b@x#1#2#3%
{\leavevmode\ifmmode\else\if@RTL\beginL\fi\fi
\setbox\z@\hbox{\kern\fboxsep{\set@color\if@RTL\beginR\fi#3\if@RTL\endR\fi}\kern\fboxsep}%
@@ -16795,11 +17297,11 @@ bidi implementation of tufte title]
{\c@lor@error{model `#1'}}%
{\@nameuse{color@#1}\current@color{#2}%
\edef\XC@current@color{\noexpand\xcolor@{}{\current@color}{#1}{#2}}%
- \XC@display}\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \XC@display}\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\def\XC@declaredc@lor
{\XC@let@Nc\XC@current@color{\string\color@\XC@@tmp}%
\edef\current@color{\XC@current@color}%
- \XC@display\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \XC@display\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\DeclareRobustCommand\bidicolor
{\@ifnextchar[\@bidiundeclaredcolor\@bidideclaredcolor}
\def\@bidiundeclaredcolor[#1]#2%
@@ -16860,7 +17362,7 @@ bidi implementation of tufte title]
%\fi
% \subsection{\textsf{xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{xetex-bidi.def}[2012/12/12 v1.0.6 bidi adaptations for XeTeX engine]
+\ProvidesFile{xetex-bidi.def}[2013/04/16 v1.0.8 bidi adaptations for XeTeX engine]
\newcommand{\TeXXeTOn}{\TeXXeTstate=1 }
\newcommand{\TeXXeTOff}{\TeXXeTstate=0 }
\TeXXeTOn
@@ -16950,6 +17452,7 @@ bidi implementation of tufte title]
\@ifpackageloaded{mathtools}{\RequirePackage{graphicx}}{}
\@ifpackageloaded{crop}{\RequirePackage{graphicx}}{}
\@ifpackageloaded{sidecap}{\RequirePackage{ragged2e}}{}
+\@ifpackageloaded{floatrow}{\RequirePackage{color}}{}
\DeclareOption{RTLdocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}}
\DeclareOption{rldocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}}
\def\RTLcases#1{\left.\vcenter{\normalbaselines\m@th
@@ -17235,51 +17738,6 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #5}}%
\par}%
\fi}
-\def\RTL@outputdblcol{%
-\if@firstcolumn \global\@firstcolumnfalse
- \global\setbox\@leftcolumn \box\@outputbox
-\else \global\@firstcolumntrue
- \setbox\@outputbox \vbox {\hbox to\textwidth {%
- \hskip \columnwidth
- \hfil \vrule width\columnseprule \hfil
- \hbox to\columnwidth {\box\@leftcolumn \hss}%
- \hskip -\textwidth
- \hbox to\columnwidth{\box\@outputbox \hss}%
- \hskip \columnsep
- \hskip \columnwidth }}%
- \@combinedblfloats \@outputpage
- \begingroup \@dblfloatplacement \@startdblcolumn
- \@whilesw\if@fcolmade \fi
- {\@outputpage \@startdblcolumn }\endgroup
-\fi}
-\def\LTR@outputdblcol{%
- \if@firstcolumn
- \global \@firstcolumnfalse
- \global \setbox\@leftcolumn \box\@outputbox
- \else
- \global \@firstcolumntrue
- \setbox\@outputbox \vbox {%
- \hb@xt@\textwidth {%
- \hb@xt@\columnwidth {%
- \box\@leftcolumn \hss}%
- \hfil
- {\normalcolor\vrule \@width\columnseprule}%
- \hfil
- \hb@xt@\columnwidth {%
- \box\@outputbox \hss}%
- }%
- }%
- \@combinedblfloats
- \@outputpage
- \begingroup
- \@dblfloatplacement
- \@startdblcolumn
- \@whilesw\if@fcolmade \fi
- {\@outputpage
- \@startdblcolumn}%
- \endgroup
- \fi
-}
\renewcommand{\@outputdblcol}{\if@RTLmain\RTL@outputdblcol\else\LTR@outputdblcol\fi}
\newcommand{\RTLdblcol}{\renewcommand{\@outputdblcol}{\RTL@outputdblcol}}
\newcommand{\LTRdblcol}{\renewcommand{\@outputdblcol}{\LTR@outputdblcol}}
@@ -17539,12 +17997,14 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{caption}{\input{caption-xetex-bidi.def}}{}
\@ifpackageloaded{caption3}{\input{caption3-xetex-bidi.def}}{}
\@ifpackageloaded{crop}{\@ifclassloaded{memoir}{}{\input{crop-xetex-bidi.def}}}{}
+\@ifpackageloaded{floatrow}{\input{floatrow-xetex-bidi.def}}{}
\@ifpackageloaded{color}{\input{color-xetex-bidi.def}}{}
\@ifpackageloaded{cutwin}{\input{cutwin-xetex-bidi.def}}{}
+\@ifpackageloaded{ftnright}{\input{ftnright-xetex-bidi.def}}{}
\@ifpackageloaded{cuted}{\input{cuted-xetex-bidi.def}}{}
\@ifpackageloaded{xcolor}{\input{xcolor-xetex-bidi.def}}{}
\@ifpackageloaded{colortbl}{\input{colortbl-xetex-bidi.def}}{}
-\@ifpackageloaded{float}{\input{float-xetex-bidi.def}}{}
+\@ifpackageloaded{float}{\@ifpackageloaded{floatrow}{}{\input{float-xetex-bidi.def}}}{}
\@ifpackageloaded{flowfram}{\input{flowfram-xetex-bidi.def}}{}
\@ifpackageloaded{xltxtra}{\input{xltxtra-xetex-bidi.def}}{}
\@ifpackageloaded{wrapfig}{\input{wrapfig-xetex-bidi.def}}{}
@@ -17556,11 +18016,11 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{ntheorem-hyper}{\input{ntheorem-hyper-xetex-bidi.def}}{}
\@ifpackageloaded{fancyhdr}{\input{fancyhdr-xetex-bidi.def}}{}
\@ifpackageloaded{fix2col}{\input{fix2col-xetex-bidi.def}}{}
+\@ifpackageloaded{midfloat}{\input{midfloat-xetex-bidi.def}}{}
\@ifpackageloaded{draftwatermark}{\input{draftwatermark-xetex-bidi.def}}{}
\@ifpackageloaded{dblfnote}{\input{dblfnote-xetex-bidi.def}}{}
\@ifpackageloaded{empheq}{\input{empheq-xetex-bidi.def}}{}
\@ifpackageloaded{framed}{\input{framed-xetex-bidi.def}}{}
-\@ifpackageloaded{ftnright}{\input{ftnright-xetex-bidi.def}}{}
\@ifpackageloaded{pdfpages}{\input{pdfpages-xetex-bidi.def}}{}
\@ifpackageloaded{lettrine}{\input{lettrine-xetex-bidi.def}}{}
\@ifpackageloaded{listings}{\input{listings-xetex-bidi.def}}{}
@@ -17596,6 +18056,7 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{subfigure}{\input{subfigure-xetex-bidi.def}}{}
\@ifpackageloaded{longtable}{\input{longtable-xetex-bidi.def}}{}
\@ifpackageloaded{arydshln}{\input{arydshln-xetex-bidi.def}}{}
+\@ifpackageloaded{mdframed}{\input{mdframed-xetex-bidi.def}}{}
\@ifpackageloaded{multicol}{\input{multicol-xetex-bidi.def}}{}
\@ifpackageloaded{multienum}{\input{multienum-xetex-bidi.def}}{}
\@ifpackageloaded{natbib}{\input{natbib-xetex-bidi.def}}{}
diff --git a/Master/texmf-dist/source/latex/bidi/bidi.ins b/Master/texmf-dist/source/latex/bidi/bidi.ins
index 269ff379253..96c09a1b644 100644
--- a/Master/texmf-dist/source/latex/bidi/bidi.ins
+++ b/Master/texmf-dist/source/latex/bidi/bidi.ins
@@ -91,6 +91,7 @@ by Persian TeX Group.
\generate{\file{fix2col-xetex-bidi.def}{\from{\jobname.dtx}{fix2col-xetex-bidi.def}}}
\generate{\file{fleqn-xetex-bidi.def}{\from{\jobname.dtx}{fleqn-xetex-bidi.def}}}
\generate{\file{float-xetex-bidi.def}{\from{\jobname.dtx}{float-xetex-bidi.def}}}
+\generate{\file{floatrow-xetex-bidi.def}{\from{\jobname.dtx}{floatrow-xetex-bidi.def}}}
\generate{\file{flowfram-xetex-bidi.def}{\from{\jobname.dtx}{flowfram-xetex-bidi.def}}}
\generate{\file{footnote-luatex-bidi.def}{\from{\jobname.dtx}{footnote-luatex-bidi.def}}}
\generate{\file{footnote-xetex-bidi.def}{\from{\jobname.dtx}{footnote-xetex-bidi.def}}}
@@ -107,7 +108,9 @@ by Persian TeX Group.
\generate{\file{loadingorder-bidi.def}{\from{\jobname.dtx}{loadingorder-bidi.def}}}
\generate{\file{longtable-xetex-bidi.def}{\from{\jobname.dtx}{longtable-xetex-bidi.def}}}
\generate{\file{luatex-bidi.def}{\from{\jobname.dtx}{luatex-bidi.def}}}
+\generate{\file{mdframed-xetex-bidi.def}{\from{\jobname.dtx}{mdframed-xetex-bidi.def}}}
\generate{\file{memoir-xetex-bidi.def}{\from{\jobname.dtx}{memoir-xetex-bidi.def}}}
+\generate{\file{midfloat-xetex-bidi.def}{\from{\jobname.dtx}{midfloat-xetex-bidi.def}}}
\generate{\file{minitoc-xetex-bidi.def}{\from{\jobname.dtx}{minitoc-xetex-bidi.def}}}
\generate{\file{multicol-xetex-bidi.def}{\from{\jobname.dtx}{multicol-xetex-bidi.def}}}
\generate{\file{multienum-xetex-bidi.def}{\from{\jobname.dtx}{multienum-xetex-bidi.def}}}
diff --git a/Master/texmf-dist/tex/latex/bidi/bidi.sty b/Master/texmf-dist/tex/latex/bidi/bidi.sty
index 532097d6b17..c6511183424 100644
--- a/Master/texmf-dist/tex/latex/bidi/bidi.sty
+++ b/Master/texmf-dist/tex/latex/bidi/bidi.sty
@@ -13,8 +13,8 @@
%%
%%
\NeedsTeXFormat{LaTeX2e}
-\def\bididate{2013/04/04}
-\def\bidiversion{v12.2}
+\def\bididate{2013/04/16}
+\def\bidiversion{v12.4}
\ProvidesPackage{bidi}[\bididate\space \bidiversion\space
Bidirectional typesetting in plain TeX and LaTeX]
\edef\bidiinfo{%
@@ -34,6 +34,9 @@ Location on CTAN: /macros/latex/contrib/bidi}
\RequirePackage{zref-abspage}
\RequirePackage{auxhook}
\RequirePackage{ltxcmds}
+\if@twocolumn
+ \RequirePackage{ftnright}
+\fi
\eqnewif{\if@RTLmain}{\if@rlmain}
\eqnewif{\if@RTL}{\if@rl}
\newif\if@RTLmaths
diff --git a/Master/texmf-dist/tex/latex/bidi/bidi.tex b/Master/texmf-dist/tex/latex/bidi/bidi.tex
index 6225c0871a7..6a0cf4755ec 100644
--- a/Master/texmf-dist/tex/latex/bidi/bidi.tex
+++ b/Master/texmf-dist/tex/latex/bidi/bidi.tex
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\def\bididate{2013/04/04}
+\def\bididate{2013/04/16}
\def\bidiversion{v0.2}
\catcode`@=11
\let \protect \relax
diff --git a/Master/texmf-dist/tex/latex/bidi/biditools.sty b/Master/texmf-dist/tex/latex/bidi/biditools.sty
index 06db98b33c3..c71df92b67d 100644
--- a/Master/texmf-dist/tex/latex/bidi/biditools.sty
+++ b/Master/texmf-dist/tex/latex/bidi/biditools.sty
@@ -13,7 +13,7 @@
%%
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{biditools}[2012/05/01 v0.1 Programming tools for bidi package]
+\ProvidesPackage{biditools}[2013/04/16 v0.2 Programming tools for bidi package]
\providecommand{\@bidi@saveprimitive}[2]{\begingroup\escapechar`\\\relax
\edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
\ifx\@tempa\@tempb \global\let#2#1%
@@ -105,6 +105,7 @@
\expandafter\@secondoftwo
\fi}
\newcommand{\if@bidi@csprimitive}[1]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup%
\expandafter\ifprimitive\csname#1\endcsname%
\expandafter\@firstoftwo
\else
diff --git a/Master/texmf-dist/tex/latex/bidi/color-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/color-xetex-bidi.def
index a295a4c388a..a80f7dc9df8 100644
--- a/Master/texmf-dist/tex/latex/bidi/color-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/color-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{color-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for color package for XeTeX engine]
+\ProvidesFile{color-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for color package for XeTeX engine]
\long\def\color@b@x#1#2#3{%
\leavevmode\ifmmode\else\if@RTL\beginL\fi\fi
\setbox\z@\hbox{\kern\fboxsep{\set@color\if@RTL\beginR\fi#3\if@RTL\endR\fi}\kern\fboxsep}%
@@ -29,13 +29,13 @@
{\expandafter\let\expandafter\current@color
\csname\string\color @#1\endcsname
\set@color}%
- \ignorespaces\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\def\@undeclaredcolor[#1]#2{%
\@ifundefined{color@#1}%
{\c@lor@error{model `#1'}}%
{\csname color@#1\endcsname\current@color{#2}%
\set@color}%
- \ignorespaces\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\DeclareRobustCommand\bidicolor{%
\@ifnextchar[\@bidiundeclaredcolor\@bidideclaredcolor}
\def\@bidiundeclaredcolor[#1]#2{%
diff --git a/Master/texmf-dist/tex/latex/bidi/cuted-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/cuted-xetex-bidi.def
index 6daddea8f44..4ec97aabae7 100644
--- a/Master/texmf-dist/tex/latex/bidi/cuted-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/cuted-xetex-bidi.def
@@ -12,11 +12,14 @@
%% License information appended.
%%
%%
-\ProvidesFile{cuted-xetex-bidi.def}[2013/04/01 v0.1 bidi adaptations for cuted package for XeTeX engine]
+\ProvidesFile{cuted-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for cuted package for XeTeX engine]
\def\RTL@outputdblcol{%
\if@firstcolumn \global\@firstcolumnfalse
\global\setbox\@leftcolumn \box\@outputbox
-\else \global\@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
\setbox\@outputbox \vbox {\hbox to\textwidth {%
\hskip \columnwidth
\hfil \vrule width\columnseprule \hfil
@@ -51,8 +54,10 @@
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
- \else
- \global \@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hb@xt@\columnwidth {%
diff --git a/Master/texmf-dist/tex/latex/bidi/fix2col-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/fix2col-xetex-bidi.def
index c434498fd0a..1e7fed31a3f 100644
--- a/Master/texmf-dist/tex/latex/bidi/fix2col-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/fix2col-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{fix2col-xetex-bidi.def}[2012/12/12 v0.1 bidi adaptations for fix2col package for XeTeX engine]
+\ProvidesFile{fix2col-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for fix2col package for XeTeX engine]
\def\RTL@outputdblcol{%
\if@firstcolumn
\global\@firstcolumnfalse
@@ -31,7 +31,9 @@
\let\firstmark\@firstcolfirstmark
\let\topmark\@firstcoltopmark}%
\fi
-\else \global\@firstcolumntrue
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+\else \preparefootins \global\@firstcolumntrue
\setbox\@outputbox \vbox {\hbox to\textwidth {%
\hskip \columnwidth
\hfil \vrule width\columnseprule \hfil
@@ -63,7 +65,9 @@
\let\firstmark\@firstcolfirstmark
\let\topmark\@firstcoltopmark}%
\fi
- \else
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
diff --git a/Master/texmf-dist/tex/latex/bidi/floatrow-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/floatrow-xetex-bidi.def
new file mode 100644
index 00000000000..6e602e89f8b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/bidi/floatrow-xetex-bidi.def
@@ -0,0 +1,33 @@
+%%
+%% This is file `floatrow-xetex-bidi.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bidi.dtx (with options: `floatrow-xetex-bidi.def')
+%%
+%% ______________________________________
+%% Copyright © 2009–2013 Persian TeX Group
+%%
+%% License information appended.
+%%
+%%
+\ProvidesFile{floatrow-xetex-bidi.def}[2013/04/08 v0.1 bidi adaptations for floatrow package for XeTeX engine]
+\renewcommand\flnew@within[1]{\@addtoreset{\FB@captype}{#1}%
+ \expandafter\edef\csname the\FB@captype\endcsname{%
+ \expandafter\noexpand\csname
+ the#1\endcsname\@SepMark\noexpand\arabic{\FB@captype}}}
+%%
+%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
+%%
+%% It may be distributed and/or modified 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 Persian TeX Group.
+%%
+%%
+%%
+%%
+%% End of file `floatrow-xetex-bidi.def'.
diff --git a/Master/texmf-dist/tex/latex/bidi/ftnright-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/ftnright-xetex-bidi.def
index a59a5678ebc..9a15a8de26b 100644
--- a/Master/texmf-dist/tex/latex/bidi/ftnright-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/ftnright-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{ftnright-xetex-bidi.def}[2013/04/01 v0.1 bidi adaptations for ftnright package for XeTeX engine]
+\ProvidesFile{ftnright-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for ftnright package for XeTeX engine]
\def\LTR@outputdblcol{\if@firstcolumn
\global\@firstcolumnfalse
\global\setbox\@leftcolumn\box\@outputbox
@@ -57,7 +57,12 @@
{\@outputpage\@startdblcolumn}%
\endgroup
\fi}
-\g@addto@macro\document{\let\footnoterule\@empty}
+\let\left@footnoterule\@empty
+\let\right@footnoterule\@empty
+\let\textwidth@footnoterule\@empty
+\long\def\@makefntext#1{\parindent 1em
+ \noindent\hbox to 2em{}%
+ \llap{\@thefnmark\hbox{.}\,\,}#1}
%%
%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
%%
diff --git a/Master/texmf-dist/tex/latex/bidi/hyperref-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/hyperref-xetex-bidi.def
index 047bad8abbb..b7c51787008 100644
--- a/Master/texmf-dist/tex/latex/bidi/hyperref-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/hyperref-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{hyperref-xetex-bidi.def}[2013/04/04 v0.6 bidi adaptations for hyperref package for XeTeX engine]
+\ProvidesFile{hyperref-xetex-bidi.def}[2013/04/08 v0.7 bidi adaptations for hyperref package for XeTeX engine]
\AtBeginDocument{%
\def\contentsline#1#2#3#4{%
\ifx\\#4\\%
@@ -221,7 +221,7 @@
}%
\fi
\def\hyper@link#1#2#3{%
- \ifmmode\else\beginL\fi\hyper@linkstart{#1}{#2}\if@RTL\beginR\fi#3\if@RTL\endR\fi\hyper@linkend\ifmmode\else\endL\fi
+ \ifmmode\else\beginL\fi\hyper@linkstart{#1}{#2}\ifmmode\else\if@RTL\beginR\fi\fi#3\ifmmode\else\if@RTL\endR\fi\fi\hyper@linkend\ifmmode\else\endL\fi
}
\def\url@#1{\beginL\hyper@linkurl{\Hurl{#1}}{#1}\endL}
\def\hyper@natlinkstart#1{%
@@ -245,6 +245,14 @@
\endgroup
}%
\endgroup
+\pdfstringdefDisableCommands{%
+\let\LRE\@firstofone
+\let\LR\@firstofone
+\let\RLE\@firstofone
+\let\RL\@firstofone
+\def\XeTeX{Xe\TeX}
+\def\XeLaTeX{Xe\LaTeX}
+}
%%
%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
%%
diff --git a/Master/texmf-dist/tex/latex/bidi/lettrine-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/lettrine-xetex-bidi.def
index ac075d97fef..bcd2d6aa263 100644
--- a/Master/texmf-dist/tex/latex/bidi/lettrine-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/lettrine-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{lettrine-xetex-bidi.def}[2011/09/16 v0.1 bidi adaptations for lettrine package for XeTeX engine]
+\ProvidesFile{lettrine-xetex-bidi.def}[2013/04/16 v0.2 bidi adaptations for lettrine package for XeTeX engine]
\def\@lettrine[#1]#2#3{%
\setcounter{L@lines}{\theDefaultLines}%
\renewcommand*{\L@hang}{\DefaultLhang}%
@@ -96,11 +96,10 @@
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
\if@RTL \edef\L@parshape{\L@parshape 0pt \the\linewidth}\else\edef\L@parshape{\L@parshape \rightmargin \the\linewidth}\fi
- \noindent\leavevmode
- \parshape=\L@parshape
- $\smash{\if@RTL\rlap{\hskip \the\L@Findent\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- }\else\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- \hskip \the\L@Findent}\fi}$%
+ \noindent
+ \parshape=\L@parshape\relax
+ \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
+ \hskip \the\L@Findent}}%
\usebox{\L@tbox}}
%%
%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
diff --git a/Master/texmf-dist/tex/latex/bidi/loadingorder-bidi.def b/Master/texmf-dist/tex/latex/bidi/loadingorder-bidi.def
index 6692e3e0246..c034ef37ffe 100644
--- a/Master/texmf-dist/tex/latex/bidi/loadingorder-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/loadingorder-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{loadingorder-bidi.def}[2012/12/12 v0.9 making sure that bidi is the last package loaded]
+\ProvidesFile{loadingorder-bidi.def}[2013/04/16 v0.92 making sure that bidi is the last package loaded]
\bidi@isloaded{amsmath}
\bidi@isloaded{amstext}
\bidi@isloaded{amsthm}
@@ -26,6 +26,7 @@
\bidi@isloaded{xcolor}
\bidi@isloaded{colortbl}
\bidi@isloaded{float}
+\bidi@isloaded{floatrow}
\bidi@isloaded{flowfram}
\bidi@isloaded{framed}
\bidi@isloaded{ftnright}
@@ -35,6 +36,8 @@
\bidi@isloaded{graphicx}
\bidi@isloaded{geometry}
\bidi@isloaded{hvfloat}
+\bidi@isloaded{mdframed}
+\bidi@isloaded{midfloat}
\bidi@isloaded{ntheorem}
\bidi@isloaded{ntheorem-hyper}
\bidi@isloaded{hyperref}
@@ -114,6 +117,9 @@
\if@bidi@floatloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package float after bidi package. Please load package float before bidi package, and then try to run xelatex on your document again}{}]{float}
\fi%
+ \if@bidi@floatrowloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package floatrow after bidi package. Please load package floatrow before bidi package, and then try to run xelatex on your document again}{}]{floatrow}
+ \fi%
\if@bidi@flowframloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package flowfram after bidi package. Please load package flowfram before bidi package, and then try to run xelatex on your document again}{}]{flowfram}
\fi%
@@ -141,6 +147,12 @@
\if@bidi@hvfloatloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package hvfloat after bidi package. Please load package hvfloat before bidi package, and then try to run xelatex on your document again}{}]{hvfloat}
\fi%
+ \if@bidi@mdframedloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package mdframed after bidi package. Please load package mdframed before bidi package, and then try to run xelatex on your document again}{}]{mdframed}
+ \fi%
+ \if@bidi@midfloatloaded@\else
+ \bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package midfloat after bidi package. Please load package midfloat before bidi package, and then try to run xelatex on your document again}{}]{midfloat}
+ \fi%
\if@bidi@ntheoremloaded@\else
\bidi@isloaded[\PackageError{bidi}{Oops! you have loaded package ntheorem after bidi package. Please load package ntheorem before bidi package, and then try to run xelatex on your document again}{}]{ntheorem}
\fi%
diff --git a/Master/texmf-dist/tex/latex/bidi/mdframed-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/mdframed-xetex-bidi.def
new file mode 100644
index 00000000000..94c9ffa0dca
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/bidi/mdframed-xetex-bidi.def
@@ -0,0 +1,97 @@
+%%
+%% This is file `mdframed-xetex-bidi.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bidi.dtx (with options: `mdframed-xetex-bidi.def')
+%%
+%% ______________________________________
+%% Copyright © 2009–2013 Persian TeX Group
+%%
+%% License information appended.
+%%
+%%
+\ProvidesFile{mdframed-xetex-bidi.def}[2013/04/08 v0.1 bidi adaptations for mdframed package for XeTeX engine]
+\newif\if@bidi@mdf@RTL
+\def\mdf@lrbox#1{%
+%%patch to work with amsthm
+ \mdf@patchamsthm
+%%%end patch
+ \edef\mdf@restoreparams{%
+ \parindent=\the\parindent\relax \parskip=\the\parskip\relax}%
+ \if@RTL\@bidi@mdf@RTLtrue\fi%
+ \@RTLfalse%
+ \setbox#1\vbox\bgroup%
+ \color@begingroup%
+ \if@bidi@mdf@RTL\@RTLtrue\fi%
+ \mdf@horizontalmargin@equation%
+ \columnwidth=\hsize%
+ \textwidth=\hsize%
+ \let\if@nobreak\iffalse%
+ \let\if@noskipsec\iffalse%
+ \let\par\@@par%
+ \let\-\@dischyph%
+ \let\'\@acci\let\`\@accii\let\=\@acciii%
+ \parindent\z@ \parskip\z@skip%
+ \linewidth\hsize%
+ \@totalleftmargin\z@%
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip%
+ \parfillskip\@flushglue \lineskip\normallineskip%
+ \baselineskip\normalbaselineskip%
+%% \sloppy%
+ \let\\\@normalcr%
+ \mdf@restoreparams\relax%
+ \@afterindentfalse%
+ \@afterheading%
+}
+\newrobustcmd*\mdf@left@footnoterule{%
+ \kern0\p@%
+ \hrule \@width 1in \kern 2.6\p@}
+
+\newrobustcmd*\mdf@right@footnoterule{%
+ \hbox to \columnwidth
+ {\beginR \vbox{\kern0\p@%
+ \hrule \@width 1in \kern 2.6\p@}\hfil\endR}}
+
+\newrobustcmd*\mdf@textwidth@footnoterule{\kern0\p@%
+ \hrule \@width \columnwidth \kern 2.6\p@}
+
+\newrobustcmd*\mdf@leftfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@left@footnoterule}}
+
+\newrobustcmd*\mdf@rightfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@right@footnoterule}}
+
+\newrobustcmd*\mdf@textwidthfootnoterule{%
+\bidi@autofootnoterulefalse%
+\renewrobustcmd*\mdf@footnoterule{\mdf@textwidth@footnoterule}}
+
+\renewrobustcmd*\mdf@footnoteinput{%
+ \def\@mpfn{mpfootnote}%
+ \def\thempfn{\thempfootnote}%
+ \c@mpfootnote\z@%
+ \let\@footnotetext\@mpfootnotetext%
+ \let\@LTRfootnotetext\@mpLTRfootnotetext%
+ \let\@RTLfootnotetext\@mpRTLfootnotetext%
+ \let\leftfootnoterule\mdf@leftfootnoterule%
+ \let\LRfootnoterule=\leftfootnoterule%
+ \let\rightfootnoterule\mdf@rightfootnoterule%
+ \let\textwidthfootnoterule\mdf@textwidthfootnoterule%
+}
+%%
+%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
+%%
+%% It may be distributed and/or modified 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 Persian TeX Group.
+%%
+%%
+%%
+%%
+%% End of file `mdframed-xetex-bidi.def'.
diff --git a/Master/texmf-dist/tex/latex/bidi/midfloat-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/midfloat-xetex-bidi.def
new file mode 100644
index 00000000000..187609a1f5f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/bidi/midfloat-xetex-bidi.def
@@ -0,0 +1,232 @@
+%%
+%% This is file `midfloat-xetex-bidi.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bidi.dtx (with options: `midfloat-xetex-bidi.def')
+%%
+%% ______________________________________
+%% Copyright © 2009–2013 Persian TeX Group
+%%
+%% License information appended.
+%%
+%%
+\ProvidesFile{midfloat-xetex-bidi.def}[2013/04/16 v0.1 bidi adaptations for midfloat package for XeTeX engine]
+\def\RTL@outputdblcol{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \global\c@colht\@colht\global\c@addvipersep\z@
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \ifdim\right@cor>\z@
+ \global\advance\@colht by\right@cor
+ \fi
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \fi
+ \global \setbox\@rightcolumn \vbox{}%
+ \else
+ \ifdim\c@colht>\@colht
+ \@tempdima\@colht
+ \ifdim\@colht>\z@
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vbox to\@tempdima{%
+ \vskip\c@addvipersep\unvbox\@outputbox}%
+ \vskip\stripsep
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \global\c@addvipersep\m@addvipersep
+ \else
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \fi
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \global\advance\@colht by -\ht\@rightcolumn
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \else
+ \global\advance\c@colht by-\ht\@rightcolumn
+ \global\@colht\c@colht
+ \fi
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
+ \global\setbox\@outputbox\vbox to\ht\@leftcolumn{%
+ \unvbox\@rightcolumn
+ \vskip\c@addvipersep
+ \unvbox\@outputbox
+ }%
+ \setbox\@outputbox \vbox {%
+ \hb@xt@\textwidth {%
+ \hskip \columnwidth
+ \hfil
+ \vrule \@width\columnseprule
+ \hfil
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hskip-\textwidth
+ \hb@xt@\columnwidth {%
+ \box\@outputbox \hss}%
+ \hskip\columnwidth
+ \hskip\columnsep}%
+ }%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \global\juo@sk=0\global\juo@sar={}%
+ \global\cor@height\z@\global\c@addvipersep\z@
+ \fi
+ \fi
+}
+
+\def\LTR@outputdblcol{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \global\c@colht\@colht\global\c@addvipersep\z@
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \ifdim\right@cor>\z@
+ \global\advance\@colht by\right@cor
+ \fi
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \fi
+ \global \setbox\@rightcolumn \vbox{}%
+ \else
+ \ifdim\c@colht>\@colht
+ \@tempdima\@colht
+ \ifdim\@colht>\z@
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vbox to\@tempdima{%
+ \vskip\c@addvipersep\unvbox\@outputbox}%
+ \vskip\stripsep
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \global\c@addvipersep\m@addvipersep
+ \else
+ \global\setbox\@rightcolumn \vbox{%
+ \unvbox\@rightcolumn
+ \vrule height\the\juo@ht width 0pt depth 0pt
+ \vskip\stripsep
+ }%
+ \fi
+ \ifnum\juo@sk>0
+ \remove@strip\juo@sar
+ \global\@colht\the\juo@pr
+ \global\advance\@colht by -\ht\@rightcolumn
+ \global\advance\@colht by\cor@height
+ \global\cor@height=0pt
+ \else
+ \global\advance\c@colht by-\ht\@rightcolumn
+ \global\@colht\c@colht
+ \fi
+ \global\count\footins\@m
+ \global\skip\footins\rcol@footinsskip
+ \else \preparefootins
+ \global\@firstcolumntrue
+ \global\setbox\@outputbox\vbox to\ht\@leftcolumn{%
+ \unvbox\@rightcolumn
+ \vskip\c@addvipersep
+ \unvbox\@outputbox
+ }%
+ \setbox\@outputbox \vbox {%
+ \hb@xt@\textwidth {%
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hfil
+ \vrule \@width\columnseprule
+ \hfil
+ \hb@xt@\columnwidth {%
+ \box\@outputbox \hss}%
+ }%
+ }%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \global\juo@sk=0\global\juo@sar={}%
+ \global\cor@height\z@\global\c@addvipersep\z@
+ \fi
+ \fi
+}
+
+\def\@strip[#1/#2]{\global\@tempdima=#1\global\@tempdimb=#2%
+ \global \setbox\@viper\vbox\bgroup\if@RTLmain\moveleft\dimexpr(\columnwidth+\columnsep)\fi\vbox\bgroup%
+ \hsize\textwidth
+ \@parboxrestore
+ \col@number \@ne
+ \vrule height\topskip width0pt depth0pt
+}
+
+\def\endstrip{%
+ \egroup\egroup
+ \if@firstcolumn
+ \ifdim\pagetotal>\z@
+ \vskip\stripsep
+ \global\ht@strip\pagegoal
+ \global\advance\ht@strip by-\pagetotal
+ \global\advance\ht@strip by-\stripsep
+ \global\advance\ht@strip by-\ht\@viper
+ \global\advance\ht@strip by-\stripsep
+ \global\juo@ht=\ht\@viper
+ \else
+ \global\ht@strip\z@
+ \fi
+ \ifdim\ht@strip>\z@
+ \unvbox\@viper
+ \vskip\stripsep
+ \add@strip{\the\pagetotal}{\the\juo@ht}{\the\@tempdima}{\the\@tempdimb}%
+ \global\advance\juo@sk by1
+ \else
+ \@latex@error{Strip needs more place!}\@ehc
+ \if@vihproof
+ \framebox[\columnwidth]{??? Strip ???}%
+ \fi
+ \fi
+ \else
+ \@latex@error{Strip is used only on left column!}\@ehc
+ \if@vihproof
+ \framebox[\columnwidth]{??? Strip ???}%
+ \fi
+ \fi
+}
+%%
+%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
+%%
+%% It may be distributed and/or modified 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 Persian TeX Group.
+%%
+%%
+%%
+%%
+%% End of file `midfloat-xetex-bidi.def'.
diff --git a/Master/texmf-dist/tex/latex/bidi/picinpar-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/picinpar-xetex-bidi.def
index 338cf136921..36bbe251b8f 100644
--- a/Master/texmf-dist/tex/latex/bidi/picinpar-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/picinpar-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{picinpar-xetex-bidi.def}[2011/11/05 v0.1 bidi adaptations for picinpar package for XeTeX engine]
+\ProvidesFile{picinpar-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for picinpar package for XeTeX engine]
\long\def\@makewincaption#1#2{%
\setbox\@tempboxa\hbox{\footnotesize{\bf #1:\enspace}{#2}}%
\ifdim\wd\@tempboxa>\picwd
@@ -20,6 +20,104 @@
\else
\hbox to\picwd{\if@RTL\beginR\fi\hfil\box\@tempboxa\hfil\if@RTL\endR\fi}
\fi}
+\def\endwindow{%
+ \global\tcd=\tcdsav
+ \egroup\vskip\parskip\parshape=0 % reset parshape; end \box\rawtext
+ \vbadness=10000
+ \splittopskip=0pt
+\ifnum\tcd>0\setbox\holder=\vsplit\rawtext to \tcd\baselineskip
+\tcn=\tcd
+\loop\advance\tcn -1
+\setbox\fslice=\vsplit\holder to\baselineskip
+\prune\fslice\linewidth
+\topheight=0pt
+\ifnum\dp\fslice>\dp\wstrutbox
+ \advance\topheight-\dp\fslice
+ \advance\topheight\dp\wstrutbox
+ \advance\topheight\ilg\fi
+\hbox to\linewidth{\box\fslice}
+\vskip-\topheight
+\ifdim\ht\holder>0pt\repeat
+\fi
+\global\topheight=\tcl\baselineskip
+\ifnum\cumpartcl>0\global\tcl=\cumtcl
+ \global\topheight=\vpic
+\fi
+\ifnum\bl>0 \ifnum\br>0 \multiply\topheight by 2\fi\fi
+\ifnum\bl>0\setbox\holder=\vsplit\rawtext to\topheight
+\else\ifnum\br>0\setbox\holder=\vsplit\rawtext to\topheight\fi\fi
+\tcn=\tcl \na=0 \nb=0
+\ifnum\bl>0 \ifnum\br>0 \multiply\tcn by 2\fi\fi
+\ifnum\bl>0\na=\tcn\ifnum\br>0\divide\na by 2\fi\fi
+\ifnum\br>0\nb=\tcn\ifnum\bl>0\divide\nb by 2\fi\fi
+\ifnum\na=0\ifnum\nb=0
+ \setbox\waslice=\vbox to\vpic{\vss}
+ \setbox\wbslice=\vbox to\vpic{\vss}
+ \bl=1\br=1
+ \vskip\ilg
+\fi\fi
+\ifnum\na>0 \ifnum\nb>0
+\loop\advance\nb -1
+\advance\na -1
+\if@RTL%
+\setbox\bslice=\vsplit\holder to\baselineskip
+\prune\bslice\rtside
+\setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+to\rtside{\box\bslice\hfil}}
+\setbox\aslice=\vsplit\holder to\baselineskip
+\prune\aslice\lftside
+\setbox\waslice=\vbox{\unvbox\waslice\hbox
+to\lftside{\box\aslice\hfil}}
+\else%
+\setbox\aslice=\vsplit\holder to\baselineskip
+\prune\aslice\lftside
+\setbox\waslice=\vbox{\unvbox\waslice\hbox
+to\lftside{\box\aslice\hfil}}
+\setbox\bslice=\vsplit\holder to\baselineskip
+\prune\bslice\rtside
+\setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+to\rtside{\box\bslice\hfil}}
+\fi%
+\ifnum\nb>0\repeat
+\fi\fi
+\ifnum\na>0
+ \loop\advance\na -1
+ \setbox\aslice=\vsplit\holder to\baselineskip
+ \prune\aslice\lftside
+ \setbox\waslice=\vbox{\unvbox\waslice\hbox
+ to\lftside{\box\aslice\hfil}}
+ \ifdim\ht\holder>0pt\repeat
+\fi
+\ifnum\nb>0
+ \loop\advance\nb -1
+ \setbox\bslice=\vsplit\holder to\baselineskip
+ \prune\bslice\rtside
+ \setbox\wbslice=\vbox{\unvbox\wbslice\hbox
+ to\rtside{\box\bslice\hfil}}
+ \ifdim\ht\holder>0pt\repeat
+\fi
+\ifnum\bl=0\topheight=\ht\wbslice
+\else\ifnum\br=0\topheight=\ht\waslice
+ \else\ifdim\ht\waslice>\ht\wbslice\topheight=\ht\waslice
+ \else\topheight=\ht\wbslice\fi\fi\fi
+\ifnum\bl>0 \ifnum\br>0 \ifdim\ht\wbslice<\topheight
+\setbox\wbslice=\vbox to\topheight{\box\wbslice\vfill}
+\fi\fi\fi
+\setbox\windowbox=\vbox{\hbox to\linewidth{%
+\ifnum\bl>0\box\waslice\hfill\fi%
+\vbox to\topheight{\hrule width\picwd height0pt depth0pt\vskip0pt%
+\vfill\unvbox\picbox%
+\ifnum\picwd>0\vfill\fi%
+\vss}\ifnum\br>0\hfill\vbox{\box\wbslice}\fi}}%
+\unvbox\windowbox%
+\loop
+ \setbox\bslice=\vsplit\rawtext to\baselineskip
+ \prune\bslice\linewidth
+ \setbox\wbslice=\vbox{\hbox to\linewidth{\box\bslice\hfil}}
+ \unvbox\wbslice
+ \ifdim\ht\rawtext>0pt
+\repeat
+}% FINITO
%%
%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
%%
diff --git a/Master/texmf-dist/tex/latex/bidi/titletoc-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/titletoc-xetex-bidi.def
index 59ed3f286a6..0b0b2a68bb9 100644
--- a/Master/texmf-dist/tex/latex/bidi/titletoc-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/titletoc-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{titletoc-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for titletoc package for XeTeX engine]
+\ProvidesFile{titletoc-xetex-bidi.def}[2013/04/16 v0.2 bidi adaptations for titletoc package for XeTeX engine]
\renewcommand\filright{%
\gdef\ttl@filleft##1{\hskip##1}%
\gdef\ttl@filright##1{\hfill}%
@@ -56,6 +56,11 @@
\advance\if@RTL\leftskip\else\rightskip\fi-\@pnumwidth\relax
\advance\if@RTL\leftskip\else\rightskip\fi#2\relax
\def\@pnumwidth{#2}}
+\let\ttl@savel@part\l@part
+\def\l@part{\ttl@lselect{part}}
+
+\let\ttl@savel@chapter\l@chapter
+\def\l@chapter{\ttl@lselect{chapter}}
%%
%% Copyright © 2009–2013 Persian TeX Group <persian-tex@tug.org>
%%
diff --git a/Master/texmf-dist/tex/latex/bidi/xcolor-xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/xcolor-xetex-bidi.def
index c35078b4324..f6bfcfa9058 100644
--- a/Master/texmf-dist/tex/latex/bidi/xcolor-xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/xcolor-xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{xcolor-xetex-bidi.def}[2010/07/25 v0.1 bidi adaptations for xcolor package for XeTeX engine]
+\ProvidesFile{xcolor-xetex-bidi.def}[2013/04/08 v0.2 bidi adaptations for xcolor package for XeTeX engine]
\long\def\color@b@x#1#2#3%
{\leavevmode\ifmmode\else\if@RTL\beginL\fi\fi
\setbox\z@\hbox{\kern\fboxsep{\set@color\if@RTL\beginR\fi#3\if@RTL\endR\fi}\kern\fboxsep}%
@@ -58,11 +58,11 @@
{\c@lor@error{model `#1'}}%
{\@nameuse{color@#1}\current@color{#2}%
\edef\XC@current@color{\noexpand\xcolor@{}{\current@color}{#1}{#2}}%
- \XC@display}\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \XC@display}\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\def\XC@declaredc@lor
{\XC@let@Nc\XC@current@color{\string\color@\XC@@tmp}%
\edef\current@color{\XC@current@color}%
- \XC@display\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi}
+ \XC@display\ifhmode\if@RTL\beginR\aftergroup\endL\fi\fi\ignorespaces}
\DeclareRobustCommand\bidicolor
{\@ifnextchar[\@bidiundeclaredcolor\@bidideclaredcolor}
\def\@bidiundeclaredcolor[#1]#2%
diff --git a/Master/texmf-dist/tex/latex/bidi/xetex-bidi.def b/Master/texmf-dist/tex/latex/bidi/xetex-bidi.def
index 08583dcdb0e..975129c0232 100644
--- a/Master/texmf-dist/tex/latex/bidi/xetex-bidi.def
+++ b/Master/texmf-dist/tex/latex/bidi/xetex-bidi.def
@@ -12,7 +12,7 @@
%% License information appended.
%%
%%
-\ProvidesFile{xetex-bidi.def}[2012/12/12 v1.0.6 bidi adaptations for XeTeX engine]
+\ProvidesFile{xetex-bidi.def}[2013/04/16 v1.0.8 bidi adaptations for XeTeX engine]
\newcommand{\TeXXeTOn}{\TeXXeTstate=1 }
\newcommand{\TeXXeTOff}{\TeXXeTstate=0 }
\TeXXeTOn
@@ -102,6 +102,7 @@
\@ifpackageloaded{mathtools}{\RequirePackage{graphicx}}{}
\@ifpackageloaded{crop}{\RequirePackage{graphicx}}{}
\@ifpackageloaded{sidecap}{\RequirePackage{ragged2e}}{}
+\@ifpackageloaded{floatrow}{\RequirePackage{color}}{}
\DeclareOption{RTLdocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}}
\DeclareOption{rldocument}{\@RTLtrue\@RTL@footnotetrue\g@addto@macro\document{\autofootnoterule}}
\def\RTLcases#1{\left.\vcenter{\normalbaselines\m@th
@@ -387,51 +388,6 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #5}}%
\par}%
\fi}
-\def\RTL@outputdblcol{%
-\if@firstcolumn \global\@firstcolumnfalse
-\global\setbox\@leftcolumn \box\@outputbox
-\else \global\@firstcolumntrue
-\setbox\@outputbox \vbox {\hbox to\textwidth {%
-\hskip \columnwidth
-\hfil \vrule width\columnseprule \hfil
-\hbox to\columnwidth {\box\@leftcolumn \hss}%
-\hskip -\textwidth
-\hbox to\columnwidth{\box\@outputbox \hss}%
-\hskip \columnsep
-\hskip \columnwidth }}%
-\@combinedblfloats \@outputpage
-\begingroup \@dblfloatplacement \@startdblcolumn
-\@whilesw\if@fcolmade \fi
-{\@outputpage \@startdblcolumn }\endgroup
-\fi}
-\def\LTR@outputdblcol{%
- \if@firstcolumn
- \global \@firstcolumnfalse
- \global \setbox\@leftcolumn \box\@outputbox
- \else
- \global \@firstcolumntrue
- \setbox\@outputbox \vbox {%
- \hb@xt@\textwidth {%
- \hb@xt@\columnwidth {%
- \box\@leftcolumn \hss}%
- \hfil
- {\normalcolor\vrule \@width\columnseprule}%
- \hfil
- \hb@xt@\columnwidth {%
- \box\@outputbox \hss}%
- }%
- }%
- \@combinedblfloats
- \@outputpage
- \begingroup
- \@dblfloatplacement
- \@startdblcolumn
- \@whilesw\if@fcolmade \fi
- {\@outputpage
- \@startdblcolumn}%
- \endgroup
- \fi
-}
\renewcommand{\@outputdblcol}{\if@RTLmain\RTL@outputdblcol\else\LTR@outputdblcol\fi}
\newcommand{\RTLdblcol}{\renewcommand{\@outputdblcol}{\RTL@outputdblcol}}
\newcommand{\LTRdblcol}{\renewcommand{\@outputdblcol}{\LTR@outputdblcol}}
@@ -691,12 +647,14 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{caption}{\input{caption-xetex-bidi.def}}{}
\@ifpackageloaded{caption3}{\input{caption3-xetex-bidi.def}}{}
\@ifpackageloaded{crop}{\@ifclassloaded{memoir}{}{\input{crop-xetex-bidi.def}}}{}
+\@ifpackageloaded{floatrow}{\input{floatrow-xetex-bidi.def}}{}
\@ifpackageloaded{color}{\input{color-xetex-bidi.def}}{}
\@ifpackageloaded{cutwin}{\input{cutwin-xetex-bidi.def}}{}
+\@ifpackageloaded{ftnright}{\input{ftnright-xetex-bidi.def}}{}
\@ifpackageloaded{cuted}{\input{cuted-xetex-bidi.def}}{}
\@ifpackageloaded{xcolor}{\input{xcolor-xetex-bidi.def}}{}
\@ifpackageloaded{colortbl}{\input{colortbl-xetex-bidi.def}}{}
-\@ifpackageloaded{float}{\input{float-xetex-bidi.def}}{}
+\@ifpackageloaded{float}{\@ifpackageloaded{floatrow}{}{\input{float-xetex-bidi.def}}}{}
\@ifpackageloaded{flowfram}{\input{flowfram-xetex-bidi.def}}{}
\@ifpackageloaded{xltxtra}{\input{xltxtra-xetex-bidi.def}}{}
\@ifpackageloaded{wrapfig}{\input{wrapfig-xetex-bidi.def}}{}
@@ -708,11 +666,11 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{ntheorem-hyper}{\input{ntheorem-hyper-xetex-bidi.def}}{}
\@ifpackageloaded{fancyhdr}{\input{fancyhdr-xetex-bidi.def}}{}
\@ifpackageloaded{fix2col}{\input{fix2col-xetex-bidi.def}}{}
+\@ifpackageloaded{midfloat}{\input{midfloat-xetex-bidi.def}}{}
\@ifpackageloaded{draftwatermark}{\input{draftwatermark-xetex-bidi.def}}{}
\@ifpackageloaded{dblfnote}{\input{dblfnote-xetex-bidi.def}}{}
\@ifpackageloaded{empheq}{\input{empheq-xetex-bidi.def}}{}
\@ifpackageloaded{framed}{\input{framed-xetex-bidi.def}}{}
-\@ifpackageloaded{ftnright}{\input{ftnright-xetex-bidi.def}}{}
\@ifpackageloaded{pdfpages}{\input{pdfpages-xetex-bidi.def}}{}
\@ifpackageloaded{lettrine}{\input{lettrine-xetex-bidi.def}}{}
\@ifpackageloaded{listings}{\input{listings-xetex-bidi.def}}{}
@@ -748,6 +706,7 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\@ifpackageloaded{subfigure}{\input{subfigure-xetex-bidi.def}}{}
\@ifpackageloaded{longtable}{\input{longtable-xetex-bidi.def}}{}
\@ifpackageloaded{arydshln}{\input{arydshln-xetex-bidi.def}}{}
+\@ifpackageloaded{mdframed}{\input{mdframed-xetex-bidi.def}}{}
\@ifpackageloaded{multicol}{\input{multicol-xetex-bidi.def}}{}
\@ifpackageloaded{multienum}{\input{multienum-xetex-bidi.def}}{}
\@ifpackageloaded{natbib}{\input{natbib-xetex-bidi.def}}{}