0

Suppose I have the following .tex file:

\documentclass{article}

\usepackage[nonumberlist]{glossaries}

\makeglossary

\newglossaryentry{snore}
{
  name={snore},
  description={to make an unpleasant noise while sleeping soundly}
}


\begin{document}

  I don't \gls{snore} when I'm sleeping.
  \printglossary

\end{document}

This compiles fine and I get the desired result. However I'd like to also use \gls on other forms of the verb "to snore". For instance, "I snored", "I'm snoring", "He snores".

I know there's a \glspl command which automatically generates the plural form. But that's not enough in this case.

Is there a way to make use of the glossaries package to achieve this? Or should I look to more sophisticated libraries?

2
  • 1
    Just being curious: Did you check the documentation here ctan.org/pkg/glossary?lang=en , and the category or topic here: ctan.org/topic/glossary ?
    – MS-SPO
    Commented Sep 8, 2021 at 15:49
  • I mainly checked the official documentation for glossaries. I'd like to stick to the glossaries package if possible.
    – user32882
    Commented Sep 8, 2021 at 15:54

2 Answers 2

3

The glossaries package has an excellent FAQ:

My term has multiple plural forms, how can I deal with this?

Use the plural key for the plural term you are most likely to use, and use one of the user keys for the other plurals. For example:

\newglossaryentry{cow}{name=cow,   description={a fully grown female
   of any bovine animal (plural cows, archaic plural kine)},  
   user1={kine}}

\let\glsaltpl\glsuseri 

You can now use \glspl for the first plural and \glsaltpl for the second plural. There are six user keys, so this method can be used for other grammatical constructs as well. As from version 4.0, you can also define your own keys via \glsaddkey. See the section Additional Keys in the user manual for further details.

How do I define different grammatical parts for an entry?

As with My term has multiple plural forms, how can I deal with this? you can use one of the user keys (such as user1) or you can define your own key. However, this can lead to a large number of extra keys. You may find it easier to simply use \glsdisp or \glslink. For example, with the following definition:

\newglossaryentry{run}{name=run,description={...}} 

Then you can do:

I \glsdisp{run}{ran} to the shops. They are \glsdisp{ran}{running} to
catch the bus.

(I think that the second \glsdisp has a typo and should be glsdisp{run}{running}.)

1
  • \glsdisp is pretty much exactly what I'm looking for. Thanks a lot for your help.
    – user32882
    Commented Sep 9, 2021 at 19:26
1

This is one possibility.

a

\documentclass{article}
\usepackage[nonumberlist]{glossaries}

\makeglossary

\newglossaryentry{snore}
{   name={snore},
    description={\emph{Verb} To make an unpleasant noise while sleeping soundly}
}

\newglossaryentry{snored}
{   name={snored},
    description={Past Tense of \textbf{\gls{snore}}}
}

\newglossaryentry{snoring}
{   name={snoring},
    description={Present Continuous Tense of \textbf{\gls{snore}}}
}

\newglossaryentry{snores}
{   name={snores},
    description={Simple Tense of \textbf{\gls{snore}}}
}


\begin{document}
    
    I don't \gls{snore} when I'm sleeping.
    
    I \gls{snored}.
    
    I'm \gls{snoring}.
    
    He \gls{snores}.    
    
    \printglossary
    
\end{document}
3
  • I'm afraid this is not what I'm looking for. I need all the variants of the infinitive "to snore" to point to the same term in the glossary. You can imagine, for instance, that "snore", "snores", "snored" and "snoring" would not be separate entries in a dictionary.
    – user32882
    Commented Sep 8, 2021 at 17:22
  • @user32882 How many variants? Can you make a complete list? Commented Sep 8, 2021 at 17:58
  • An arbitrary amount of variants.
    – user32882
    Commented Sep 8, 2021 at 20:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .