5

Until now I was using XePersian package to typeset Persian articles, now I want insert some Persian word in an English document, what is minimum code to do that without using XePersian package?

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Tahoma}


\begin{document}
book
کتاب
% rendered as ک ت ا ب but should be rendered کتاب

\end{document}
2
  • You should try the Polyglossia package. Jan 5, 2013 at 10:54
  • @AndreyVihrov Thanks, can you please give me a minimum example? Jan 18, 2013 at 20:22

3 Answers 3

8

Very simple. I do it like this:

\usepackage{bidi}% this should be the last package to load.
\newfontfamily\Kayhan[Script=Arabic]{XB Kayhan}% for example
\newenvironment{Farsi}%more human readable - other stuff can be added as well
{\begin{RTL}}
{\end{RTL}}

Then just write farsi like this:

This is an english paragraph with some 
\begin{Farsi}\Kayhan
نوشته فارسی
\end{Farsi}
that is added.
4
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\faFont[Script=Arabic]{Yas}   
\usepackage{bidi}
\newenvironment{Fa}{\begin{RTL}\faFont}{\end{RTL}}
\newcommand{\fa}[1]{{\faFont\RL{#1}}}

\begin{document}
\begin{Fa}
پاراگراف فارسی
\end{Fa}
This is a Persian word: \fa{سیب}. It means apple.
\end{document}

Use fa for word level and Fa for paragraph level of Persian contents.

0

Use XePersian: http://bay.uchicago.edu/tex-archive/macros/xetex/latex/xepersian/xepersian.pdf

1 \documentclass{minimal}
2 \usepackage{xepersian}
3 \usepackage{enumerate}
4 \settextfont{XB Niloofar}
5 \begin{document}
ﺍﯾﻦ ﻓﻘﻂ ﯾﮏ ﺁﺯﻣﺎﯾﺶ ﺍﺳﺖ 6
7 \end{document}
2
  • Some Persian in English document not vice versa!! Nov 18, 2013 at 6:20
  • Ya, That what I meant! It is not hard to align stuff to left or right ...
    – Daniel
    Nov 18, 2013 at 20:09

You must log in to answer this question.

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