# Horizontal Alignment in LaTeX

\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}
\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.

-
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

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}
\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 deﬁned internally by LaTeX. You need to use the environment Arabic instead.

-
Thanx, it really works :) –  Shaheryar Mar 20 at 13:00