Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm doing multiple indices for a document, using Ledmac with the Memoir class. By default, page and line numbers (produced using \edindex[]{}) are separated by a dash. I actually would like a colon instead. Ledmac documentation specifies that :

The page & linenumber combination is written as page\pagelinesep line, where the default definition is \newcommand{\pagelinesep}{-} so that an item on page 3, line 5 will be noted as being at 3-5. You can renew \pagelinesep to get a different separator (but it just so happens that - is the default separator used by the MakeIndex program)

So, I've tried with :

\renewcommand*{\pagelinesep}{:}

or with :

\renewcommand{\thepageline}{%
    \thepage : \lineref{\edindexlab\thelabidx}

But, if, in both cases, the entries are correctly written in the .idx file, Makeindexrejects them, speaking of :

-- Illegal Arabic digit: position 3 in 60:741.

Also, I can't add space, or more than one characters, or I get :

Illegal space within numerals in second argument

I think the problem is with Makeindex rules, rather than Ledmac. Has anyone an idea ?

[Edit :] Here is a MWE

\documentclass{memoir} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ledmac}
\makeindex[names]

\renewcommand*{\pagelinesep}{:}

\begin{document}
\beginnumbering
\pstart
Here is my numbered text.\edindex[names]{text@Text}
\pend
\endnumbering
\printindex[names]
\end{document}

If I suppress \renewcommand*{\pagelinesep}{:}, everything works fine after the two pdflatex compilations, the makeindex one, and the last pdflatex compilation. Otherwise, I get the error I mentioned.

share|improve this question
2  
It is always best to compose a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. –  Peter Grill Oct 25 '11 at 16:24
    
It's done ! Thank you for pointing that out. –  Jean-Baptiste Camps Oct 26 '11 at 10:48

1 Answer 1

up vote 3 down vote accepted

You have to prepare a MakeIndex style containing the two lines

page_compositor ":"
delim_r ":"

Save this as mystyle.ist in the same directory as your main file and call makeindex by

makeindex -s mystyle names

MakeIndex has two groups of string constants: input and output strings. For example the actual variable, default "@", tells MakeIndex that when it finds an entry of the form

\indexentry{abc@def}{1}

it will alphabetize the entry as if it were abc, but it will output def. When indexing LaTeX internal commands that can start with @, it's convenient to say

actual "="

in a style file, so that one can say in the document

\index{@ifundefined=\texttt{\string\@ifundefined}}

and MakeIndex will do the right thing.

In your case, ledmac uses \pagelinesep both for the document and the index production, so it's necessary to change page_compositor (default "-") so that it can interpret correctly

\indexentry{xyz}{1:2}

When MakeIndex detects a page range, it will output it with the page numbers separated by the string specified as value of delim_r (default "--"). Setting

delim_r ":"

we achieve our goal. Here we are setting an output related string.

There's a number of .ist files in <TeX>/makeindex (where <TeX> represents the main distribution tree on your machine) that can be studied.

share|improve this answer
    
Thanks, it works perfectly. Would you have some reference that you would recommend about writing .ist files ? –  Jean-Baptiste Camps Oct 28 '11 at 9:49
2  
The primary reference is the "LaTeX Companion", but also texdoc makeindex.man1 is quite informative. –  egreg Oct 28 '11 at 10:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.