diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def | 69 |
1 files changed, 40 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def index db61a88f601..3b1fe8e6153 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def +++ b/Master/texmf-dist/tex/xelatex/bidi/multicol-xetex-bidi.def @@ -17,7 +17,7 @@ %% by Vafa Khalighi. %% %% -%% \CheckSum{42079} +%% \CheckSum{42098} %% \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{multicol-xetex-bidi.def}[2013/11/11 v0.3 bidi adaptations for multicol package for XeTeX engine] +\ProvidesFile{multicol-xetex-bidi.def}[2014/04/20 v0.4 bidi adaptations for multicol package for XeTeX engine] \def\page@sofar{% \process@cols\mult@rightbox {\ifvoid\count@ @@ -57,14 +57,36 @@ \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@ \moveright\multicol@leftmargin \hbox to\full@width{% - \if@RTL - \process@cols\mult@gfirstbox{% - \hskip\hsize - \hss{\columnseprulecolor\vrule - \@width\columnseprule}\hss - }% + \bidi@multicol@align@columns + \rlap{\phantom p}% + }% + \kern-\dimen\tw@ + \ifdim\dimen\tw@ = \mc@gridwarn + \PackageWarning{multicol}% + {Very deep columns!\MessageBreak + Grid alignment might be broken}% + \fi +} +\def\LTR@column@boxes{% + \process@cols\mult@gfirstbox{% + \ifdim\dp\count@>\dimen\tw@ + \global\dimen\tw@\dp\count@ \fi + \box\count@ + \hss{\columnseprulecolor\vrule + \@width\columnseprule}\hss}% + \ifdim\dp\mult@rightbox>\dimen\tw@ + \global\dimen\tw@\dp\mult@rightbox \fi + \box\mult@rightbox +} + +\def\RTL@column@boxes{% + \process@cols\mult@gfirstbox{% \hskip\hsize - \process@cols\mult@gfirstbox{% + \hss{\columnseprulecolor\vrule + \@width\columnseprule}\hss + }% + \hskip\hsize + \process@cols\mult@gfirstbox{% \ifdim\dp\count@>\dimen\tw@ \global\dimen\tw@\dp\count@ \fi \hskip-\hsize @@ -78,26 +100,15 @@ \box\mult@rightbox \hskip-\hsize \hskip\full@width - \else - \process@cols\mult@gfirstbox{% - \ifdim\dp\count@>\dimen\tw@ - \global\dimen\tw@\dp\count@ \fi - \box\count@ - \hss{\columnseprulecolor\vrule - \@width\columnseprule}\hss}% - \ifdim\dp\mult@rightbox>\dimen\tw@ - \global\dimen\tw@\dp\mult@rightbox \fi - \box\mult@rightbox - \fi - \rlap{\phantom p}% - }% - \kern-\dimen\tw@ - \ifdim\dimen\tw@ = \mc@gridwarn - \PackageWarning{multicol}% - {Very deep columns!\MessageBreak - Grid alignment might be broken}% - \fi -} + } +\newcommand\RTLmulticolcolumns + {\let\bidi@multicol@align@columns + \RTL@column@boxes} +\newcommand\LTRmulticolcolumns + {\let\bidi@multicol@align@columns + \LTR@column@boxes} +\newcommand\bidi@multicol@align@columns + {\if@RTLmain\RTL@column@boxes\else\LTR@column@boxes\fi} \def\multicols#1{\col@number#1\relax \ifnum\col@number<\tw@ \PackageWarning{multicol}% |