# Equation numbers are shown in reverse parentheses

I am using

$$a = b$$


to write the equations in my paper. However, the problem is that the number related to each equation is not shown in the correct format like the picture

How can I fix this?

This is what I have at the first of my code:

\usepackage{graphicx}
\usepackage[justification=centering]{caption}
\usepackage{float}
\usepackage{url}% typeset urls
\usepackage{times}
\usepackage{url}
\usepackage{latexsym}
\usepackage{fontspec}
\usepackage{multirow}
\usepackage{listings}
\usepackage{setspace}
\usepackage{listings}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{polyglossia}
\usepackage{color}
\usepackage{bidi}
\newfontfamily\faFont[Script=Arabic]{Yas}
\newenvironment{Fa}{\begin{RTL}\faFont}{\end{RTL}}
\newcommand{\fa}[1]{{\faFont\RL{#1}}}
\newcommand\Mark[1]{\textsuperscript#1}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\definecolor{darkblue}{rgb}{0.95,0.95,0.92}
\setmainlanguage{english}
\setotherlanguage{farsi}
\newfontfamily\farsifont[Script=Arabic]{Yas}

• This is unusual. Please show us the full code.
– user11232
Jun 22 '14 at 1:17
• I'm almost sure that we have here other topic with the same problem. Jun 22 '14 at 1:19
• Without a minimal example, it's hard to tell, but I suspect a duplicate of bidi cause reverse parentheses in equations numbers (Obviously you may need to choose the appropriate Script for your particular language.) Jun 22 '14 at 1:20
• @Sigur I searched for it. But I couldnt find the same problem. You may give the link if you think so. Jun 22 '14 at 1:20
• @HarishKumar I have added part of my code that I think is needed to the quation Jun 22 '14 at 1:25

This problem is due to an incompatibility between bidi and polyglossia (as alluded to in V Karen-Pahlav's answer.) bidi expects the boolean \if@Latin to be set to true for RTL scripts, but polyglossia implements a different way to encode language direction on a language by language basis.

\documentclass{article}
\usepackage{amsmath}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{farsi}
$$a = b$$

This has been a polyglossia bug. bidi package provides the \if@Latin boolean. This boolean should be true for LTR-based script and false for RTL-based script.