MakeIndex, Nomenclature, Glossaries and AcronymsMaking a glossary

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
KBriggs
Posts: 4
Joined: Tue Mar 15, 2011 7:32 pm

Making a glossary

Post by KBriggs »

Hey all,

I have been googling around for a way to put together a glossary in latex, and I am having no luck. Perhaps someone could point me in the right direction.

I have a file called report.tex. I would like it to have a glossary, so I made the file report.gls, which contains, for example:

Code: Select all

\newglossaryentry{beamwaist}{name={beamwaist}, description={the width of the laser beam at the focus}}
In the document preample in report.tex, I have this:

Code: Select all

\usepackage{glossaries}
\makeglossaries
somewhere in the text of the document I have:

Code: Select all

\gls{beamwaist}
and at the end of the document I have

Code: Select all

\printglossary
When I run this through pdflatex, I get the error:

Code: Select all

! Package glossaries Error: Glossary entry `beamwaist' has not been defined.
If I get rid of report.gls and instead define the terms in the preample, I get a warning saying

Code: Select all

./report.tex:0:No file report.gls
and no glossary is printed

If I just make an empty file called report.gls and define all my glossary entries in the preample, I get no errors, but no glossary is printed (not that I would expect this to fix it, I was just trying things at random at that point)

Can someone point out my error? I am relatively new to latex so I am sure it is something obvious...
Last edited by KBriggs on Tue Mar 15, 2011 9:59 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Making a glossary

Post by localghost »

You certainly studied the glossaries manual and especially Section 1.4 (Troubleshooting, p. 20ff). It seems that you did not generate the *.gls file as described in the package manual. It is actually very detailed in this regard. For more specific help it will require a minimal example [1]. But you should first follow the instructions in the manual.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
KBriggs
Posts: 4
Joined: Tue Mar 15, 2011 7:32 pm

Making a glossary

Post by KBriggs »

Thanks for the reply. The solution turned out to be as you said: it was necessary to run

Code: Select all

makeglossaries report.glo
from the command line in between two pdflatex calls, with glossary entries either defined in the preamble, or in a document that is \included in the preamble.
Post Reply