[luatex] About \mathdir and \pardir

Hans Hagen pragma at wxs.nl
Thu Apr 1 19:08:27 CEST 2010


On 1-4-2010 16:02, Taco Hoekwater wrote:
> Vafa Khalighi wrote:
>>
>> $$1+2=3$$
>
> Definitions like those expands roughly into
>
> <starthmode (fixing \pardir for this par)>
> <indentbox>
> <set \pardir>
> <startmathmode>
> < set \mathdir>
> </stopmathmode (restoring \mathdir)>
> <mlist processing using current (outer)\mathdir>
> <stophmode (restoring \pardir)>
> <parbreaking using outer \pardir>
>
>
> In both cases (\everypar and \everydisplay) the dir assignment
> is ignored: the relevant direction from the outer level is the
> one used (but for two different reasons).
>
> I expect you can get around the \everydisplay by using
>
> \def\mathsdir{\@EA\global\if at RTLmaths\mathdir TRT\else\mathdir TLT\fi}
>
> but have not actually tried, I am keying this in from memory.
>
>> I think this behaviour is not correct. LuaTeX's direction primitives
>> should
>> be accessible through \everypar, \everymath and \everydisplay primitives.
>
> You may well be right, but that is backward incompatible so it needs
> consensus among the mixed typesetting users and even then a very
> explicit announcement (implementation could turn out to be non-trivial
> as well, but is definitely doable). So I would ask users that have an
> interest in mixed direction typesetting to think about this thoroughly
> and voice their opinion.

with regards to math, as most macro packages use wrappers for formulas 
we can let

\Ustartmath
\Ustartdisplaymath

accept dir specs

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list