I'm using xepersian for my article but in one page I need to add Gregorian calendar date. so I add:


and then where I want the date:

{\large \today}

butthen where ever I use today it writes Gregorian instead of persian (still in persian but uses Gregorian calender) and figure caption texts (like Fig.) is in english instead of persian.



\settextfont{XB Niloofar}


Like this the printed date is from persian calendar like this (reads 16th of khordad 1393):

enter image description here

but when I uncomment that line it will be english language in persian like this(reads 6th of june 2014):

enter image description here

  • Can you give us a minimal working example (MWE) to test?
    – Johannes_B
    Jun 6, 2014 at 17:09
  • Is there a babel option for persian? than you could try \usepackage[persian,english]{babel} ... \begin{document} \selectlanguage{persian} Jun 6, 2014 at 17:24
  • I don't think so. I looked on the internet but couldn't find anything. I also tried adding persian in that line but it didn't recognize it. Jun 6, 2014 at 17:28

2 Answers 2


Two things up front:

  1. As XePersian is relying on the XeTeX engine, I would recommend using polyglossia instead of babel.
  2. The article document class cannot use the 14pt option; for more information, take a look at this answer.

The Problem in your case is that XePersian clearly changes all western numerals (123) into genuine Arabic numerals (١٢٣), even though the XB Niloofar font contains both. Therefore, you need to tell XeTeX to use a different font than XePersian uses with \settextfont. If you do not specify a different font, XePersian will be used for typesetting, which will of course substitute the numerals.

First, of course, you need to tell XeTeX there is another language besides Farsi. You should use polyglossia to set this up: \setotherlanguage[]{english}. Then you must tell polyglossia to use a different font for all English text with \newfontfamily\englishfont{XB Niloofar}. This can of course be the exact same typeface as your XePersian \settextfont, but this time, it will not go through XePersian and thusly use the correct number forms. In the document, use \textenglish{} or \begin{english} to switch to an English environment.

Using the above suggestions will yield the following MWE:



\newfontfamily\englishfont{XB Niloofar}


\settextfont{XB Niloofar}



which gives this output:

XePersian output

On a side note, setting \setdefaultlanguage[]{farsi}, which would be normal practice with polyglossia, does not work, because it clashes with XePersian, therefore it is commented out here but you are welcome to delete it.

  • 1
    Thank you for the detailed explanation and the code. It did just what I wanted. Jun 7, 2014 at 9:05

All you had to do was looking at xepersian documentation. No extra package required, no babel no polyglossia, etc.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .