W3C home > Mailing lists > Public > www-math@w3.org > November 2013

Re: RTL directionality in LaTeX

From: Ross Moore <ross.moore@mq.edu.au>
Date: Wed, 6 Nov 2013 09:04:31 +1100
Cc: Murray Sargent <murrays@exchange.microsoft.com>, Peter Krautzberger <peter.krautzberger@mathjax.org>, Frédéric WANG <fred.wang@free.fr>, Khaled Hosny <khaledhosny@eglug.org>, "www-math@w3.org" <www-math@w3.org>, Azzeddine LAZREK <a_lazrek@yahoo.fr>
Message-Id: <E92B9B58-17F4-4D0D-AE47-D5C42C9A8109@mq.edu.au>
To: David Carlisle <davidc@nag.co.uk>
Hi David,

On 06/11/2013, at 8:07 AM, David Carlisle wrote:

> On 05/11/2013 20:34, Ross Moore wrote:
>> Directionality is a property of the math environment, not of the
>> content in that environment
> 
> 
> Usually but not always. After the review of use cases in the Arabic math
> note, directionality in MathML3 is allowed at the level of <mrow>, not
> just on the top level <math>. (Whether any particular TeX or MathML
> rendering agent can support switching at that level is another issue but
> the specification allows it.)

OK. Thanks for that clarification.


On 06/11/2013, at 8:43 AM, Khaled Hosny wrote:

> On Wed, Nov 06, 2013 at 07:34:05AM +1100, Ross Moore wrote:
>> I would vote for inserting something like \mathdir{rtl}  
> 
> Please note that \mathdir is already an Omega/Aleph/LuaTeX[1] primitive
> name.
> 
> Regards,
> Khaled
> 
> 1. In case of LuaTeX it is "hidden" by default, but formats my choose to
>   enable it.


With this information, my advice would be to have a macro that
effectively just sets a switch, in the usual TeX-like way,
whose value is confined to a brace-delimited environment. 
Internal macro expansion either respects the value of that switch 
or ignores it.
The details are left to developers to fill in.

e.g. user-syntax could be:
  \[
     x^2 + 2\,x + 1 = 
    \begin{cases} 
          (x+1)^2 & \text{ in Roman LTR script (LTR)}\\
      {\setmathdir{rtl} (x+1)^2 } & \text{in Arabic (RTL)}
    \end{cases}
  \]

Thus in Omega/Aleph/LuaTeX  the primitive is set locally.
Other formats would need to implement much more to get it right,
or just gobble the argument and issue a warning message that
directionality support is not yet available.

This is in accordance, I think, with the discussion here:

  http://tug.org/pipermail/luatex/2012-December/003929.html

where direct use of the primitive is delimited.


> 
> David


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore@mq.edu.au 
Mathematics Department                           office: E7A-206      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





logo.png
(image/png attachment: logo.png)

Received on Tuesday, 5 November 2013 22:05:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 5 November 2013 22:05:05 UTC