Tell me more ×
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.

Well, I struggled to improve my index generated by Xindy. I tried to add several entries with bold page numbers by using \index{...|textbf} as classified in latex-loc-fmts.xdy, without any success.

When running Xindy (no matter which way, tex2xindy/texindy/xindy) together with texindy.xdy, the following errors are reported (Yes, they are errors because affected entries won't be passed to the generated .ind - IOW not displayed):

line X: multiple |'s
...
WARNING: unknown attribute `textbfhyperpage'! (ignored)

I've no idea how to handle this behavior and would be pleased, if somebody would share his experiences. BTW: I'm using Xindy-2.4 (TL2012)...

UPDATE:

\documentclass{article}
\usepackage{hyperref} % conflict!
\usepackage{makeidx}
\makeindex
\begin{document}
start
Nunc ligula faucibus \index{vel|textbf}. Nullarutrum porttitor...
\index{a}\index{b}\index{ä}\index{z}
end
\printindex
\end{document}

...compiled with:

latex <file> && xindy -M texindy <file> && latex <file>

...results:

It works without hyperref, but when it's been crawled it doesn't. Since hyperref is more or less a standard, it's necessary for me to get Xindy working together with hyperref. Any ideas?

share|improve this question
You're probably going to have to post a complete, but minimal, example file for others to test (and hopefully help debug). – jon May 21 '12 at 19:57
here you are, topic has been updated. it seems hyperref and xindy are in conflict, but I didn't find the trick to get them working together yet... – neptun May 21 '12 at 20:35
2  
I've only found this two year old discussion and no update – egreg May 21 '12 at 20:53
1  
been there, done that... ^^ but i can not believe, in the matter of the ongoing development over the past years, that there's no solution for this (big) issue. – neptun May 21 '12 at 21:27

1 Answer

You must use a separate style file for xindy. The following example results in:

enter image description here

As always I used imakeidx to simplify the process. However you have to compile with shell-escape.

The trick is to allow hyperref to provide a every feature for the index but the writing to the idx-file must be done without any influence by hyperref. This can be achieved by loading imakeidx after hyperref. The formating rules like textbf must be defined in the style file of xindy.

\documentclass{article}
\usepackage[utf8]{inputenc}


\usepackage[hyperindex=true]{hyperref}
\usepackage{imakeidx}
\makeindex[program=texindy,options=-M mystyle.xdy]

\usepackage{filecontents}
\begin{filecontents*}{mystyle.xdy}
;;; xindy style file
(markup-locclass-list :open "\dotfill" :sep "")

(define-attributes (( "textbf" "default" )) )
(markup-locref   :attr  "textbf"     :open "\textbf{\hyperpage{" :close "}}")
(markup-locref   :attr  "textit"     :open "\textit{\hyperpage{" :close "}}")
(markup-locref   :attr  "textttt"     :open "\textttt{\hyperpage{" :close "}}")
(markup-locref   :attr  "texttsc"     :open "\texttsc{\hyperpage{" :close "}}")
(markup-locref   :attr  "default"     :open "\hyperpage{" :close "}")



\end{filecontents*}

\begin{document}
start
Nunc ligula faucibus \index{vel|textbf}. Nullarutrum porttitor...
\index{a}\index{b}\index{ä}\index{z}
end
\printindex
\end{document}
share|improve this answer
3  
It's a step forward, but it's limited by the fact that you need to define all markup commands in the .xdy file. Of course this is way better than nothing! – egreg Jun 6 '12 at 17:27

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.