<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>Hello, today I did several hacks for different tabular packages in LATeX that makes them to typeset tables from right to left, there is a problem with longtable.sty that it does not break tables. I thought you might find the codes useful. I would be very happy if someone could give me a hint to fix longtable.sty issue.<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>\@ifpackageloaded{stabular}{%<br>\def\@stabular{\if@RTL\global\@RTLtabtrue\fi<br>&nbsp;&nbsp; \leavevmode \bgroup \if@RTLtab\beginR \fi<br>&nbsp;&nbsp; \let\@acol\@tabacol
<br>&nbsp;&nbsp; \let\@classz\@tabclassz
<br>&nbsp;&nbsp; \let\@classiv\@tabclassiv \let\\\@tabularcr\@stabarray}<br>\def\endstabular{\crcr\egroup\if@RTLtab\egroup\endR\egroup\fi<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \egroup \if@RTLtab\endR\fi\egroup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \global\@RTLtabfalse}
<br>\expandafter \let \csname endstabular*\endcsname = \endstabular<br>\def\@sarray[#1]#2{%
<br>&nbsp; \bgroup
<br>&nbsp; \setbox\@arstrutbox\hbox{%
<br>&nbsp;&nbsp;&nbsp; \vrule \@height\arraystretch\ht\strutbox
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \@depth\arraystretch \dp\strutbox
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \@width\z@}%
<br>&nbsp; \@mkpream{#2}%
<br>&nbsp; \edef\@preamble{%
<br>&nbsp;&nbsp;&nbsp; \ialign \noexpand\@halignto
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}%
<br>&nbsp; \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
<br>&nbsp; \let\tabularnewline\\%
<br>%&nbsp;&nbsp;&nbsp; \let\par\@empty
<br>&nbsp;&nbsp;&nbsp; \let\@sharp##%
<br>&nbsp;&nbsp;&nbsp; \set@typeset@protect
<br>&nbsp;&nbsp;&nbsp; \lineskip\z@skip\baselineskip\z@skip<br>&nbsp; \if@RTLtab\hbox\bgroup\beginR\vbox\bgroup\fi
<br>&nbsp;&nbsp;&nbsp; \@preamble}<br>}{}<br><br>\@ifpackageloaded{longtable}{%<br>\def\LT@makecaption#1#2#3{%<br>&nbsp; \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%<br>&nbsp;&nbsp;&nbsp; \sbox\@tempboxa{\if@RTL\beginR\fi#1{#2: }#3\if@RTL\endR\fi}%<br>&nbsp;&nbsp;&nbsp; \ifdim\wd\@tempboxa&gt;\hsize<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #1{#2: }#3%<br>&nbsp;&nbsp;&nbsp; \else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \hbox to\hsize{\hfil\box\@tempboxa\hfil}%<br>&nbsp;&nbsp;&nbsp; \fi<br>&nbsp;&nbsp;&nbsp; \endgraf\vskip\baselineskip}%<br>&nbsp; \hss}}}<br><br>\def\longtable{\if@RTL\global\@RTLtabtrue\fi%<br>&nbsp; \par<br>&nbsp; \ifx\multicols\@undefined<br>&nbsp; \else<br>&nbsp;&nbsp;&nbsp;&nbsp; \ifnum\col@number&gt;\@ne<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \@twocolumntrue<br>&nbsp;&nbsp;&nbsp;&nbsp; \fi<br>&nbsp; \fi<br>&nbsp; \if@twocolumn<br>&nbsp;&nbsp;&nbsp; \LT@err{longtable not in 1-column mode}\@ehc<br>&nbsp; \fi<br>&nbsp; \begingroup \if@RTLtab\beginR \fi<br>&nbsp; \@ifnextchar[\LT@array{\LT@array[x]}}<br><br>\def\LT@array[#1]#2{%<br>&nbsp; \refstepcounter{table}\stepcounter{LT@tables}%<br>&nbsp; \if l#1%<br>&nbsp;&nbsp;&nbsp; \LTleft\z@ \LTright\fill<br>&nbsp; \else\if r#1%<br>&nbsp;&nbsp;&nbsp; \LTleft\fill \LTright\z@<br>&nbsp; \else\if c#1%<br>&nbsp;&nbsp;&nbsp; \LTleft\fill \LTright\fill<br>&nbsp; \fi\fi\fi<br>&nbsp; \let\LT@mcol\multicolumn<br>&nbsp; \let\LT@@tabarray\@tabarray<br>&nbsp; \let\LT@@hl\hline<br>&nbsp; \def\@tabarray{%<br>&nbsp;&nbsp;&nbsp; \let\hline\LT@@hl<br>&nbsp;&nbsp;&nbsp; \LT@@tabarray}%<br>&nbsp; \let\\\LT@tabularcr\let\tabularnewline\\%<br>&nbsp; \def\newpage{\noalign{\break}}%<br>&nbsp; \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%<br>&nbsp; \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%<br>&nbsp; \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption<br>&nbsp; \@tempdima\ht\strutbox<br>&nbsp; \let\@endpbox\LT@endpbox<br>&nbsp; \ifx\extrarowheight\@undefined<br>&nbsp;&nbsp;&nbsp; \let\@acol\@tabacol<br>&nbsp;&nbsp;&nbsp; \let\@classz\@tabclassz \let\@classiv\@tabclassiv<br>&nbsp;&nbsp;&nbsp; \def\@startpbox{\vtop\LT@startpbox}%<br>&nbsp;&nbsp;&nbsp; \let\@@startpbox\@startpbox<br>&nbsp;&nbsp;&nbsp; \let\@@endpbox\@endpbox<br>&nbsp;&nbsp;&nbsp; \let\LT@LL@FM@cr\@tabularcr<br>&nbsp; \else<br>&nbsp;&nbsp;&nbsp; \advance\@tempdima\extrarowheight<br>&nbsp;&nbsp;&nbsp; \col@sep\tabcolsep<br>&nbsp;&nbsp;&nbsp; \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr<br>&nbsp; \fi<br>&nbsp; \setbox\@arstrutbox\hbox{\vrule<br>&nbsp;&nbsp;&nbsp; \@height \arraystretch \@tempdima<br>&nbsp;&nbsp;&nbsp; \@depth \arraystretch \dp \strutbox<br>&nbsp;&nbsp;&nbsp; \@width \z@}%<br>&nbsp; \let\@sharp##\let\protect\relax<br>&nbsp;&nbsp; \begingroup<br>&nbsp;&nbsp;&nbsp; \@mkpream{#2}%<br>&nbsp;&nbsp;&nbsp; \xdef\LT@bchunk{%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \global\advance\c@LT@chunks\@ne<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \global\LT@rows\z@\setbox\z@\vbox\bgroup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \LT@setprevdepth<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \tabskip\LTleft \noexpand\halign to\hsize\bgroup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%<br>&nbsp; \endgroup<br>&nbsp; \expandafter\LT@nofcols\LT@bchunk&amp;\LT@nofcols<br>&nbsp; \LT@make@row<br>&nbsp; \m@th\let\par\@empty<br>&nbsp; \everycr{}\lineskip\z@\baselineskip\z@<br>&nbsp; \if@RTLtab\hbox\bgroup\beginR\vbox\bgroup\fi<br>&nbsp; \LT@bchunk}<br><br><br>\def\endlongtable{%<br>&nbsp; \crcr<br>&nbsp; \noalign{%<br>&nbsp;&nbsp;&nbsp; \let\LT@entry\LT@entry@chop<br>&nbsp;&nbsp;&nbsp; \xdef\LT@save@row{\LT@save@row}}%<br>&nbsp; \LT@echunk<br>&nbsp; \LT@start<br>&nbsp; \unvbox\z@<br>&nbsp; \LT@get@widths<br>&nbsp; \if@filesw<br>&nbsp;&nbsp;&nbsp; {\let\LT@entry\LT@entry@write\immediate\write\@auxout{%<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \gdef\expandafter\noexpand<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \csname LT@\romannumeral\c@LT@tables\endcsname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\LT@save@row}}}%<br>&nbsp; \fi<br>&nbsp; \ifx\LT@save@row\LT@@save@row<br>&nbsp; \else<br>&nbsp;&nbsp;&nbsp; \LT@warn{Column \@width s have changed\MessageBreak<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in table \thetable}%<br>&nbsp;&nbsp;&nbsp; \LT@final@warn<br>&nbsp; \fi<br>&nbsp; \endgraf\penalty -\LT@end@pen<br>&nbsp; \egroup\if@RTLtab\endR\egroup\fi<br>&nbsp;&nbsp; \if@RTLtab\endR\fi \endgroup<br>&nbsp; \global\@mparbottom\z@<br>&nbsp; \pagegoal\vsize<br>&nbsp; \endgraf\penalty\z@\addvspace\LTpost<br>&nbsp; \ifvoid\footins\else\insert\footins{}\fi<br>&nbsp;&nbsp; \global\@RTLtabfalse}<br>}{}<br><br>\@ifpackageloaded{tabls}{%<br><br>\def\endtabular{\endarray $\if@RTLtab\endR\fi\egroup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \global\@RTLtabfalse}<br><br>\expandafter\let\csname endtabular*\endcsname=\endtabular<br><br>\def\endarray{\ifvmode\csname crcr\endcsname % just do \crcr if \\ given<br>&nbsp; \else \\[\z@ \global\advance\@arstdepth-\@otarlinesep]% <br>&nbsp; \fi\egroup\if@RTLtab\egroup\endR\egroup\fi\@unrecurse\egroup}<br><br>\def\@array[#1]#2{%&nbsp; remember global variables to allow recursion:<br>&nbsp;\edef\@unrecurse{\global\@skip@bove\the\@skip@bove<br>&nbsp;&nbsp;&nbsp;&nbsp; \global\@arstheight\the\@arstheight\global\@arstdepth\the\@arstdepth}%<br>%&nbsp; Make the strut on the first line be shorter by the linesep outside<br>&nbsp;\let\@otarlinesep\@tarlinesep \global\@skip@bove-\@otarlinesep<br>%&nbsp; This setup works for both tabular and array because of this test:<br>&nbsp;\ifx\@classz\@arrayclassz \let\@tarlinesep\arraylinesep<br>&nbsp;\else \let\@tarlinesep\tablinesep \fi<br>&nbsp;\divide\@tarlinesep\tw@ % half sep is applied to height &amp; depth<br>&nbsp;\let\@seesize\relax \let\@rememsize\relax \@mkpream{#2}%<br>&nbsp;\@tempdima\arraystretch\ht\strutbox \@tempdimb\arraystretch\dp\strutbox<br>&nbsp;\ifdim\@tarlinesep&gt;\z@ % (need \protect for \multicolumn)<br>&nbsp;&nbsp; \def\@rememsize{\protect\@r@m@msize}\let\@seesize\@s@@size<br>&nbsp;&nbsp; \advance\@tempdima-\@tarlinesep \advance\@tempdimb-\@tarlinesep<br>&nbsp;\fi \setbox\@arstrutbox\hbox{% set up smaller strut<br>&nbsp;&nbsp;&nbsp; \vrule \@height\@tempdima \@depth\@tempdimb \@width\z@}%<br>&nbsp;\let\protect\noexpand<br>&nbsp;\edef\@preamble{\ialign \noexpand\@halignto \bgroup<br>&nbsp;\unhcopy\@arstrutbox \@preamble \tabskip\z@skip &amp;\@sharp \cr}%<br>% I have added an extra column (&amp;\@sharp) to take the smart strut.<br>&nbsp;\let\@startpbox\@@startpbox \let\@endpbox\@@endpbox<br>&nbsp;\if#1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi<br>&nbsp;\bgroup \let\par\@empty<br>&nbsp;\global\@arstheight\ht\@arstrutbox \global\@arstdepth\dp\@arstrutbox<br>&nbsp;\advance\extrarulesep.5\arrayrulewidth<br>&nbsp;\let\@sharp##\let\protect\relax \lineskip\z@skip \baselineskip\z@skip<br>&nbsp;\if@RTLtab\hbox\bgroup\beginR\vbox\bgroup\fi<br>&nbsp;\@preamble}<br>}{}<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br><br>And I have attached the tex file and pdf output of an example of longtable.sty, so you can see the issue clearly.<br><br /><hr />Find out how with Windows Live! <a href='http://windowslive.ninemsn.com.au/' target='_new'>Want to stay on top of your life online?</a></body>
</html>