The species names should be in italics and with subentries if there is more than one species (e.g. Rana dunni, Rana onca) from the same genus (e.g. Rana).
Meaning I would like to have the entry Rana with the subentries dunni and onca
I don't want all the species names at the beginning of the index (the command
Code: Select all
\textit{Rana dunni}\index{\textit{Rana!dunni}}
So I changed the command to
Code: Select all
\textit{Rana dunni}\index{Rana@\textit{Rana!dunni}}
The problem is that it works fine with one entry (Ranna dunni), but when I add the second entry (Ranna onca) it still works but I get the error:
And I have quite a lot of species names to deal with so I'd rather solve this than have tons of error messages.! Extra }, or forgotten \endgroup
Here is my MWE:
Code: Select all
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{makeidx}
\makeindex
\begin{document}
Lorem ipsum dolor\index{dolor} sit amet, consectetuer adipiscing elit.
Vivamus\index{vivamus} elementum semper nisi.
\textit{Rana dunni}\index{Rana@\textit{Rana!dunni}}
\textit{Rana onca}\index{Rana@\textit{Rana!onca}}
\printindex
\end{document}
Help would be really appreciated.
Thx & Cheers
edited to put the two commands in code environment