On Wednesday, April 1st, 2026 at 7:13 PM, luigi scarso <[email protected]> 
wrote:

> Sorry for the delay, I had already seen it but then I was busy with other 
> things related to Luatex.
> Re-checking it now.
> 

Thanks luigi. After giving it some more thought, the first patch does not fix 
everything (as mentioned previously), and the second one is probably not 
backwards compatible as it creates direction nodes is situations where 
previously weren't any (and this for example can affect vertical spacing around 
display if \mathemptydisplamode is not set).

There is a simple ad hoc solution, which can also be done from Lua:

\directlua{
callback.register("pre_linebreak_filter",
function(head)
  local stack = 0
  for n, sb in node.traverse_id(node.id('dir'),head) do
    stack = stack + 1-2*sb
    if stack == -1 then
      head = node.remove(head,n)
      return head
    end
  end
  return head
end)
}

Something similar can be done from C before the callback kicks in (so that 
callback order won't matter and the fix will be made in all formats).

But maybe after looking into it you found a better solution (hopefully).

Udi  
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to