summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries/samples/sample.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries/samples/sample.tex84
1 files changed, 71 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
index f91ab534f8e..39d57b22605 100644
--- a/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
+++ b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
@@ -1,15 +1,24 @@
\documentclass[a4paper]{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
-\usepackage[style=altlist]{glossaries}
+\usepackage[toc,style=treenoname,order=word]{glossaries}
\makeglossaries
\newglossaryentry{glossary}{name=glossary,
-description={1) list of technical words, 2) collection of
-glosses},
+description={\nopostdesc},
plural={glossaries}}
+\newglossaryentry{glossarylist}{
+description={1) list of technical words},
+sort={1},
+parent={glossary}}
+
+\newglossaryentry{glossarycol}{
+description={2) collection of glosses},
+sort={2},
+parent={glossary}}
+
\newglossaryentry{Perl}{name=\texttt{Perl},
sort=Perl, % need a sort key because name contains a command
description=A scripting language}
@@ -25,10 +34,41 @@ description={rectangular array of quantities},
% plural is not simply obtained by appending an s, so specify
plural=matrices}
-\newcommand{\pardescription}{distinct section of piece of
-writing.\par Beginning on new, usually indented, line}
+ % entry with a paragraph break in the description
+
\newglossaryentry{par}{name=paragraph,
-description=\pardescription}
+description={distinct section of piece of
+writing.\glspar Beginning on new, usually indented, line}}
+
+ % entry with two types of plural. Set the plural form to the
+ % form most likely to be used. If you want to use a different
+ % plural, you will need to explicity specify it in \glslink
+\newglossaryentry{cow}{name=cow,
+ % this isn't necessary, as this form (appending an s) is
+ % the default
+plural=cows,
+ % description:
+description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult
+female of any bovine animal}}
+
+\newglossaryentry{bravo}{name={bravo},
+description={\nopostdesc}}
+
+\newglossaryentry{bravo1}{description={1) cry of approval (pl.\ bravos)},
+sort={1},
+plural={bravos},
+parent=bravo}
+
+\newglossaryentry{bravo2}{description={2) hired ruffian or killer (pl.\ bravoes)},
+sort={2},
+plural={bravoes},
+parent=bravo}
+
+\newglossaryentry{seal}{name=seal,description={sea mammal with
+flippers that eats fish}}
+
+\newglossaryentry{sealion}{name={sea lion},
+description={large seal}}
\begin{document}
@@ -43,11 +83,11 @@ description=\pardescription}
\chapter{Introduction}
\pagenumbering{arabic}
-A \gls{glossary} is a very useful addition to any
-technical document, although a \gls{glossary} can
+A \gls{glossarylist} is a very useful addition to any
+technical document, although a \gls{glossarycol} can
also simply be a collection of glosses, which is
another thing entirely. Some documents have
-multiple \glspl{glossary}.
+multiple \glspl{glossarylist}.
Once you have run your document through \LaTeX, you
will then need to run the \texttt{.glo} file through
@@ -64,11 +104,29 @@ wrapper.
If a comma appears within the name or description, grouping
must be used, e.g.\ in the description of \gls{pagelist}.
-Plurals are assumed to have the letter s appended, but if
-this is not the case, as in \glspl{mtrx}, then you need
-to specify the plural when you define the entry.
+\chapter{Plurals and Paragraphs}
+
+Plurals are assumed to have the letter s appended, but if this is
+not the case, as in \glspl{mtrx}, then you need to specify the
+plural when you define the entry. If a term may have multiple
+plurals (for example \glspl{cow}/\glslink{cow}{kine}) then
+define the entry with the plural form most likely to be used and
+explicitly specify the alternative form using \verb|\glslink|.
+\Glspl{seal} and \glspl{sealion} have regular plural forms.
+
+\Gls{bravo} is a homograph, but the plural forms are spelt
+differently. The plural of \gls{bravo1}, a cry of approval,
+is \glspl{bravo1}, whereas the plural of \gls{bravo2}, a hired
+ruffian or killer, is \glspl{bravo2}.
+
+\Glspl{par} can cause a problem in commands, so care is needed
+when having a paragraph break in a \gls{glossarylist} entry.
+
+\chapter{Ordering}
-\Glspl{par} can cause a problem in commands.
+There are two types of ordering: word ordering (which places
+``\gls{sealion}'' before ``\gls{seal}'') and letter ordering
+(which places ``\gls{seal}'' before ``\gls{sealion}'').
\printglossaries