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.tex54
1 files changed, 38 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
index 9006df8ed04..282eb7912b3 100644
--- a/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
+++ b/Master/texmf-dist/doc/latex/glossaries/samples/sample.tex
@@ -40,11 +40,17 @@ description={rectangular array of quantities},
% plural is not simply obtained by appending an s, so specify
plural=matrices}
- % entry with a paragraph break in the description
+ % Entry with a paragraph break in the description:
+ % (If you use \newglossaryentry, the paragraph break
+ % must be identified with \glspar not with \par or a blank line.
+ % It's easier to use \longnewglossaryentry.)
-\newglossaryentry{par}{name=paragraph,
-description={distinct section of piece of
-writing.\glspar Beginning on new, usually indented, line}}
+\longnewglossaryentry{par}% label
+{name=paragraph}% options
+{% multi-paragraph description
+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
@@ -80,6 +86,19 @@ parent=bravo}
description={large seal}%
}
+ % If a value contains a comma, you must use braces to hide
+ % it from the key=value list parser. Take care to avoid
+ % accidentally introducing unwanted space as leading and trailing
+ % spaces within the braces aren't stripped. For example,
+ % text={ spurious space } will result in extra space appearing
+ % when the entry is referenced.
+\newglossaryentry{spuriousspace}{%
+ name={space, spurious},
+ text={spurious space},
+ description={unwanted spaces accidentally introduced by
+uncommented line breaks or attempts to pretty-print the \LaTeX\ code}
+}
+
\begin{document}
\title{Sample Document Using the glossaries Package}
@@ -99,20 +118,21 @@ very useful addition to any technical document, although a
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}. You will need to set the output
-file so that it creates a \texttt{.gls} file instead
-of an \texttt{.ind} file, and change the name of
-the log file so that it doesn't overwrite the index
-log file (if you have an index for your document).
-Rather than having to remember all the command line
-switches, you can call the \gls{Perl} script
-\texttt{makeglossaries} which provides a convenient
-wrapper.
+Once you have run your document through \LaTeX, you will then need
+to run the \texttt{.glo} file through \texttt{makeindex} (default)
+or \texttt{xindy}. You will need to set the output file so that the
+indexing application
+creates a \texttt{.gls} file instead of an \texttt{.ind} file, and
+change the name of the log file so that it doesn't overwrite the
+index log file (if you have an index for your document). Rather
+than having to remember all the command line switches, you can call
+the \gls{Perl} script \texttt{makeglossaries} which provides a
+convenient wrapper. See
+\href{https://www.dickimaw-books.com/latex/buildglossaries}{Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build} for help.
If a comma appears within the name or description, grouping
must be used, e.g.\ in the description of \gls{pagelist}.
+Be careful about \glspl{spuriousspace} appearing in your code.
\chapter{Plurals and Paragraphs}
@@ -121,7 +141,9 @@ 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|.
+explicitly specify the alternative form using \verb|\glslink|
+(e.g.\ \glslink{cow}{kine})
+or \verb|\glsdisp| (e.g.\ \glsdisp{cow}{kine}).
\Glspl{seal} and \glspl{sealion} have regular plural forms.
\Gls{bravo} is a homograph, but the plural forms are spelt