Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\documentclass[12pt]{article}
\usepackage[paperwidth=8.5in,paperheight=14in,left=1cm,right=1.5cm,top=1cm,bottom=0cm]{geometry} %margins
\usepackage{amsmath,polyglossia,fontspec}
\setmainlanguage{english}
\setotherlanguage[numerals=western]{urdu}
\setotherlanguage[numerals=western]{arabic}
\setmainfont{Times New Roman}
\newfontfamily\urdufont[Script=Arabic,Scale=1.2]{Jameel Noori Nastaleeq}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade}
\parindent=0in % no spacing at the start of paragraphs
\begin{document}
Here is some text in arabic 
\\
\hfill
\textarabic{
اَللَّھُمَّ    إِنِّیْ
}
\end{document}

I am trying to start the Arabic from right to left but it seems \hfill is not working. So if there is another way to do this do tell me kindly.

share|improve this question
    
Substitute \hfill with \hspace*{\fill} –  karlkoeller Mar 20 at 9:58
    
as @karlkoeller the star form will in general not be ignored at the "start" of a line (also you should not have a space or linebreak before the \\ 0 However something is wrong: you should not have to "fake" RTL typesetting by flushing to the right by hand, if that were marked as an arabic paragraph (rather than as a fragment of arabic text in an english paragraph it should start at the correct side automatically. –  David Carlisle Mar 20 at 10:04
    
Did you try loading the arabxetex package? –  Bernard Mar 20 at 10:16

1 Answer 1

The \text⟨lang⟩ macro is only for short insertions. Use \begin{⟨lang⟩} … \end{⟨lang⟩} instead. It will typeset a new paragraph. In your case when you use Arabic the paragraph is typeset right-to-left.

\documentclass[12pt]{article}
\usepackage[paperwidth=8.5in,paperheight=14in,left=1cm,right=1.5cm,top=1cm,bottom=0cm]{geometry} %margins
\usepackage{amsmath,polyglossia,fontspec}
\setmainlanguage{english}
\setotherlanguage[numerals=western]{urdu}
\setotherlanguage[numerals=western]{arabic}
\setmainfont{Times New Roman}
\newfontfamily\urdufont[Script=Arabic,Scale=1.2]{Jameel Noori Nastaleeq}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade}
\parindent=0in % no spacing at the start of paragraphs
\begin{document}
Here is some text in arabic 

\begin{Arabic}
اَللَّھُمَّ    إِنِّیْ
\end{Arabic}
\end{document}

Note that you cannot use the environment arabic, as \arabic is defined internally by LaTeX. You need to use the environment Arabic instead.

share|improve this answer
    
Thanx, it really works :) –  Shaheryar Mar 20 at 13:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.