8

I'm using TeXstudio in order to write a report and I use XeLaTeX compiler. However the following code :

\documentclass[10pt,a4paper]{report}
\usepackage{xepersian}
\usepackage[left=1.00cm, right=1.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\title{فارسی - English }
\begin{document}
\maketitle
\end{document}

fails to print the English characters and the output only contains Farsi strings. What am I doing wrong?

8

I think this has nothing to do with TeXstudio as your editor but a feature of xepersian package. I looked at the documentation and found out that if you want to show English text for short left-to-right text, you wrap the text in \lr{}. If it involves larger amount of text, you use the latin environment. Perhaps you meant to type something like

%\documentclass[10pt,a4paper]{report}
\documentclass[10pt,a4paper]{article}

\usepackage{kantlipsum}
\usepackage{xepersian}
\usepackage[left=1.00cm, right=1.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\title{\lr{-English}فارسی}
\begin{document}
\maketitle
\begin{latin}
\kant[1]
\end{latin}
\end{document}

which gives us the following output.

enter image description here

I changed to article class here for demonstration purposes. You can switch back to report in your actual use case. (BTW, why the very small left and right margins?)

  • I appreciate your very helpful answer. – ye9ane Mar 21 '13 at 5:52

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.