As a follow up to this question: when using the newdualentry
command provided as an example in the glossaries
package, how do I prevent the number list of the glossary entry to contain the page where the acronym list references the glossary entry.
MWE:
\documentclass{article}
\usepackage{hyperref}
\usepackage[acronym]{glossaries-extra}
\RestoreAcronyms
\newcommand*{\newdualentry}[5][]{%
\newglossaryentry{main-#2}{name={#4},%
text={#3\glsadd{#2}},%
description={#5},%
#1
}%
\newacronym{#2}{#3\glsadd{main-#2}}{#4}
}
\newdualentry{svm}% label
{SVM}% abbreviation
{support vector machine}% long form
{Statistical pattern recognition technique}% description
\newacronym{FOO}{FOO}{This should still work}
\makeglossaries
\begin{document}
\gls{svm}. Also \gls{FOO}.
\newpage
\GlsXtrSetDefaultGlsOpts{noindex}
\printglossaries
\end{document}
The "support vector machine" entry in the glossary shall only have page 1 in its number list and the other acronym without accompanying glossary entry should still be usable.
What I have tried was the following rewrite of the command definition:
\newcommand*{\newdualentry}[5][]{%
\newglossaryentry{main-#2}{name={#4},%
text={#3\glsadd{#2}},%
description={#5},%
#1
}%
\newacronym{#2}{\gls[noindex=true]{main-#2}}{#4}
}
However, with this version, the long entry doesn't appear at all and it kills the automatic linking of page numbers.