Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write Urdu language in LaTEX?

Tags:

latex

I am writing a research paper in LaTeX. The paper is about Urdu Language Processing and i have to write Urdu words within English paragraphs. I have tried this:

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Times New Roman}
\newfontface{\urdu}[Script=Arabic]{Jameel Noori Nastaleeq}

#in the text, write Urdu like this:

In your document {\urdu اردو ایسے لکھیں} write Urdu like this.

But it doesnot work for me. I need help for this.

like image 245
tayyaba Avatar asked Oct 17 '17 07:10

tayyaba


1 Answers

While writing in multiple languages under polyglossia you have to specify them (see this for a detailed answer on how to write Urdu - English mixed documents in Latex). Here is a MWE.

documentclass[12pt]{article}
\usepackage{polyglossia}
\usepackage{fontspec}

\setmainlanguage{english}
\setotherlanguage{urdu}
\setmainfont[Path=/Users/ghalib/Library/Fonts/]{ufonts.com_jameel-noori-nastaleeq.ttf}

\begin{document}

In your document \texturdu{ اردو ایسے لکھیں} write Urdu like this.

\vspace{0.5in}

\noindent
\begin{center}
\texturdu{
اردو ہے جس کا نام ، ہمیں جانتے ہیں داغ \\
سارے جہاں میں دھوم ہماری زباں کی ہے\\
\hspace{6cm} (داغ دھلوی)
}
\end{center}

\end{document}

enter image description here

like image 74
R.U. Avatar answered Oct 07 '22 15:10

R.U.