I would like to add the word "page" or "pages" in the Glossary. The following is the code. At the end of each entry for Glossary, there is a page number. But I would like it to display like: (page 1), or (pages 1-4), or (pages 1, 2). Also, how to enlarge the space between the abbreviation and description? How can I achieve these? Any help will be appreciated.
\documentclass[a4paper]{book}
\usepackage[pagebackref=true,hyperindex=true,hyperfigures=true,pdfduplex=DuplexFlipLongEdge]{hyperref}
\usepackage{datatool}
\usepackage[toc,acronym]{glossaries}
\usepackage[xindy]{imakeidx}
\usepackage{amsmath,amsfonts}
\makeindex
\makeglossaries
\newglossaryentry{2D}{name=2D,
description={2 dimensional}}
\renewcommand*{\glossarypreamble}{%
\label{\currentglossary}%
}
\begin{document}
Some text about \gls{2D}.
\printglossaries
\end{document}
Best Answer
The simplest approach is with
glossaries-extra
:It's a bit more complicated with just the base
glossaries
package:The resulting glossary looks like:
(You might want to use
nopostdot
so it doesn't insert a full stop after the description. Alternatively, capitalise "page"/"pages". Theglossaries-extra
package hasnopostdot
as the default.)To increase the space between the abbreviation and description, you could just use a different style, such as
long
, or you can define a new style. For example:The resulting glossary now looks like: