bidi causes reversed parentheses in equation numbers

When writing a Hebrew document using xelatex, bidi, and polyglossia, equation numbers are in reverse parentheses. How can I fix this?

MWE

\documentclass[a4paper, twoside, titlepage, 11pt]{report}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{bidi}

\setmainfont{Arial}

\begin{document}

$$a=\frac{dx}{dt}$$

\end{document}


You need to specify [Script=Hebrew] when you specify your \hebrewfont

% !TEX TS-program = XeLaTeX

\documentclass[a4paper, twoside, titlepage, 11pt]{report}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}

\setmainfont{Arial}

\begin{document}

$$a=\frac{dx}{dt}$$

\end{document}


Notice I have used polyglossia to deal with the bidi part using \setmainlanguage instead of loading bidi directly. Also, xltxtra is no longer needed.

This is actually a duplicate of the following question, but unfortunately the accepted answer there is not really the correct solution, so I have added an answer here.

• Thanks, where can I find some documentation about how to use my fonts? I tried to use dejavu or DavidCLM but in vain May 18 '14 at 17:09
• Not all versions of the DejaVu fonts contain the Hebrew script. For example, with DejaVu Sans the document works, but not with DejaVu Serif. Other than the error message that fontspec generates, I'm not sure how to check this in advance. May 18 '14 at 18:59
• Just tried it, seems to no longer work Feb 15 '17 at 12:43
• Does not work any longer for me as well. See github.com/bidi-tex/bidi/issues/5 Aug 17 '19 at 6:37