I'm trying to write an Hebrew document in LyX, export to LaTeX and then compile with XeTeX. Everything works great (after some minor corrections in the output, mainly removing the \L tags babel creates) except one thing: Parenthesis. They are reversed. But not always; only when they're in "pure" text. In mathboxes and even in more complex circumstances and such they are not reversed, making the easy solution of "simply flip everything" impossible.
For example:
\item {$\left(A\cup B\right)\cup C=A\cup\left(B\cup C\right)$} )\textbf{אסוציאטיביות}האיחוד(.
This is a strange example, as the first parentehsis (right before the textbf) are shown correctly, but the ones at the end are not. I only need to flip the closing parenthesis.
All this seems too chaotic for me to handle even with a script. What exactly is going on here? Is there some way to force LyX to treat parenthesis in Hebrew docs in some unified manner?