[XeTeX] Bidi equation numbering

Aryeh Weiss aryeh at cc.huji.ac.il
Tue Oct 6 16:45:21 CEST 2009


As a final note, I can get the equation number to the right by defining 
the following equation environments:

\makeatletter
\def\equationR{\beginR$$\refstepcounter{equation}}
\def\endequationR{\eqno \hbox{\@eqnnum}$$\endR\@ignoretrue}
\def\@eqnnum{{\normalfont \normalcolor
\if at RTL\beginR\fi(\theequation)\if at RTL\endR\fi}}

\def\equation{\beginL$$\refstepcounter{equation}}
\def\endequation{\eqno \hbox{\@eqnnum}$$\endL\@ignoretrue}
\def\@eqnnum{{\normalfont \normalcolor
\if at RTL\beginR\fi(\theequation)\if at RTL\endR\fi}}
\makeatother

So what I still dont know is now to pick up the [leqno] flag to do it 
more elegantly than defining two separate equation environments.

Thanks to both Mehdi and Vafa for their prompt and helpful replies.

--aryeh

Vafa Khalighi wrote:
> 
>     I have a problem with the equation environment using bidi.sty. The 
> 
>     attached source and PDF output should show the problem. The equation 
>     number appears one the right side of the page, even when working RTL, 
>     and it appears as )I( .
> 
> 
> Can you send a minimal example that I can try and understand the issue 
> you are talking about. I believe there are things in RTL that reversing 
> them does not make sense. One example is equation numbers. In a normal 
> LaTeX document, equation numbers appear on the right and if you use 
> leqno option, they appear in the left. This should be absolutely 
> unchanged whether you are in RTL mode or in LTR mode. Now if you define 
> your fonts correctly, equation numbers as in your )I( example, should 
> appear correctly.
> 
>     Underneath these equation, is an example of how I shold what it to 
>     appear (ie, with the number left  justified, and with the parentheses 
> 
>     correctly placed.
> 
>      
> 
> 
> I do not agree with the equation being on the left. I believe, it should 
> be on the right. I actually think if the equation numbers with defualt 
> settings were on the left, then it would be really funny, what would you 
> then call leqno (so equations appear on the right as your taste shows)?
> 
> So if you like to have equations on the left, use leqno option.
> 
>     Also, note what happens to the English sentence in the RTL mode. The 
> 
>     sentence should read "We now insert an equation, still under setRTL." 
>     However, I assume that the correct thing to do is to switch to setLTR 
>     before this sentence if I want itto be set correctly.
> 
> I do not understand your point here. In RTL mode, we typeset from right 
> to left and in LTR mode, we typeset from left to right. If you need 
> short LTR insertions in RTL mode use \LRE{} and if you need short RTL 
> insertions in LTR mode, then use \RLE{}. In bidi, we make documents RTL 
> or LTR by using the \everypar primitive. For more details look at XeTeX 
> companion. You also can use grouping like:
> 
> {\setRTL
> 
> This is a sentense that appears RT.}
> 
> 
> This is a sentense that appears LTR.
> 
> 
> That blank line is vital to have.
> 
> 
> If you still think there is an issue, send a minimal example used two 
> fonts in it, one for Hebew and one for English and then I will look into 
> it to see if there is anything for me to investigate. But I think, you 
> should have no problem.
> 
> 
> 
>  


-- 
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384050



More information about the XeTeX mailing list