Mime-Version: |
1.0 (Apple Message framework v930.3) |
Sender: |
|
Subject: |
|
From: |
|
Date: |
Thu, 14 May 2009 15:21:27 +0930 |
In-Reply-To: |
|
Content-Type: |
multipart/signed; boundary=Apple-Mail-2--167400972; micalg=sha1;
protocol="application/pkcs7-signature" |
Reply-To: |
|
Parts/Attachments: |
|
|
On 13/05/2009, at 5:28 PM, Vafa Khalighi wrote:
> I did a hack to make tabular in array.sty RTL and this is what I
> have done
[snip]
> Please note that in RTL we both want the order of columns to be RTL
> and each entry in each cell to be RTL.
[snip]
Hi Vafa (and others),
Tweaking the code for a while resulted in something that's working, I
think. The minimal example appended might help you get it working.
(I'm not really sure where your original problem was coming from,
though; I seem to have done basically the same thing as you. No time
to look more closely, though.)
Hope this helps,
Will
P.S. Note that I didn't find it necessary to include the outer
\beginR..\endR around the dollar signs; you might be able to omit it
in your other code as well.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{array}
\makeatletter
\TeXXeTstate=1
\def\tabular{\gdef\@halignto{}\@tabular}
\def\@tabular{%
\leavevmode
\hbox\bgroup
$%
\@tabularinit
\@array
}
\renewcommand\@array[2][c]{%
\@tempdima \ht \strutbox
\advance \@tempdima by\extrarowheight
\setbox \@arstrutbox \hbox{%
\vrule \@height \arraystretch \@tempdima
\@depth \arraystretch \dp \strutbox
\@width \z@
}%
\begingroup
\@mkpream{#2}%
\xdef\@preamble{%
\noexpand \ialign \@halignto
\bgroup \@arstrut \@preamble
\tabskip \z@ \cr
}%
\endgroup
\@arrayleft
\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
\bgroup
\@arrayinit
\hbox\bgroup\beginR\vbox\bgroup
\@preamble
% indent
}
%% environment body goes here
\def\endtabular{%
\crcr
\egroup % \bgroup from \@preamble
\egroup\endR\egroup % \vbox\hbox
\egroup
\gdef\@preamble{}%
$%
\egroup % original \hbox
}
\def\@tabularinit{%
\col@sep\tabcolsep
\let \d@llarbegin \begingroup
\let \d@llarend \endgroup
}
\def\@arrayinit{%
\let \@sharp ##
\let \protect \relax
\lineskip \z@
\baselineskip \z@
\m@th
\let \\ \@arraycr
\let \tabularnewline \\%
\let \par \@empty
}
\makeatother
\begin{document}
\begin{tabular}{|l|l|}\hline
vafa khalighi&shahrzad khalighi\\ \hline
\end{tabular}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|