0

I try to use XeLaTeX to compile

     \documentclass{article}
     \usepackage{xepersian}
     \begin{document}
      Hello World
     \end{document}

And I get the following error:

 Runaway argument?
 {\dim_set:Nn ##1{\fontdimen ##2##3}\dim_compare:nNnT ##1={0pt}{\settoheight\ETC.
 ! Forbidden control sequence found while scanning use of \__cs_generate_from_si
 gnature:nnNNNn.
 <inserted text> 
            \par 
 l.1767       \int_case:nnn
                       #2

Anything containing xepersian seems to generate the same error.

Maesumi
  • 9,059

1 Answers1

1

If you compile your code with XeLaTeX, you should end up with something like this:

enter image description here

which is pretty predictable because your left-to-right text is inverted by the right-to-left xepersian.

To fix the issue, you can use \lr{} to change the direction temporarily. Outside of \lr{} everything will be right-to-left again.

\documentclass{article}
\usepackage{xepersian}
\settextfont{XB Niloofar}
\begin{document}
    \noindent\lr{Hello World}\\
    سلام دنیا\\
خداحافظ دنیا
\end{document}

enter image description here