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