On Wed, Oct 17, 2001, Tzafrir Cohen wrote about "bidi in twocolumns": > Hi > > I needed to typeset text in two columns and didn't want to manually break > columns and visually arange them. > > Here is a small modification to the multicol package to have bidi support > (note that this allows only two columns). This is an initial version. >...

Tzafrir - as far as I know (but I didn't test your specific patch) there's a problem with your patch, because the dvi of the two columns is _output_ at the wrong order: you still output the left column first and the right column after it, but now this means that the logically first column (in Hebrew that is the right column) is ouput second... This causes problems, if I remember correctly, in that that lines are also output in incorrect order to the table of contents. Try having many sections on a few pages, and see what I mean.

When I faced the same problem when I wrote my 2.09 Hebrew support, what I did instead is to keep the boxes output in the same order, but move them to the correct places by hfills. Here's my code: (of course, you'll need to modify it to LaTeX 2e)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Two Columns % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % If unchanged, the two column setup in latex puts the columns in the % wrong direction for Hebrew (in which the first column should appear % on the right, and the second on the left). % % We should use the hebdocument flag to check if the document is a Hebrew one, % since checking the current paragraph is not the correct thing to do. % % \@outputdblcol (from latex.tex) is called from \@opcol and outputs a double % column page (after the second column. The first column is not output but % instead kept in a box). This is the macro we need to change.

% The first try to fix this (not a good fix!) was to switch the outputing % of the columns (once both columns are ready) in case of Hebrew. We used % hebdocument to check if the document is a Hebrew one (since checking % the current paragraph is not the correct thing to do). This worked, but % since the columns are output to dvi in reverse order, the table of contents % also got written in mixed up order, which was totally unacceptable, so this % fix was abandoned: % %\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse % \global\setbox\@leftcolumn\box\@outputbox % \else \global\@firstcolumntrue % \setbox\@outputbox\vbox{\hbox to\textwidth{% % \ifhebdocument % \hbox to\columnwidth{\box\@outputbox \hss}% % \hfil\vrule width\columnseprule\hfil % \hbox to\columnwidth{\box\@leftcolumn \hss}% % \else % \hbox to\columnwidth{\box\@leftcolumn \hss}% % \hfil\vrule width\columnseprule\hfil % \hbox to\columnwidth{\box\@outputbox \hss}% % \fi }}\@combinedblfloats % \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn % \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup % \fi}

% The following definition is more eleborate, but outputs the column boxes % in the correct order. % % Note that @leftcolumn is a misnomer in case of hebrew - it will actually % become the right column. However, I chose not to waste another box variable % just for having better names. Perhaps I should have renamed @leftcolumn % to @thefirstcolumn or something.

\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse \global\setbox\@leftcolumn\box\@outputbox \else \global\@firstcolumntrue \setbox\@outputbox\vbox{\hbox to\textwidth{% \ifhebdocument \hbox to 0pt{\hbox to\textwidth{% \hss \hbox to\columnwidth{\box\@leftcolumn \hss}% }} \hfil\vrule width\columnseprule\hfil \hbox to 0pt{\hss\hbox to\textwidth{% \hbox to\columnwidth{\box\@outputbox \hss}% }} \else \hbox to\columnwidth{\box\@leftcolumn \hss}% \hfil\vrule width\columnseprule\hfil \hbox to\columnwidth{\box\@outputbox \hss}% \fi }}\@combinedblfloats \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup \fi}

-- Nadav Har'El | Wednesday, Oct 17 2001, 1 Heshvan 5762 [log in to unmask] |----------------------------------------- Phone: +972-53-245868, ICQ 13349191 |Disclaimer: The opinions expressed above http://nadav.harel.org.il |are not my own.

Back to: Top of message | Previous page | Main IVRITEX page

 LISTSERV.TAU.AC.IL