# Re: RTL directionality in LaTeX

From: Khaled Hosny <khaledhosny@eglug.org>
Date: Tue, 5 Nov 2013 16:43:45 +0200
To: Frédéric WANG <fred.wang@free.fr>
Cc: www-math@w3.org, Azzeddine LAZREK <a_lazrek@yahoo.fr>
Message-ID: <20131105144345.GA20066@khaled-laptop>
On Tue, Nov 05, 2013 at 03:26:53PM +0100, Frédéric WANG wrote:
> Le 05/11/2013 15:13, Daniel Marques a écrit :
> >
> >Dear all,
> >
> >As part of the conversion between MathML and LaTeX, we need to express the
> >MathML dir attribute in LaTeX (attribute used to express the
> >directionality, for example rtl as right-to-left).
> >
> >We do not care at all that the notation is not an actual LaTeX package
> >implementation but something that will be implemented in the future by
> >WIRIS, MathJax or any other lightweight Web based implementation of LaTeX.
> >
> >Our suggestion is to use something like \dir{rtl}{x^2} for <math
> >dir="rtl"><msup><mi>x</mi><mn>2</mn></msup>[/itex]
> >
> >Dani
> >
> Hi Daniel,
>
> Currently you can probably use the \mmlToken command in MathJax to attach a
> dir attribute to MathML token. You can also do \style{direction:rtl}{math}
> to attach the corresponding style attribute to any MathML element and Gecko
> will interpret that the same way as the MathML dir attribute (however, this
> won't work with other MathML rendering engines).
>
> Personally, your proposal \dir{rtl} (or even just \rtl{...}) seems the
> simplest way and the parsing can be easily implemented in MathJax (although
> MathJax will still need to implement the MathML RTL rendering).
>
> I'm cc'ing Khaled and Azzedine since I think they had experimental LaTeX
> implementations with RTL / Arabic support and probably know more about that
> and might even mention existing LaTeX packages.

I’m not aware of any LaTeX packages for setting RTL math, and the only
TeX engines capable of setting RTL math can only set the direction of
the whole formula and before entering math mode, so the notation would
be something like \rtlmath{$x^2$} or even a global switch (an
environment, a package option etc.). Since the direction of text and
math are not always the same (many RTL languages set math LTR), the
command need to be explicitly for math.

But if it is just some pseudo-LaTeX syntax, I don’t think the actual
notation matters much, but \rtl{} looks more LaTeX-like to me.

Regards,
Khaled

Received on Tuesday, 5 November 2013 14:44:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:46 UTC