The simplest method is to create a new file that contains the definitions. This makes it easier to add new terms while you're writing the document as most text editors allow more than one file open at a time, so you can simply switch to the definitions file without losing your place in the document.
Here's definitions.tex
:
\newglossaryentry{ontology}{name={ontology},
description={refers to a theory of what is real}}
\newglossaryentry{epistemology}{name={epistemology},
description={refers to a theory of knowledge}}
\newglossaryentry{potato}{name={potato},
category={theory},
description={is a class of root vegetables}}
\newglossaryentry{reductionism}{name={reductionism},
category={theory},
description={refers to the practice of reducing one set
of ideas to another}}
If your definitions span multiple paragraphs then use \longnewglossaryentry
instead:
\longnewglossaryentry{reductionism}{name={reductionism},category={theory}}
{refers to the practice of reducing one set
of ideas to another}
Here's a document that uses the all the provided definitions:
\documentclass{article}
\usepackage{glossaries-extra}
\loadglsentries{definitions}
\glssetcategoryattribute{general}{glossname}{firstuc}
\glssetcategoryattribute{theory}{glossname}{firstuc}
\newcommand{\printcategory}[1]{%
\printunsrtglossary*{%
\renewcommand{\glossarysection}[2][]{}%
\renewcommand{\printunsrtglossaryhandler}[1]{%
\glsifcategory{##1}{#1}{\glsxtrunsrtdo{##1}}{}%
}%
}%
}
\begin{document}
\tableofcontents
\section{Introduction}
\printcategory{general}
\section{Theory}
\printcategory{theory}
\printunsrtglossary[title={Glossary of Terms}]
\end{document}
If the document is called myDoc.tex
then the document build is simply:
pdflatex myDoc

This lists all defined terms in the glossary in the order of definition. If you want the list sorted, then it's more complicated.
Here's an alternative method. Save the definitions in a .bib
file, say, definitions.bib
:
% Encoding: UTF-8
@entry{ontology,
name = {ontology},
description = {refers to a theory of what is real}
}
@entry{epistemology,
name = {epistemology},
description = {refers to a theory of knowledge}
}
@entry{potato,
name = {potato},
plural = {potatoes},
description = {is a class of root vegetables}
}
@entry{reductionism,
name = {reductionism},
description = {refers to the practice of reducing one set
of ideas to another}
}
Again, it should be simple to switch back and forth between two windows without losing your place in the document. The document is now:
\documentclass{article}
\usepackage[record,% using bib2gls
postpunc=dot% put a full-stop after the descriptions in the glossary
]{glossaries-extra}
\GlsXtrLoadResources[
src={definitions},% entries in definitions.bib
name-case-change={firstuc}% convert the first character of `name` to uppercase and set `text` to the original value of `name`
]
\newcommand{\glossitem}[1]{\item[\glsentryname{#1}]
\glsadd{#1}\glsentrydesc{#1}.}
\begin{document}
\tableofcontents
\section{Introduction}
\begin{description}
\glossitem{epistemology}
\glossitem{ontology}
\end{description}
\section{Theory}
\begin{description}
\glossitem{potato}
\glossitem{reductionism}
\end{description}
\printunsrtglossary[title={Glossary of Terms}]
\end{document}
This gives you more manual control over the ordering within the document for the different sections. The main glossary is now sorted and includes locations in the glossary that indicate where the term was used (page 1 in all cases for this trivial document).

The build process is now:
pdflatex myDoc
bib2gls myDoc
pdflatex myDoc
If you don't want the locations, either use the resource option save-locations=false
:
\GlsXtrLoadResources[
src={definitions},% entries in definitions.bib
name-case-change={firstuc},
save-locations=false
]
or use nonumberlist
:
\printunsrtglossary[title={Glossary of Terms},nonumberlist]
By default bib2gls
will sort according to the document language (if detected) otherwise it will sort according to the default locale. You can specify a particular language. For example:
\GlsXtrLoadResources[
src={definitions},% entries in definitions.bib
name-case-change={firstuc},
sort={en-GB}
]
If you want to reference a term anywhere else in the document, you can use \gls{
label}
, for example \gls{ontology}
, or at the start of a sentence \Gls
, for example \Gls{potato}
. The plural can be obtained with \glspl
and \Glspl
. If you load hyperref
(before glossaries-extra
), then these will be turned into hyperlinks to the relevant line in the main glossary.
description
environment because it's sometimes used internally by other environments, so it could have undesirable side-effects.