LaTeX 中的水平对齐

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

我尝试从右到左开始阿拉伯语,但 \hfill 似乎不起作用。所以如果有其他方法可以做到这一点,请告诉我。

答案1

\text⟨lang⟩宏仅用于短插入。请使用\begin{⟨lang⟩} … \end{⟨lang⟩}。它将排版一个新段落。在您使用时,Arabic段落是从右到左排版的。

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

请注意,您不能使用环境arabic,因为这\arabic是 LaTeX 内部定义的。您需要改用环境Arabic

相关内容