11
\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.

Werner
  • 603,163
Les_Salantes
  • 111
  • 1
  • 1
  • 3

4 Answers4

11

Creating a list of acronyms (or glossary) is a three stage process (at least):

  1. Typeset the document using LaTeX (or PDFLaTeX or XeLaTeX or LuaLaTeX, as appropriate)
  2. Run the makeglossaries Perl script or the makeglossaries-lite Lua script.
  3. Typeset the document again.

(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 or makeglossaries-lite. The following TeX.SE answers provide instructions for integrating makeglossaries 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 not makeglossaries-lite) or if you want to use xindy instead of the default makeindex.

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 use makeglossaries-lite instead, you should just be able to replace all references to makeglossaries with makeglossaries-lite, although it has fewer options and doesn't provide diagnostic tools, so it's not as useful if things go wrong. (Note that makeglossaries-lite was added to glossaries 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 to glossaries:

\usepackage[automake]{glossaries}

(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 with xindy in the restricted mode, since xindy isn't on the list of trusted applications.¹ With both xindy and automake, 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.

Nicola Talbot
  • 41,153
  • To accomplish this in WinEdt, you can simply go to Options -> Execution Modes and change the definition of MakeGlossary to Executable:makeglossaries.exe, Switches:, Parameters:"%N". Now executing the command MakeGlossary you have what you want and executing PDFTeXify you obtain the full cycle pdflatex - makeglossaries - pdflatex as many times as needed for a full compilation. – karlkoeller May 05 '13 at 05:41
  • 1
    I had a problem that glossary is not updated in pdf once I compile. But after I add '[automake]' in the 'usepackage' section not it's work well fine. Now it looks like this. '\usepackage[nopostdot,nonumberlist,acronym,section,automake]{glossaries}' – Sandun Madola Dec 28 '16 at 08:25
8

Your MWE can be compiled even without the need of makeglossaries application (and so without the need of having Perl installed), exploiting makeindex.

In fact, running

  1. pdflatex <yourfile>
  2. makeindex.exe -s <yourfile>.ist -o <yourfile>.acr <yourfile>.acn
  3. pdflatex <yourfile>
  4. pdflatex <yourfile>

works the same.

karlkoeller
  • 124,410
1

I'll add an answer that worked for me, since there appears to be no accepted answer to this question and this question was the first one to pop up in a web-search.

The glossaries package documentation states the following about using Hyperref:

Take care if you use the glossaries package with hyperref. Contrary to the usual advice that hyperref should be loaded last, glossaries (and glossaries-extra) must be loaded after hyperref.

and the following about displaying entries:

  1. Add \makenoidxglossaries to your preamble (before you start defining your entries, as described in Section 2).
  2. Put: \printnoidxglossary[sort=〈order〉,〈other options〉] where you want your list of entries to appear. Alternatively, use \printnoidxglossaries

Following these instructions resolved the issue for me.

Note: I'm using Overleaf so I have no control over package versions. They seem to use package version v4.41+. Which is why this works for me. I cannot confirm if this works for lower version numbers.

Byebye
  • 280
0

I am also an overleaf user, and had a similar issue. I find Byebye's answer useful.

An alternative to using \makenoidxglossaries and \printnoidxglossary is adding option 'automake', which worked for me: \usepackage[automake]{glossaries} (preamble) + \makeglossaries (preamble) + \printglossaries (where you want to print glossary).

Ziiiii
  • 1