| 1 |
% This file is embedded in glossaries-extra-manual.pdf |
| 2 |
% Example 129 Multi-entries: separators |
| 3 |
% Label: "ex:multientrysep" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: makeglossaries |
| 6 |
% arara: pdflatex |
| 7 |
% arara: pdfcrop |
| 8 |
\documentclass[12pt]{article} |
| 9 |
\pagestyle{empty} |
| 10 |
\usepackage[colorlinks]{hyperref} |
| 11 |
\usepackage[stylemods=bookindex,style=bookindex]{glossaries-extra} |
| 12 |
|
| 13 |
\makeglossaries |
| 14 |
|
| 15 |
\newcommand{\latinname}[1]{\emph{#1}} |
| 16 |
\glssetcategoriesattributes |
| 17 |
{genus,species}{textformat,glossnamefont}{latinname} |
| 18 |
\glssetcategoriesattributes{species}{discardperiod,retainfirstuseperiod}{true} |
| 19 |
|
| 20 |
|
| 21 |
% multi-entry category attributes: |
| 22 |
\glssetcategoryattribute{genus}{combinedfirstsepfirst}{\space} |
| 23 |
\glssetcategoryattribute{genus}{combinedfirstsep}{\space} |
| 24 |
\glssetcategoryattribute{genus}{combinedsepfirst}{~} |
| 25 |
\glssetcategoryattribute{genus}{combinedsep}{\relax} |
| 26 |
|
| 27 |
|
| 28 |
\setabbreviationstyle[genus]{long-only-short-only-desc} |
| 29 |
\newabbreviation |
| 30 |
[category={genus},description={}] |
| 31 |
{clostridium}{C.}{Clostridium} |
| 32 |
|
| 33 |
\setabbreviationstyle[species]{long-only-short-only-desc} |
| 34 |
|
| 35 |
|
| 36 |
\newabbreviation[category={species}, |
| 37 |
description={},parent={clostridium}]{botulinum}{bot.}{botulinum} |
| 38 |
\newabbreviation[category={species}, |
| 39 |
description={},parent={clostridium}]{perfringens}{per.}{perfringens} |
| 40 |
\newabbreviation[category={species}, |
| 41 |
description={},parent={clostridium}]{tetani}{tet.}{tetani} |
| 42 |
|
| 43 |
|
| 44 |
\multiglossaryentry{cbot}{clostridium,botulinum} |
| 45 |
\multiglossaryentry{cperf}{clostridium,perfringens} |
| 46 |
\multiglossaryentry{ctet}{clostridium,tetani} |
| 47 |
|
| 48 |
|
| 49 |
\multiglossaryentrysetup{indexothers=false,hyper=allmain} |
| 50 |
\begin{document} |
| 51 |
First use: \mgls{cbot}, \mgls{cperf}, \mgls{ctet}. |
| 52 |
|
| 53 |
|
| 54 |
Next use: \mgls{cbot}, \mgls{cperf}, \mgls{ctet}. |
| 55 |
\printglossaries |
| 56 |
\end{document} |