I want to write in urdu with nastaleeq font. I have done quite a few things but i dont know how to write it. Plus i dont know how to use xetex. So can anyone give me a simple example writing urdu in the desired font and how to run it on texmaker.
2 Answers
Here is a typesetting of poem using IranNastaliq
font and XePersian
package. XePersian
is included in texlive and in case you are missing it, you can get it from CTAN. One problem here is the font. IranNastaliq is designed for persian/farsi alphabet and despite of similarities between persian and urdu, it misses some of letters of urdu such as
This being said, I think you can find an urdu nastaliq font, just add it to you tex
file and you will be good to go. I don't see any major difference between typesetting persian and urdu. Here is a sample tex
file containing a poem from Saadi with nastaliq font.
\documentclass[a4paper]{article}
%\usepackage{persianpoem}
\usepackage{xepersian}
\settextfont[Scale=1.3]{IranNastaliq}
\renewcommand{\baselinestretch}{3.0}
\newcommand{\myverse}[2]{%
\makebox[4cm][s]{#1}
\makebox[2cm][s]{}
\makebox[4cm][s]{#2}%
}
\begin{document}
\pagestyle{empty}
\title{سر عشق}
\author{سعدی}
\date{\today}
\maketitle
\thispagestyle{empty}
\myverse{هزار جهد بکردم که سر عشق بپوشم}
{نبود بر سر آتش میسرم که نجوشم}
\myverse{به هوش بودم از اول که دل به کس نسپارم}
{شمایل تو بدیدم نه عقل ماند و نه هوشم}
\myverse{به راه بادیه رفتن به از نشستن باطل}
{که گر مراد نیابم به قدر وسع بکوشم}
\end{document}
which gives you this:
Please note that this is just a MWE and needs certain modification to be suitable for you purpose.
You can compile this from command line using:
xelatex your_poem.tex
To you use it with TexMaker
, refer to this question.
Above tex sample is borrowed from XePersian Forum and it's respected creator.
-
i tired the things that were given in the link provided by you but it keeps on running like forever ; The texmaker i have installed on my system has a option in Option ....> configure....> Quick build -----> Xelatex + pdf i checked this one but it gives the error ! Fatal fontspec error: "cannot-use-pdftex" ! ! The fontspec package requires either XeTeX or LuaTeX to function. ! ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex" What should i do now ? Oct 4, 2013 at 5:34
Your question got pushed back up to the front page in the final week of 2020, so I thought it could use an updated answer.
This MWE will run in either LuaTeX 1.12 or later, or XeTeX. It will produce some benign error messages in either, because it tries to turn on some features both the LuaTeX way and the XeTeX way.
\documentclass{article}
\tracinglostchars=2
\usepackage[bidi=default, layout=sectioning.tabular, nil]{babel}
\usepackage{fontspec}
\defaultfontfeatures{ Scale=MatchUppercase,
Ligatures=TeX,
Renderer=HarfBuzz }
\babelfont{rm}
[Scale=1.0]{TeX Gyre Termes}
% Define \babelfont{sf} and \babelfont{tt} here, if needed.
\babelprovide[import, main, mapdigits]{urdu}
% Noto nastaliq Urdu is available at:
% https://www.google.com/get/noto/#nastaliq-aran
\babelfont[urdu]{rm}
[Mapping=farsidigits]{Noto Nastaliq Urdu}
% Define \babelfont[urdu]{tt}{ALM Fixed}, etc., if needed.
% Formatting this particular MWE:
\usepackage[paperwidth=10cm]{geometry}
\usepackage{parskip}
\begin{document}
اقوامِ متحدہ کی جنرل اسمبلی نے ۱۰؍ دسمبر ۱۹۴۸ء کو ”انسانی حقوق کا عالمی منشور“ منظور کر کے اس کا اعلانِ عام کیا۔ اگلے صفحات پر اس منشور کا مکمل متن درج ہے۔ اس تاریخی کارنامے کے بعد اسمبلی نے اپنے تمام ممبر ممالک پر زور دیا کہ وہ بھی اپنے اپنے ہاں اس کا اعلانِ عام کریں اور اس کی نشر و اشاعت میں حصہ لیں۔ مثلاً یہ کہ اسے نمایاں مقامات پر آویزاں کیا جائے۔ اور خاص طور پر اسکولوں اور تعلیمی اداروں میں اسے پڑھ کر سنایا جائے اور اس کی تفصیلات واضح کی جائیں، اور اس ضمن میں کسی ملک یا علاقے کی سیاسی حیثیت کے لحاظ سے کوئی امتیاز نہ برتا جائے۔
چونکہ ہر انسان کی ذاتی عزت اور حرمت اور انسانوں کے مساوی اور ناقابلِ انتقال حقوق کو تسلیم کرنا دنیا میں آزادی، انصاف اور امن کی بنیاد ہے،
چونکہ انسانی حقوق سے لاپروائی اور ان کی بے حرمتی اکثر ایسے وحشیانہ افعال کی شکل میں ظاہر ہوئی ہے جن سے انسانیت کے ضمیر کو سخت صدمے پہنچے ہیں اور عام انسانوں کی بلند ترین آرزو یہ رہی ہے کہ ایسی دنیا وجود میں آئے جس میں تمام انسانوں کو اپنی بات کہنے اور اپنے عقیدے پر قائم رہنے کی آزادی حاصل ہو اور خوف اور احتیاج سے محفوظ رہیں،
\end{document}
Other free fonts you might use include Amar Nastaleeq, Awami Nastaliq (which requires Renderer=Graphite
) or Jameel Noori Nastaleeq.
This text should be a translation of the UN Declaration of Human Rights.
persian
nastaleeq? I know udro and persian are fairly similar but I'm not sure about different characters...