Re: RTL directionality in LaTeX

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
------------------------------------------------------------------------

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