<div dir="ltr">If one defines,<br><br>\newif\if@RTL<br>\newif\if@RTLmaths<br>\def\paragraphdir{\if@RTL\pardir TRT \textdir TRT\else \pardir TLT \textdir TLT\fi}<br>\def\mathsdir{\if@RTLmaths\mathdir TRT\else\mathdir TLT}<br>
\everypar{\paragraphdir}<br>\everymath{\mathsdir}<br>\everydisplay{\mathsdir}<br>\def\setRTLmaths{\@RTLmathstrue}<br>\def\setLTRmaths{\@RTLmathsfalse}<br>\def\setRTL{\@RTLtrue}<br>\def\setLTR{\@RTLfalse}<br><br>But <br> If you say,<br>
<br>\setRTLmaths<br>$$1+2=3$$<br><br>You see no LTR maths, no change. Further, if you have<br><br>\setRTL<br><br>This is a test.<br><br>Then you get the wrong behaviour; text direction is RTL but paragraph direction is  not.<br>
<br>I think this behaviour is not correct. LuaTeX&#39;s direction primitives should be accessible through \everypar, \everymath and \everydisplay primitives.<br clear="all"><br>-- <br>Best wishes,<br>Vafa Khalighi<br>
</div>