<div dir="ltr">I am trying to figure out how I can make longtable typeset RTL tabulars but I started with something much simpler to understand what I should do. The bigtabular package is defined as:<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
\newskip\Tabularleftskip \Tabularleftskip\@flushglue<br>\newskip\Tabularrightskip \Tabularrightskip\@flushglue<br>\newbox\Tabularbox<br>\newcount\Tabularcount<br>\newcount\Tabularcolumns<br>\def\@Tabclassz{\global\advance\Tabularcount\@ne\@tabclassz}<br>
\let\@latexclassiii\@classiii<br>\def\@Tabclassiii{\global\advance\Tabularcount\@ne\@latexclassiii}<br>\def\@Tabularcr{{\ifnum0=`}\fi\@ifstar{\@xTabularcr}{\@xTabularcr}}<br>\def\@xTabularcr{\@ifnextchar[{\@argTabularcr}{\ifnum0=`{\fi}\cr<br>
\noalign{\pagebreak[1]}}}<br> <br>\def\@argTabularcr[#1]{\ifnum0=`{\fi}\ifdim #1>\z@<br> \unskip\@xargarraycr{#1}\else \@yargarraycr{#1}\fi<br> \noalign{\pagebreak[1]}}<br>\let\@latexhline\hline<br>\let\@latextabarray\@tabarray<br>
\def\@tabarray{\let\hline\@latexhline\@latextabarray}<br>\def\Tabularhline{\multispan{\Tabularcolumns}{\unskip\leaders\hrule<br> height\arrayrulewidth\hfill}\cr<br> \noalign{\vskip-\arrayrulewidth\pagebreak[2]}%<br> \multispan{\Tabularcolumns}{\unskip\leaders\hrule<br>
height\arrayrulewidth\hfill}\cr}<br> <br>\def\Tabular#1{\trivlist\item[]\noindent<br> \setbox\Tabularbox\vbox\bgroup<br> \let\@acol\@tabacol<br> \let\@classz\@Tabclassz<br> \let\@classiii\@Tabclassiii<br> \let\@classiv\@tabclassiv<br>
\let\\\@Tabularcr<br> \setbox\@arstrutbox=\hbox{\vrule<br> height\arraystretch \ht\strutbox<br> depth\arraystretch \dp\strutbox<br> width\z@}%<br> \global\Tabularcount\z@<br> \@mkpream{#1}%<br>
\Tabularcolumns\Tabularcount<br> \let\hline\Tabularhline<br> \let\@classiii\@latexclassiii<br> \tabskip\Tabularleftskip<br> \edef\@preamble{\halign to\linewidth\bgroup<br> \tabskip\z@ \@arstrut \@preamble<br>
\tabskip\Tabularrightskip \cr}%<br> \let\@starpbox\@@startpbox<br> \let\@endpbox\@@endpbox<br> \let\@sharp##\let\protect\relax<br> \lineskip\z@\baselineskip\z@<br> \@preamble}<br> <br>\def\endTabular{\crcr\egroup\egroup\unvbox\Tabularbox\endtrivlist}<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br><br>To make it typeset tabular right to left, I thought of changing \Tabular and \endTabular as follow:<br><br>\def\Tabular#1{\trivlist\item[]\noindent<br>
\setbox\Tabularbox\vbox\bgroup<br>
\let\@acol\@tabacol<br>
\let\@classz\@Tabclassz<br>
\let\@classiii\@Tabclassiii<br>
\let\@classiv\@tabclassiv<br>
\let\\\@Tabularcr<br>
\setbox\@arstrutbox=\hbox{\vrule<br>
height\arraystretch \ht\strutbox<br>
depth\arraystretch \dp\strutbox<br>
width\z@}%<br>
\global\Tabularcount\z@<br>
\@mkpream{#1}%<br>
\Tabularcolumns\Tabularcount<br>
\let\hline\Tabularhline<br>
\let\@classiii\@latexclassiii<br>
\tabskip\Tabularleftskip<br>
\edef\@preamble{\halign to\linewidth\bgroup<br>
\tabskip\z@ \@arstrut \@preamble<br>
\tabskip\Tabularrightskip \cr}%<br>
\let\@starpbox\@@startpbox<br>
\let\@endpbox\@@endpbox<br>
\let\@sharp##\let\protect\relax<br>
\lineskip\z@\baselineskip\z@<br>
\hbox\bgroup\beginR\vbox\bgroup \@preamble} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This is my first change<br>
<br>
\def\endTabular{\crcr\egroup\egroup\endR\egroup\egroup\unvbox\Tabularbox\endtrivlist}<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br><br>but it no longer works (tabular appears on one page and no pagebreak happens). What should I do to fix this?<br><br><br>Thanks<br></div>