I use the Glossaries package to create both an glossary and a list of acronyms. Now I need a way to determine whether a given term is defined in the glossary (\newglossaryentry {term} ...
) or in the acronym list (\newacronym {term} ...
).
The package does provide \ifglsentryexists
but it only checks for general existence of the entry.
MWE:
\documentclass[english]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{foo} {name = {Foo}, description = {``foo'' glossary entry}}
\newacronym{bar} {BAR} {``bar'' acronym}
\begin{document}
If \gls{foo} is a normal glossary entry a ``X'' should follow, if
its an acronym we want its long form (\\glsentrylong{foo}) instead: ???
\printglossary
\end{document}