summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def64
1 files changed, 58 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
index f7666bcdb85..2479c363365 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
+++ b/Master/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{47809}
+%% \CheckSum{47931}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -34,7 +34,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-\ProvidesFile{latex-xetex-bidi.def}[2016/09/11 v1.2.8 bidi adaptations for `latex.ltx' for XeTeX engine]
+\ProvidesFile{latex-xetex-bidi.def}[2017/05/06 v1.2.9 bidi adaptations for `latex.ltx' for XeTeX engine]
\newcommand{\TeXXeTOn}{\TeXXeTstate=1 }
\newcommand{\TeXXeTOff}{\TeXXeTstate=0 }
\TeXXeTOn
@@ -378,6 +378,50 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\par}%
\fi}
+\newcount\bidi@column@check@number
+
+\def\bidi@column@status#1{\gdef\bidi@current@column@status{#1}}
+
+\def\bidi@set@column@status#1#2{%
+ \global\expandafter\let\csname #1\endcsname\bidi@current@column@status}
+
+\if@twocolumn
+\newcommand\DetectColumn[3][1]{%
+ \ifx\bidi@firstcolumn@status@write\relax
+ \PackageError{bidi}%
+ {Option 'DetectColumn' not selected}%
+ {\string\DetectColumn\space
+ requires the use of the 'DetectColumn'
+ option on the package}%
+ \fi
+ \global\advance\bidi@column@check@number\@ne
+ \edef\bidi@column@type{\expandafter\ifx
+ \csname bidi@column-\the\bidi@column@check@number\endcsname\relax
+ 0\else
+ \csname bidi@column-\the\bidi@column@check@number\endcsname
+ \fi}%
+ \ifcase \bidi@column@type\relax
+ \ifcase #1\or #2\or#3\fi % 0 not known use first column as default
+ \or
+ #2% % 1 First column
+ \or
+ #3% % 2 Second (Last column)
+ \else
+ \ERROR
+ \fi
+ \edef\next{\write\@auxout
+ {\string\bidi@set@column@status{bidi@column-\the\bidi@column@check@number}%
+ {\bidi@column@type}}}%
+ \next
+}
+
+\AtEndDocument{\def\bidi@set@column@status#1#2{%
+ \ifnum #2=\bidi@current@column@status\else
+ \@tempswatrue
+ \fi}%
+}
+\fi
+
\def\RTL@outputdblcol{%
\if@firstcolumn
\global\@firstcolumnfalse
@@ -405,9 +449,13 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
- \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
+ \hb@xt@\columnwidth{%
+ \bidi@firstcolumn@status@write%
+ \box\@leftcolumn \hss}%
\hskip -\textwidth
- \hb@xt@\columnwidth{\box\@outputbox \hss}%
+ \hb@xt@\columnwidth{%
+ \bidi@lastcolumn@status@write%
+ \box\@outputbox \hss}%
\hskip \columnsep
\hskip \columnwidth }}%
\@combinedblfloats
@@ -444,11 +492,15 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
- \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
+ \hb@xt@\columnwidth{%
+ \bidi@firstcolumn@status@write%
+ \box\@leftcolumn \hss}%
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
- \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
+ \hb@xt@\columnwidth{%
+ \bidi@lastcolumn@status@write%
+ \box\@outputbox \hss}}}%
\@combinedblfloats
\@setmarks
\@outputpage