diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua index 6961dd84221..008d27e0658 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua @@ -74,6 +74,7 @@ function Babel.bidi(head, ispar) local new_dir = false local first_dir = false + local inmath = false local last_lr @@ -104,6 +105,7 @@ function Babel.bidi(head, ispar) end end dir = dir or 'l' + if inmath then dir = ('TRT' == tex.mathdir) and 'r' or 'l' end if new_dir then attr_dir = 0 for at in node.traverse(item.attr) do @@ -131,9 +133,11 @@ function Babel.bidi(head, ispar) if dir == 'et' or dir == 'es' then dir = 'on' end -- W6 strong_lr = 'r' -- W3 end - elseif item.id == node.id'dir' then + elseif item.id == node.id'dir' and not inmath then new_dir = true dir = nil + elseif item.id == node.id'math' then + inmath = (item.subtype == 0) else dir = nil -- Not a char end |