[XeTeX] two columns with bidi

Mehdi Omidali mehdioa at gmail.com
Sun Aug 10 00:29:05 CEST 2008


Hi everyone,
Currently bidi has no command for changing the direction in two columns texts.
This problem even affect index part of a text because index part is typesseted
in two columns. I tried the following patch (which is, I think, from rlbabel)
and it solves the problem

%%%%%%%%For Right-to-Left two column command, I guess taken from rlbabel
\let\@old at outputdblcol\@outputdblcol
\newcommand{\rl at outputdblcol}{%
 \if at firstcolumn
   \global \@firstcolumnfalse
    \global \setbox\@leftcolumn \box\@outputbox
  \else
    \global \@firstcolumntrue
    \setbox\@outputbox \vbox {\hb at xt@\textwidth {%
                              \hskip\columnwidth%
                              \hfil\vrule\@width\columnseprule\hfil
                              \hb at xt@\columnwidth {%
                                \box\@leftcolumn \hss}%
                              \hb at xt@\columnwidth {%
                                \hskip-\textwidth%
                                \box\@outputbox \hss}%
                              \hskip\columnsep%
                              \hskip\columnwidth}}%
    \@combinedblfloats
    \@outputpage
    \begingroup
      \@dblfloatplacement
      \@startdblcolumn
      \@whilesw\if at fcolmade \fi
        {\@outputpage
         \@startdblcolumn}%
    \endgroup
 \fi}
\newcommand{\rldblcolumn}{\renewcommand{\@outputdblcol}{\rl at outputdblcol}}
\newcommand{\lrdblcolumn}{\renewcommand{\@outputdblcol}{\@old at outputdblcol}}
%set the default direction of the twocolumn texts to Right-to-Left
\rldblcolumn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Also I think changing 

\def\underline#1{\@@@underline{\if at rl\RL{#1}\else #1\fi}}

in bidi to 

\def\underline#1{\@@@underline{\ifmmode #1\else\if at rl\RL{#1}\else #1\fi\fi}}

makes bidi more stable with underline texts.



More information about the XeTeX mailing list