使用多语和断点索引显示印地语数字,而不是阿拉伯数字

使用多语和断点索引显示印地语数字,而不是阿拉伯数字

我尝试在文档中显示阿拉伯数字而不是印地语数字。以下是我的 MWE。

\documentclass[a4paper,12pt]{article}

\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage[pdfauthor={Yousef Raffa},pdftitle={Translation of The ARRL LoTW Registration Instructions in Arabic}]{hyperref}
\hypersetup{
    colorlinks=true,
    citecolor=black,
    filecolor=black,
    linkcolor=YellowOrange,
    urlcolor=Maroon
}

\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{graphicx}
\graphicspath{ {./img/} }
\usepackage{makeidx}
\makeindex

\usepackage{polyglossia}

\setmainlanguage{arabic}
\setotherlanguage{english}

\setmainfont[Ligatures=TeX,Numbers=OldStyle,Mapping=arabicdigits]{Amiri}
\setsansfont[Script=Arabic,Scale=1.5,Mapping=arabicdigits,Numbers=OldStyle]{Amiri}
\setmonofont{Courier New}
\newfontfamily\arabicfont[Script=Arabic,Scale=1,Numbers=OldStyle]{Amiri}


\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
\renewcommand{\sectionmark}[1]{%
    \markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
    \markright{\thesection\ #1}}
\fancyhf{}  % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers on plain pages
  \renewcommand{\headrulewidth}{0pt} % and the line
}
% Setting newcommands
% \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
% \renewcommand{\thepage}{\texorpdfstring{\lr{\arabic{page}}}{\arabic{page}}}

% Title and Author data

\title{ترجمة لتعليمات التسجيل في دفتر سجلات العالم \textenglish{ARRL LoTW}}

\author{\emph{ترجمة\thanks{هذا المكان مخصص}: }يوسُف عَدنَان رَفـَّـه -    \textenglish{HZ1YR} \\ \\
\href{http://www.HZ1YR.com}{\textenglish{HZ1YR.com}}}
\date{10 فبراير 2013م}



% Beginning of document
\begin{document}
\maketitle
\thispagestyle{empty} % No page number on 1st page

% Table of Contents
\newpage
\tableofcontents
\newpage


\begin{center}
\includegraphics{LOTW_Banner.eps}
\end{center}

% Abstract/Summary
\begin{abstract}
هذه الوثيقة عبارة عن ترجمة للخطوات وطريقة التسجيل في دفتر سجلات العالم \textenglish{Logbook of The World (LoTW)}\footnote{دفتر سجلات العالم يقصد به \textenglish{Logbook of The World} أو ما يُعرف اختصارا بـ \textenglish{LoTW}.} الموجودة على \href{http://www.arrl.org/}{موقع \textenglish{\footnote{إتحاد نواب الراديو الأمريكي \textenglish{American Radio Relay League}}ARRL}} والذي يختص بتوثيق الإتصالات \textenglish{QSO\index{QSO}s} بين الهواة بطريقة آمنة و محمية ويستخدمها معظم الهواة المحترفين.\\
حاولت تبسيط الترجمة والخطوات لتكون سهلة وواضحة للجميع قدر الإمكان ولكن إن أخطأت فمن نفسي وأرجوا أن تستميحوا لي العذر وتراسلوني عبر الموقع الموجود في أول صفحة أسفل العنوان.
\\
\begin{flushleft}
\textenglish{\textbf{Disclaimer:} This document is a personal effort by   \emph{HZ1YR} in translating ARRL's article on how to register for LoTW. All images are \copyright copyrighted to ARRL.}
\end{flushleft}

\end{abstract}

\end{document}

我认为这就是为什么它也会破坏我的索引并阻止它被打印在文档中的原因。这是我的 LoTW.ilg 内容

This is makeindex, version 2.15 [TeX Live 2012] (kpathsea + Thai support).
Scanning input file LoTW.idx...
!! Input index error (file = LoTW.idx, line = 1):
   -- Illegal page number ٥.
!! Input index error (file = LoTW.idx, line = 2):
   -- Illegal page number ٥.
done (0 entries accepted, 2 rejected).
Nothing written in LoTW.ind.
Transcript written in LoTW.ilg.

答案1

我假设您所说的“印地语数字”是指东方阿拉伯数字,在这种情况下,您可以使用numerals=maghribpologlossia 手册 §5.1 中解释的选项。您也不应该使用Mapping=arabicdigits字体选项,因为它会产生您不想要的完全相同的效果(而且 Amiri 还没有旧式数字,因此该选项没有效果)。

\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

\setmainfont[Ligatures=TeX]{Amiri}
\setsansfont[Ligatures=TeX,Script=Arabic,Scale=1.5]{Amiri}
\setmonofont{Courier New}
\newfontfamily\arabicfont[Script=Arabic,Ligatures=TeX]{Amiri}

相关内容