I am using the xepersian package in Texstudio. The logical way of writing maths in Persian in Tex is that one writes in persian and when they press dollar, the font switches automatically to English. By the second dollar at the end of the formula it switches again to Persian. In my case, when I am pressing shift and four for the dollar, it actually types the persian currency, Rial, in persian. So each time to go to math mode, I should press shift and alt to change the langugage, then press dollar and type the formula, and then again switch to persian. I will appreciate if any one can help me out of this.