0

I am trying to follow a latexebook tutorial but its own example does not seem to work. I have followed the guide doing a basic glossary but I must be doing something wrong that I am missing. I am working in Textstudio with miktex.

\documentclass[]{report}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{computer}
{
    name=computer,
    description={is a programmable machine that receives input,
        stores and manipulates data, and provides
        output in a useful format}
}
\begin{document}
\maketitle

\gls{computer}
\printglossaries

\end{document}  

All that prints is just the word "computer", as I assume \gls would do.

After further testing I am pretty sure its a problem in MikTex as I have had other people contact me with verifiably working examples.

5
  • 1
    Did you run the makeglossaries script? Jan 23, 2019 at 17:01
  • Did you follow these instructions: en.wikibooks.org/wiki/LaTeX/Glossary#Building_your_document ?
    – gusbrs
    Jan 23, 2019 at 17:01
  • I have tried the fix linked on the page gusbrs reccomended and it has not worked. After a reboot glossary is still not being generated. Jan 23, 2019 at 17:53
  • If I remove the empty \maketitle and then run pdflatex file, makeglossaries file and again pdflatex file it works fine. Jan 23, 2019 at 18:47
  • Can you eplain that to me like I have never used LaTeX in anything other than a basic form? How did you run those commands? Where is \maketitle? I am sorry but i have just started with this. Jan 23, 2019 at 19:07

1 Answer 1

1

For a glossary example such as this a few critical extra pieces have to be in place.

Follow these steps to do it manually so you gain an understanding if it goes wrong in the editor.

To work through these steps one simple way is to first navigate to the directory where you have saved the .tex file
(lets pretend it is called test.tex in your documents folder)

Using explorer navigate to the documents folder and in the address bar type cmd then after pressing the enter key you should have a black console window with for example
C:\Users\yourname\Documents>

Enter the following (replace test with your own filename.tex if different)

pdflatex test 

If all is well there are few errors although lots of messages

However since in your example there is a \maketitle line without additional info then you will see towards the end

! LaTeX Error: No \title given.

To avoid that error you need remove that line from your code in the editor and resave it (once these tests are done you can add back a working section that includes \maketitle bla bla bla)

As you have changed it you need to again run pdflatex test

this time there should be no error other than a comment No file test.gls. towards the end (about 5 lines up)

To generate glossaries is at least a three part process, the second command is at the same prompt, type and enter

makeglossaries test

If that works correctly you will see a message such as

Generating output file test.gls....done (6 lines written, 0 warnings).
Output written in test.gls.
Transcript written in test.glg.

If you see that then skip this next bit


What you may see is something like

makeglossaries.exe: The script engine could not be found. makeglossaries.exe: Data: scriptEngine="perl.exe", scriptName="makeglossaries"

The key thing to note is that PERL.EXE was not found
Either it is not installed or was not found on your "PATH"

To see if you have it enter

where /r \ perl

If you get

INFO: Could not find files for the given pattern(s).

then its probably not installed so search recent "perl" questions in the forum first to see feedback.

If you saw some location(s) where perl.exe is located then check one of those locations is part of your path.

To check your path simply at the prompt enter> path

Each ; ends a separate location

Once you sort this out then again run makeglossaries test


So now you have > Transcript written in test.glg.

now we can finally run the last part (yes that's pdfLaTeX again)

pdflatex test

this time you will NOT see No file test.gls. and the pdf should be as expected (see below)


Finally back to how this relates to TeXstudio, you should now have a working system, such that you go to

Tools CommandspdfLaTeX
Tools CommandsMakeglossaries
Tools CommandspdfLaTeX

et voilà the same result as this but in your own editor viewer.

enter image description here

You must log in to answer this question.

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