Added Example for multiple Glossaries

This commit is contained in:
Simeon "Waldo" Wallrath 2024-08-06 15:40:27 +02:00
parent 71c5164829
commit ada4f8088e
10 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,2 @@
\glossaryentry{E.L.E.P.H.A.N.T?\glossentry{elephant}|setentrycounter[]{page}"\glsnumberformat}{2}
\glossaryentry{T.I.G.E.R?\glossentry{tiger}|setentrycounter[]{page}"\glsnumberformat}{2}

View file

@ -0,0 +1,9 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{E}\relax \glsresetentrylist %
\glossentry{elephant}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}\glsgroupskip
\glsgroupheading{T}\relax \glsresetentrylist %
\glossentry{tiger}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}%
\end{theglossary}\glossarypostamble

View file

@ -0,0 +1,2 @@
\glossaryentry{Amphibian?\glossentry{amphibian}|setentrycounter[]{page}"\glsnumberformat}{2}
\glossaryentry{Bird?\glossentry{bird}|setentrycounter[]{page}"\glsnumberformat}{2}

View file

@ -0,0 +1,9 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{A}\relax \glsresetentrylist %
\glossentry{amphibian}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}\glsgroupskip
\glsgroupheading{B}\relax \glsresetentrylist %
\glossentry{bird}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}%
\end{theglossary}\glossarypostamble

View file

@ -0,0 +1,2 @@
\glossaryentry{E.L.E.P.H.A.N.T?\glossentry{elephant}|setentrycounter[]{page}"\glsnumberformat}{2}
\glossaryentry{T.I.G.E.R?\glossentry{tiger}|setentrycounter[]{page}"\glsnumberformat}{2}

View file

@ -0,0 +1,9 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{E}\relax \glsresetentrylist %
\glossentry{elephant}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}\glsgroupskip
\glsgroupheading{T}\relax \glsresetentrylist %
\glossentry{tiger}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}%
\end{theglossary}\glossarypostamble

View file

@ -0,0 +1,2 @@
\glossaryentry{Amphibian?\glossentry{amphibian}|setentrycounter[]{page}"\glsnumberformat}{2}
\glossaryentry{Bird?\glossentry{bird}|setentrycounter[]{page}"\glsnumberformat}{2}

View file

@ -0,0 +1,9 @@
\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{A}\relax \glsresetentrylist %
\glossentry{amphibian}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}\glsgroupskip
\glsgroupheading{B}\relax \glsresetentrylist %
\glossentry{bird}{\glossaryentrynumbers{\relax
\setentrycounter[]{page}\glsnumberformat{2}}}%
\end{theglossary}\glossarypostamble

Binary file not shown.

View file

@ -0,0 +1,83 @@
\documentclass{article}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
citecolor=blue,
filecolor=magenta,
urlcolor=blue,
}
\usepackage[automake]{glossaries-extra}
% Define glossaries
\newglossary[alg]{acronym}{acr}{acn}{Primary Acronyms}
\newglossary[alg]{acronym2}{acr2}{acn2}{Additional Acronyms}
\newglossary[glg]{glossary}{gls}{glo}{Primary Glossary}
\newglossary[glg]{glossary2}{gls2}{glo2}{Additional Glossary}
% Define primary acronyms entries
\newacronym[type=acronym]{dog}{D.O.G}{Domestic Dog}
\newacronym[type=acronym]{cat}{C.A.T}{Domestic Cat}
% Define additional acronyms entries
\newacronym[type=acronym2]{elephant}{E.L.E.P.H.A.N.T}{African Elephant}
\newacronym[type=acronym2]{tiger}{T.I.G.E.R}{Bengal Tiger}
% Define primary glossary entries
\newglossaryentry{mammal}{
name=Mammal,
description={A warm-blooded vertebrate animal of a class that is distinguished by the possession of hair or fur, the secretion of milk by females for the nourishment of the young, and (typically) the birth of live young},
type=glossary
}
\newglossaryentry{reptile}{
name=Reptile,
description={A cold-blooded vertebrate of a class that includes snakes, lizards, crocodiles, turtles, and tortoises. They are distinguished by having a dry scaly skin, and typically laying soft-shelled eggs on land},
type=glossary
}
% Define additional glossary entries
\newglossaryentry{amphibian}{
name=Amphibian,
description={A cold-blooded vertebrate animal of a class that comprises the frogs, toads, newts, and salamanders. They are distinguished by having an aquatic gill-breathing larval stage followed (typically) by a terrestrial lung-breathing adult stage},
type=glossary2
}
\newglossaryentry{bird}{
name=Bird,
description={A warm-blooded egg-laying vertebrate animal distinguished by the possession of feathers, wings, and a beak and (typically) by being able to fly},
type=glossary2
}
\makeglossaries
\begin{document}
\printglossary[type=acronym, title=Primary Acronyms]
\label{glossary:primary_acronyms}
\printglossary[type=acronym2, title=Additional Acronyms]
\label{glossary:additional_acronyms}
\printglossary[type=glossary, title=Primary Glossary]
\label{glossary:primary_glossary}
\printglossary[type=glossary2, title=Additional Glossary]
\label{glossary:additional_glossary}
\newpage
\section*{Example Content}
Animals play a vital role in the ecosystem. Common pets include the \gls{dog} and the \gls{cat}. In the wild, the \gls{elephant} and the \gls{tiger} are notable for their size and strength. \\
A \gls{mammal} is a warm-blooded animal with hair or fur. \glspl{reptile} are cold-blooded animals with dry scaly skin. An \gls{amphibian} has both aquatic and terrestrial life stages. \glspl{bird} are warm-blooded animals with feathers and wings. \\
\section*{References}
Find the words in either
\hyperref[glossary:primary_acronyms]{Primary Acronyms},
\hyperref[glossary:additional_acronyms]{Additional Acronyms},
\hyperref[glossary:primary_glossary]{Primary Glossary} or
\hyperref[glossary:additional_glossary]{Additional Glossary},
\end{document}