\documentclass{report}
\usepackage[acronym]{glossaries}
\makeglossary
\newacronym{svm}{SVM}{Support Vector Machine}
\newacronym{wasn}{WASN}{Wireless Sensor Networks}
\begin{document}
\printglossaries
\newpage
using \gls{svm} blah blah \gls{wasn}blah blah.....\gls{svm}
\end{document}
I am testing with above MWE. The acronyms are correctly displayed in the document body when compiled, but nothing gets printed where I need the List of Acronyms.
I am using TexMakerX as my IDE on Windows 7.
Once I compile the above code a .glo
file is created but it is empty. I think this is the problem but I don't know why it is happening.
Best Answer
Creating a list of acronyms (or glossary) is a three stage process (at least):
makeglossaries
Perl script or themakeglossaries-lite
Lua script.(You may need to repeat step 3.) Every time you modify the document in a way that alters the list (for example, adding or deleting instances of
\gls
, or removing or inserting text that results in a change in the associated page numbers) then you need to repeat all three steps in order to update the list.The command
\makeglossaries
in your document creates some glossary-related files (.glo
or.acn
) and each time you use commands like\gls
an entry is added to the relevant file when the document is typeset (in step 1).In step 2 a special indexing application is run that reads in those glossary-related files and writes another file (
.gls
or.acr
) with the LaTeX code required to typeset the glossary or list of acronyms. This file is then input in your document in step 3.Step 2 causes the most confusion as it requires running a command line script. However, most front-ends have a button or menu item you can click that will run the script for you. Most front-ends need to be configured to run
makeglossaries
ormakeglossaries-lite
. The following TeX.SE answers provide instructions for integratingmakeglossaries
on various front-ends.For WinEdt, have a look at the comp.text.tex thread Executing Glossaries' makeindex from a WinEdt macro.
For other front-ends, see Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.
In each of the above cases, you need to have Perl installed if you use
makeglossaries
(but notmakeglossaries-lite
) or if you want to usexindy
instead of the defaultmakeindex
.Since
makeglossaries-lite
is a Lua script, you should already have a Lua interpreter if you have a modern TeX distribution with LuaTeX. If you want to usemakeglossaries-lite
instead, you should just be able to replace all references tomakeglossaries
withmakeglossaries-lite
, although it has fewer options and doesn't provide diagnostic tools, so it's not as useful if things go wrong. (Note thatmakeglossaries-lite
was added toglossaries
version 4.16, so it won't be available for older versions.)Another possibility if you are having difficulty with step 2 is to add the package option
automake
toglossaries
:(Introduced in
glossaries
version 4.08.) This will try to get TeX to run the external applications (step 3 is still required) but this won't work if the shell escape is disabled. This option also won't work withxindy
in the restricted mode, sincexindy
isn't on the list of trusted applications.¹ With bothxindy
andautomake
, you would need the less secure unrestricted mode, which I don't recommend for security reasons.Alternatively, there's a GUI approach that uses Java rather than Perl. See also What can interfere with glossaries to prevent printing?
¹This is the case with TeX Live. I don't know about MiKTeX.