LaTeX_Examples/MultipleGlossaries/MultipleGlossaries.tex

84 lines
3.1 KiB
TeX
Raw Normal View History

2024-08-06 13:40:27 +00:00
\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}