7

As a new LaTeX user, I have spent some time configuring my system and ironing the usual start-up mistakes. So far, I've been able to compile several documents with indices, graphics, etc. but now I'm trying to add a glossary and I'm absolutely and deeply confused.

I seem unable to make the \glossaries (with xindy) package work on my TexStudio/Windows 8 - MikTeX 2.9 machine so any help or orientation will be much appreciated.

Update:

Xindy seems to be working, now the question is WHAT TO DO NEXT

Xindy working on Windows 8.1

Now I am trying this MWE:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage[xindy]{glossaries}

\author{author}
\title{title}

\begin{document}

test la \gls{IG} es vital en la protección del ternero hay 5 tipos de \glspl{IG}

\newacronym[longplural=Inmunoglobulinas]{IG}{IG}{Inmunoglobulina}

\makeglossaries

\end{document}

and the errors on my build result are

  • on pdfLaTeX

    line 21: Can be used only in preamble. \makeglossaries
    : \makeglossaries hasn't been used,the glossaries will not be updated.
    : No \printglossary or \printglossaries found.

  • on Makeglossaries command

    Process started: "C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/makeglossaries.exe" "texstudio_B11540"

    makeglossaries version 2.12 (2014-01-20) added glossary type 'main' (glg,gls,glo)

    No \@istfilename found in 'texstudio_B11540.aux'. Did your LaTeX run fail? Did your LaTeX run produce any output? Did you remember to use \makeglossaries?

    Process exited with error(s)

What Finally Worked

I followed this path:

  1. Installed MiKTeX latest version and updated it
  2. Downloaded xindy-win.exe and installed it with all the default options
  3. Configured TeXstudio as per Khumar's indications with one difference: On Options>Configure...>Commands - Texindy i used "C:/Program Files (x86)/xindy/miktex/bin/texindy.exe" %.idx

and now seems to be working!

Speravir
  • 19,491
Mauro
  • 91
  • 1
    It's never the editor (TeXstudio) itself, it's always the back-end tools (MiKTeX, TeX Live, etc.) the editor calls. What's the simplest possible document you can write that fails to run with xindy and glossaries? Does glossaries work without xindy? Is TeXstudio configured to run makeindex, makeglossaries, or what? – Mike Renfro Jan 28 '14 at 00:37
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Speravir Jan 28 '14 at 00:47
  • First of all tell us, how you managed to use xindy with MiKTeX. – Speravir Jan 28 '14 at 00:50
  • I do recommend to not use this out-of-date installer: How to use Xindy with MiKTeX? Could you, please, type in your command prompt the following echo %path%? Does show this the whole system path, as it should be? – Speravir Jan 28 '14 at 18:07

3 Answers3

9

First ensure that xindy works with your distribution.

Even though an entry exists for Make Glossaries in the build window (see figure below), it doesn't appear under the Commands of Tools menu:

enter image description here

There is no short cut available too. If somebody knows how to make use of this please feel free to edit the answer.


Alternative

You can define a user command:

Go To OptionsConfigure TeXstudio. In the window that opens do the following:

  1. Choose Build and click.

  2. Click Add under User Commands

  3. Fill : user1: Make Glossaries and "C:/Program Files/MiKTeX 2.9/miktex/bin/makeglossaries.exe" %. You can browse to the exe file also. Note that the path may be different for you. Don't forget the % at the end.

  4. Press OK and come out

Now you will have a user menu for Make Glossaries with a short cut:

enter image description here

Now you can pdflatex Make Glossaries and pdflatex.

enter image description here

Happy Glossing :)


Additional note:

As noted by Speravir, you have to specify "texindy.bat" %.idx instead of texindy.exe %.idx as in the following window.

enter image description here

Edit:

There were some errors in your code. Try this:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage[acronym,nomain,xindy]{glossaries}

\makeglossaries

\author{author} \title{title}

\newacronym[longplural=Inmunoglobulinas]{IG}{IG}{Inmunoglobulina}

\begin{document}

test la \gls{IG} es vital en la protección del ternero hay 5 tipos de \glspl{IG}

\printglossaries

\end{document}

enter image description here

  • When one made xindy available for MiKTeX with the tutorial you link in the beginning, then the Texindy entry must be changed to texindy.bat %.idx (BAT instead of EXE). – Speravir Jan 28 '14 at 02:48
  • @Speravir i downloaded a windows installer linked here on another question called xindy-win.exe but im not even sure if it is working. Looks like this is going to be too much for me (timewise) what are the xindy alternatives for windows? – Mauro Jan 28 '14 at 09:29
  • @Speravir after a reboot (ye old trick) xindy --help on the command line works ... now im not sure about the next steps – Mauro Jan 28 '14 at 09:40
  • @HarishKumar i applied your suggestions including the aditional note by Speravir but still get compiling errors, have updated the main post showing this – Mauro Jan 28 '14 at 09:58
  • @Mauro Please see the edit. –  Jan 28 '14 at 11:20
  • @HarishKumar ... and now it works!!!! im editing my original post to show what worked – Mauro Jan 28 '14 at 11:45
  • @HarishKumar Of course, using arara would make things easier. – egreg Jan 28 '14 at 12:08
  • @egreg i would gladly use arara if you let me know what it is or how to use it – Mauro Jan 28 '14 at 12:18
  • 1
    @Mauro See http://tex.stackexchange.com/questions/118890/how-to-configure-texstudio-editor-to-use-glossaries-package-with-makeglossaries and http://tex.stackexchange.com/questions/123472/printing-glossaries-in-amsart-using-texstudio – egreg Jan 28 '14 at 12:46
  • @egreg That was the first idea, but then you know... :) –  Jan 28 '14 at 13:49
6

The problem may be because the 'makeglossaries' command (that generates the .gls file) is not called before pdflatex is invoked.

Step 1: Make sure that 'Makeglossaries' command is properly defined as "makeglossaries.exe %" under "Commands" option in TexStudio. In addition, you may verify whether 'makeglossaries.exe' is available on the system path by typing this on a command prompt.

Step 2: Enable 'Show Advanced Options' and configure your 'Build' settings in TexStudio to compile pdflatex, make glossary, and compile pdflatex again.

To do this, replace your "Build & View" option (that we may typically invoke using keyboard shortcut 'F5') as follows:

Before:

txs:///compile | txs:///view

After:

txs:///compile | txs:///makeglossaries | txs:///compile | txs:///view
Jim C
  • 341
1

the solution I found is to change the makeglossaries command by a makeindex one (adapted from https://sites.google.com/site/mcoath/other/latex/pahc) :

In "Options >> Configure TexStudio >> Commands >> Makeglossaries"

makeindex %.acn  -s %.ist -o %.acr

Then runs the commands:

"Tools >> Compile "

"Tools >> Glossary"

"Tools >> Compile "

Hope it works

RMQ: one can track down the effect of glossary command in main.acr