% This file is embedded in glossaries-extra-manual.pdf 
% Example 126 Multi-entries: hierarchical
% Label: "ex:multientryhier"
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[colorlinks]{hyperref}
\usepackage[stylemods=bookindex,style=bookindex]{glossaries-extra}


\makeglossaries


\newcommand{\latinname}[1]{\emph{#1}}
\glssetcategoriesattributes
 {genus,species}{textformat,glossnamefont}{latinname}


\setabbreviationstyle[genus]{long-only-short-only-desc}
\newabbreviation
 [category={genus},description={}]
 {clostridium}{C.}{Clostridium}


\newglossaryentry{botulinum}{name={botulinum},category={species},
 description={},parent={clostridium}}
\newglossaryentry{perfringens}{name={perfringens},category={species},
 description={},parent={clostridium}}
\newglossaryentry{tetani}{name={tetani},category={species},
 description={},parent={clostridium}}


\multiglossaryentry{cbot}{clostridium,botulinum}
\multiglossaryentry{cperf}{clostridium,perfringens}
\multiglossaryentry{ctet}{clostridium,tetani}


\multiglossaryentrysetup{indexothers=false,hyper=allmain} 
\begin{document}
First use: \mgls{cbot}, \mgls{cperf}, \mgls{ctet}.


Next use: \mgls{cbot}, \mgls{cperf}, \mgls{ctet}.
\printglossaries 
\end{document}
