summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/samples/sample.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/glossaries/samples/sample.tex')
-rw-r--r--macros/latex/contrib/glossaries/samples/sample.tex53
1 files changed, 32 insertions, 21 deletions
diff --git a/macros/latex/contrib/glossaries/samples/sample.tex b/macros/latex/contrib/glossaries/samples/sample.tex
index eca1464585..6b9e19069b 100644
--- a/macros/latex/contrib/glossaries/samples/sample.tex
+++ b/macros/latex/contrib/glossaries/samples/sample.tex
@@ -4,16 +4,20 @@
% arara: makeglossaries
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }
+%
+%http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sample
\documentclass[a4paper]{report}
\usepackage[plainpages=false,colorlinks]{hyperref}
-\usepackage[toc,style=treenoname,order=word,subentrycounter]{glossaries}
+\usepackage[toc,style=treenonamegroup,subentrycounter]{glossaries}
\makeglossaries
-\newglossaryentry{Perl}{name=\texttt{Perl},
+\newcommand{\scriptlang}[1]{\textsf{#1}}
+
+\newglossaryentry{Perl}{name=\scriptlang{Perl},
sort=Perl, % need a sort key because name contains a command
-description=A scripting language}
+description={A scripting language}}
\newglossaryentry{glossary}{name=glossary,
description={\nopostdesc},
@@ -53,12 +57,15 @@ distinct section of a piece of writing.
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
+% form most likely to be used. The alternative plural is stored in
+% the 'user1' key. Another option is to define your own custom
+% storage key for alternative plurals.
\newglossaryentry{cow}{name=cow,
% this isn't necessary, as this form (appending an s) is
% the default
plural=cows,
+% alternative plural:
+user1=kine,
% description:
description={(\emph{pl.}\ cows, \emph{archaic} kine) an adult
female of any bovine animal}}
@@ -66,12 +73,11 @@ female of any bovine animal}}
\newglossaryentry{bravo}{name={bravo},
description={\nopostdesc}}
-\newglossaryentry{bravo1}{description={cry of approval (pl.\ bravos)},
+\newglossaryentry{bravocry}{description={cry of approval (pl.\ bravos)},
sort={1},
-plural={bravos},
parent=bravo}
-\newglossaryentry{bravo2}{description={hired ruffian or killer (pl.\ bravoes)},
+\newglossaryentry{bravoruffian}{description={hired ruffian or killer (pl.\ bravoes)},
sort={2},
plural={bravoes},
parent=bravo}
@@ -112,11 +118,12 @@ uncommented line breaks or attempts to pretty-print the \LaTeX\ code}
\chapter{Introduction}
\pagenumbering{arabic}
-A \gls{glossarylist} (definition~\glsrefentry{glossarylist}) is a
-very useful addition to any technical document, although a
-\gls{glossarycol} (definition~\glsrefentry{glossarycol}) can also
-simply be a collection of glosses, which is another thing entirely.
-Some documents have multiple \glspl{glossarylist}.
+A \gls{glossarylist} (definition~\glsrefentry{glossarylist}, plural
+\glspl{glossarylist}) is a very useful addition to any technical
+document, although a \gls{glossarycol}
+(definition~\glsrefentry{glossarycol}, plural \glspl{glossarycol})
+can also simply be a collection of glosses, which is another thing
+entirely. Some documents have multiple \glspl{glossarylist}.
Once you have run your document through \LaTeX, you will then need
to run the \texttt{.glo} file through \texttt{makeindex} (default)
@@ -136,21 +143,25 @@ Be careful about \glspl{spuriousspace} appearing in your code.
\chapter{Plurals and Paragraphs}
-Plurals are assumed to have the letter s appended, but if this is
+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|
+plurals (for example \glspl{cow}/\glsuseri{cow}) then
+define the entry with the plural form most likely to be used.
+The alternative can simply be referenced with \verb|\glslink|
(e.g.\ \glslink{cow}{kine})
or \verb|\glsdisp| (e.g.\ \glsdisp{cow}{kine}).
+Another option is to save the alternative plural in another key. In
+this case, the ``user1'' key has been used, but a custom key can be
+defined instead.
+
\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
-(definition~\glsrefentry{bravo1}), is \glspl{bravo1}, whereas the
-plural of \gls{bravo2}, a hired ruffian or killer
-(definition~\glsrefentry{bravo2}), is \glspl{bravo2}.
+differently. The plural of \gls{bravocry}, a cry of approval
+(definition~\glsrefentry{bravocry}), is \glspl{bravocry}, whereas the
+plural of \gls{bravoruffian}, a hired ruffian or killer
+(definition~\glsrefentry{bravoruffian}), is \glspl{bravoruffian}.
\Glspl{par} can cause a problem in commands, so care is needed
when having a paragraph break in a \gls{glossarylist} entry.