TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want create index nested entries and typeset the indexed word with the same command.

For simple entries like \index{foo} I can solve this with some macro or \index*{foo} or \Index{foo} with the packages index and hvindexrespectively, but the problem is with nested entries like foo!bar where I want type only "bar" in the text and obtain a correct nested entry in the index, that is:

  bar, 1 

According to manual of hvindex, this package do just that, but I am unable to obtain any nested entry with this package in an updated TeXLive 2013. This MWE type correctly "bar" in main text but only "bar, 1" as index entry in my computer:


Instead, index make the correct nested entry but write "foo!bar" as is in the body text:

share|improve this question
Since TeX Live 2013 has not yet been released, it's best to stick with the 2012 version, when reporting problems. However the problem seems present also in the 2012 release. – egreg May 25 '13 at 21:17
ehh...right, right, ... but you know, warm-blooded users cannot live too long on a frozen release. :) – Fran May 25 '13 at 21:53
up vote 6 down vote accepted

It seems to be a bug in hvindex; a missing #1 in one of the calls to \index made by the internal macros.


%%% fix \IndexXXii
  \ifx\relax#3\relax            %               no @ in last arg
      \ifx\hvIDXfont\hvIDXfontDefault\index{#1!#2}#2% <--- Here a % and #1 were missing



enter image description here

share|improve this answer
Fixing this bug in the line 62 of hvindex.sty seem to work perfectly. Grazie mile! – Fran May 25 '13 at 22:48
Similarly, line 70 have should be \ifx\hvIDXfont\hvIDXfontDefault\index{#1!#2!{#3}}#3% for the next level of nesting. – Fran May 25 '13 at 23:00
@Fran This seems sensible. I didn't go that far. ;-) – egreg May 25 '13 at 23:02

Your Answer


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.