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:
foo
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:
\documentclass{article}
\usepackage[makeidx]{hvindex}
\begin{document}
\Index{foo!bar}
\printindex
\end{document}
Instead, index make the correct nested entry but write "foo!bar" as is in the body text:
\documentclass{article}
\usepackage{index}
\makeindex
\begin{document}
\index*{foo}
\index*{foo!bar}
\printindex
\end{document}
