I have a problem with my university thesis template, which in in Persian language and loads xepersian package with B Nazanin Persian font, The problem is exactly with B Nazanin font. as in template preamble we have:

\settextfont{B Nazanin}
\setlatintextfont{Times New Roman}

and B Nazanin does not support Latin characters. My Latin characters outside an \lr environment becomes square like below:

enter image description here

I wrote 4 chapters of thesis and it's very hard to use \lr{} for every single latin part. Is there anyway to correct this problem more easily?


Use the program fribidiXeTeX. If you are on windows, you can use the compiled version by Akira Kakuto. Otherwise, compile from source yourself.

If test.tex contains

این یک پاراگراف «پارسی» است به نام Simple text و این یک عدد 0887 به لاتین است.
این فرمول شماره
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
و ادامه متن که بعد از متن Lorem Imsum قرار می‌گیرد.

By running

fribidixetex -n test.tex -o test.ltx

You get the file test.ltx in which all your latin short texts are automatically placed inside \lr. You will then need to run

xelatex test.ltx

to produce the pdf output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.