[Tex/LaTex] Glossaries: customize number lists (page numbers) attached to each acronym

acronymsglossariesnumbering

I would like to exclude the Table of Contents and Glossary itself from the page numbers that appear attached to each acronym indicating the pages where the entries have been used.

If this cannot be done, I would like to correct the number referring to the glossaries itself since as it can be seen in the picture, it should be 59 instead of 58. It refers to the first page of acronyms although the acronym is not in the first page.

enter image description here

Here you have an example of my code:

\documentclass[12pt,a4paper,twoside]{report} 

\usepackage{hyperref}  %hyperref bf glossaries
\usepackage[acronym,numberedsection,toc]{glossaries}

\makeglossaries

\newacronym{nrt1}{NRT}{Near-Real-Time}
\newacronym{avhrr1}{AVHRR}{Advanced Very High Resolution Radiometer}
\newacronym{eumetsat1}{EUMETSAT}{European Organization for the Exploitation of Meteorological Satellites}
\newacronym{npp1}{NPP}{National Polar-orbiting Partnership}
%etc

\begin{document}
%acronyms are cited here using \acrshort{}, \acrfull{}...

\glsaddall\printglossaries

\end{document}

Best Answer

Since you didn't post a proper minimal example of the problem, it isn't easy to diagnose the problem. However, it seems that a combination of the following solved it:

As Nicola notes, if you use commands such as \gls or \ac in the main argument to section headings, and don't supply an alternate title for the contents etc., then those commands will also be used in the contents and the relevant page numbers added. And if you use \glsaddall, then all entries are being added at that point and the relevant page number will also be added. \glsaddallunused would be an alternative, excluding entries already used elsewhere in the document.

If you want to use \gls or \ac in a section heading, but do not want it to be added to the contents etc., then you can supply an alternative title for use in the latter cases.

\section[<title for ToC without acronyms>]{<title for heading with acronyms>}

What this does is uses the first, optional argument in the table of contents etc. and the second, mandatory argument for the title of the section itself in the body of the document. This just uses the standard LaTeX command

\section[<title for ToC etc.>]{<Title for heading in body of document>}

If you don't specify the optional argument, LaTeX uses the second argument in the ToC etc. as well. Otherwise, it uses the optional one.

So any time you want something different in the ToC from what you want as the heading in the document itself, just use the optional argument to specify a different value for the former.