3

I've been trying for a while to make my glossaries in texmaker.

I've added a user command that is

latex %

makeglossaries %

latex %

My glossary entries look like this

\newglossaryentry{label}
{
 name={name},
description={description}
}

I've included the glossaries package and called \makeglossaries in my preamble and then called \printglossaries before \end{document}.

I keep getting errors saying name key required or end up with a page after my table of contents that has "description" written 4 times.

I've read up on the glossaries package and read solutions on stack exchange however I'm relativevly new to all of this and can't make sense of any of it.

Could someone explain please?

MWE

\documentclass{report}
\usepackage{glossaries}
\makeglossaries

\begin{document}
\include{glossaryfile.tex}

\gls{term1} is what I want to display. 

\printglossaries
\end{document}

then in the glossary file I have

  \newglosssaryentry{term1}
    {
    name={term 1},
    description={this is the first term}
    }
  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Aug 5 '15 at 12:41
  • In principle the way you used is the correct one. Perhaps you should read glossaries-begin.pdf instead of glossaries-user.pdf. The first one is completely sufficent for beginners – user31729 Aug 5 '15 at 12:43
  • What happens if you use the \newglossaryentry in the preamble and omit the \include then? – user31729 Aug 5 '15 at 12:51
  • Sorry I didn't see this sooner, I was trying to avoide doing that as I have a large glossary but only a few terms are used. I used \input rather than \include and found I got a new page that just said "description" rather than a glossary. I will try adding the terms into the preamble asap. – Kathryn Aug 6 '15 at 6:55
  • I found the problem, it was the spacing in my glossary entries. Once I made everything on one line in the glossary entries it seemed to work just fine. – Kathryn Aug 6 '15 at 8:25
1

As is, your MWE will fail because your \newglossaryentry call has an extra s in it.

The glossaries package gives you \loadglsentries{glossaryfile} to import your entries cleanly after \makeglossaries.

You shouldn't have any problems with new lines and tabs in your \newglossaryentry.

With those comments, your MWE becomes

\documentclass{report}
\usepackage{glossaries}
\makeglossaries

\loadglsentries{glossaryfile}

\begin{document}


    \gls{term1} is what I want to display. 

    \printglossaries
\end{document}

and glossaryfile.tex becomes

\newglossaryentry{term1}
{
    name={term 1},
    description={this is the first term}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.