<div dir="ltr">Thanks but that does not work and TeX complains abou missing \endR or \endL.<br><br><div class="gmail_quote">On Mon, Sep 12, 2011 at 4:37 PM, Paul Isambert <span dir="ltr"><<a href="mailto:zappathustra@free.fr">zappathustra@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
Le 12/09/2011 08:05, Vafa Khalighi a écrit :<br>
</div><div><div></div><div class="h5">> > I am trying to figure out how I can make longtable typeset RTL tabulars but<br>
I<br>
started with something much simpler to understand what I should do. The<br>
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<br>
\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}<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This is my first change<br>
> ><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<br>
happens).<br>
What should I do to fix this?<br>
<br>
<br>
</div></div><div class="im">When \Tabularbox is unboxed, it normally releases the horizontal boxes making up<br>
the lines of the tabular; in your case, it releases the first hbox you've added,<br>
in which the lines of the tabular are still taken as a whole (hence no<br>
possibility to break).<br>
<br>
I don't know much about RTL typesetting, but to me the solution is simply to add<br>
\beginR just after<br>
<br>
\setbox\Tabularbox\vbox\bgroup<br>
<br>
and \endR between the two \egroup's in the original \endTabular.<br>
<br>
Best,<br>
Paul<br>
</div>_______________________________________________<br>
TeX FAQ: <a href="http://www.tex.ac.uk/faq" target="_blank">http://www.tex.ac.uk/faq</a><br>
Mailing list archives: <a href="http://tug.org/pipermail/texhax/" target="_blank">http://tug.org/pipermail/texhax/</a><br>
More links: <a href="http://tug.org/begin.html" target="_blank">http://tug.org/begin.html</a><br>
<br>
Automated subscription management: <a href="http://tug.org/mailman/listinfo/texhax" target="_blank">http://tug.org/mailman/listinfo/texhax</a><br>
Human mailing list managers: <a href="mailto:postmaster@tug.org">postmaster@tug.org</a><br>
</blockquote></div><br></div>