<div dir="ltr"><font size="2"><font face="verdana,sans-serif">Thanks, Ross, for your effort to tame makeindex for the Arabic script. <br><br>I also came across an interesting Persian sample that uses xepersian and makeindex. The pdf and tex source are at <br>

      <a href="http://www.parsilatex.com/joomla/attachments/vahid-seminar.pdf">http://www.parsilatex.com/joomla/attachments/vahid-seminar.pdf</a> <br>      <a href="http://www.parsilatex.com/joomla/attachments/vahid-seminar.tex">http://www.parsilatex.com/joomla/attachments/vahid-seminar.tex</a><br>

Missing some of the source components, I couldn't reproduce the pdf exactly. But lo and behold, the index was generated without fuss and in the desired order of entries. I am still mystified why the letters are disconnected in the text, but that's another debugging chore.<br>

<br>Kamal Abdali<br></font></font><br><div class="gmail_quote">On Sat, Oct 23, 2010 at 18:30, Ross Moore <span dir="ltr"><<a href="mailto:ross.moore@mq.edu.au">ross.moore@mq.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi Vafa, Houda, Kamal, Ulrike and others,<br>
<div class="im"><br>
<br>
On 23/10/2010, at 1:43 PM, Vafa Khalighi wrote:<br>
<br>
> I disagree. If makeindex was so perfect, why would someone spends lots of time inventing a new system.<br>
<br>
</div>Nobody said  makeindex  was perfect, just that it may be<br>
sufficient for the job at hand.<br>
<br>
If the only problem is in representing the page-numbers using<br>
other than western digits, then this is certainly achievable.<br>
(See below for the kind of configuration that is needed.)<br>
<br>
On the other hand, Makeindex  would have difficulty sorting<br>
the index entries automatically, according to rules<br>
for non-latin scripts, unless there were extra sorting<br>
tags provided with \index instances of the form<br>
     \index{...@.....}<br>
<div class="im"><br>
<br>
><br>
> For languages like Persian, Urdu, and other complex scripts, makeindex is not suitable and you have got to use xindy.<br>
<br>
</div>Until you have defined exactly what tasks are needed,<br>
and how they need to fit with the workflow being employed,<br>
how can you presume to say what is suitable and what is not?<br>
<div class="im"><br>
><br>
><br>
> --<br>
> بسی رنج بردم در این سال سی         عَجَم زنده کردم بدین پارسی<br>
><br>
<br>
</div>If the *only* problem is to deal with the page numbers<br>
in the .ind  file, such as the OP gets using the defaults<br>
for Makeindex; viz.<br>
<br>
>>> \begin{theindex}<br>
>>><br>
>>>   \item test, 5<br>
>>><br>
>>>   \indexspace<br>
>>><br>
>>>   \item نمایه, 5<br>
>>><br>
>>> \end{theindex}<br>
<br>
(Beware the RTL text may be confusing the appearance<br>
of the actual byte order here.)<br>
<br>
You can configure to get the following instead:<br>
<br>
>>>  \begin{theindex}<br>
>>><br>
>>>   \item test, \pagenumstyled 5<br>
>>><br>
>>>   \indexspace<br>
>>><br>
>>>   \item نمایه, \pagenumstyled 5<br>
>>><br>
>>>  \end{theindex}<br>
<br>
<br>
Now all that is needed is to define \pagenumstyled<br>
appropriately, to "read ahead" and adjust how the<br>
page number is to be displayed.<br>
Here is example (La)TeX coding that does this:<br>
<br>
\RequirePackage{arabicnumbers}<br>
\newcount\pageindcnt<br>
\def\pagenumstyled{\afterassignment\dopagenumstyle\pageindcnt}<br>
\def\dopagenumstyle{\arabicdigits{\number\pageindcnt}}<br>
<br>
<br>
<br>
So how is the configuration achieved?<br>
<br>
Use a customised .ist  file.<br>
The following is minimal. It can be easily extended to cope<br>
with nested entries and headings for letter-ranges, etc.<br>
<br>
>>> %%%%  start of file  myind.ist  %%%%%%%<br>
>>> preamble<br>
>>> "\\begin{theindex} \n "<br>
>>> postamble<br>
>>> "\n\n \\end{theindex}\n"<br>
>>> delim_0   ", \\pagenumstyled "<br>
>>> %%%%  end of  myind.ist  %%%%%%%<br>
<br>
<br>
To use this the call to  Makeindex needs to be include<br>
extra parameters; e.g.<br>
<br>
  makeindex -s ./myind.ist -o test-arabe1.ind test-arabe1.idx<br>
<br>
for a document named  test-arabe1.tex<br>
This will load the customised .ist  file from<br>
the same directory as the document source.<br>
<br>
Of course you could put it in another loaction that<br>
 Makeindex will find, or you could adjust the TeXshop<br>
command for Makeindex, or use a shell script, or ...<br>
<br>
Do whatever fits best with your workflow.<br>
<br>
<br>
Here is a neat way, using \write18  that keeps all of<br>
the coding together in your LaTeX document's preamble:<br>
<br>
<br>
>>> \usepackage{makeidx}<br>
>>> \RequirePackage{arabicnumbers}<br>
>>> \newcount\pageindcnt<br>
>>> \def\pagenumstyled{\afterassignment\dopagenumstyle\pageindcnt}<br>
>>> \def\dopagenumstyle{\arabicdigits{\number\pageindcnt}}<br>
>>> \immediate\write18{makeindex -s ./myind.ist -o test-arabe1.ind test-arabe1.idx}<br>
>>> \makeindex<br>
<br>
<br>
<br>
Note that the call to  'makeindex'  must come *before* the \makeindex ,<br>
><br>
<br>
so that it uses the  .idx  file from the previous LaTeX run.<br>
This is because \makeindex  is going to reset  test-arabe1.idx  as<br>
an output channel, to collect the index entries from the current run.<br>
<br>
<br>
This example simply shows how to apply styles to the page numbers<br>
in an index, generated using the  Makeindex  program.<br>
There is no claim here that all possible problems with the use<br>
of arabic digits and index entries are solved. For that, then<br>
presumably Xindy has more appropriate methods.<br>
<div><div></div><div class="h5"><br>
<br>
Hope this helps,<br>
<br>
        Ross<br>
<br>
<br>
------------------------------------------------------------------------<br>
Ross Moore                                       <a href="mailto:ross.moore@mq.edu.au">ross.moore@mq.edu.au</a><br>
Mathematics Department                           office: E7A-419<br>
Macquarie University                             tel: +61 (0)2 9850 8955<br>
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114<br>
------------------------------------------------------------------------<br>
<br>
<br>
<br>
<br>
<br>
<br>
--------------------------------------------------<br>
Subscriptions, Archive, and List information, etc.:<br>
  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
</div></div></blockquote></div><br></div>