# How to configure TexStudio editor to use glossaries package with makeglossaries and xindy or how to configure TexStudio to use arara?

Xindy is an efficient indexing tool, it is an external perl-based application that ships readily with TexLive distribution but not with MikTeX, for the latter one you need to install it manually, this thread can be of help. For configuration of xindy in TexStudio editor, I had success with imakeidx package and texindy filter using XeLaTeX compilation, here is the thread for that. However, when it comes to the nice glossaries package to create glossaries/acronyms/etc, things are getting more complicated. I want to pass the xindy option of glossaries package and configure TexStudio to use makeglossaries for the xindy tool, making use of shortcut keys. I found that both makeglossaries and texindy are listed among commands in this editor, but still how to set all of these things in TexStudio to compile the PDF file with glossary lists is still a puzzle for me. Making glossaries out the command line is not an elegant way to get the job done, while such automation can be configured into the nice TexStudio editor.
In the below MWE, I could only compile PDF but with not glossaries list, I wonder how to do that using the TexStudio editor and not from the command line?

This is a MWE:

\documentclass{article}
\usepackage[xindy]{glossaries}
\makeglossaries

\newglossaryentry{def1}{name={first definition},description={description1}}
\newglossaryentry{def2}{name={second definition},description={description2}}

\begin{document}
This is \gls{def1} and this is \gls{def2}.
\printglossaries
\end{document}


Result:

Update with arara:
Configuration of TexStudio in Windows:

% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: xelatex
\documentclass{article}
\usepackage[xindy]{glossaries}

\makeglossaries

\newglossaryentry{def1}{name={first definition},description={description1}}
\newglossaryentry{def2}{name={second definition},description={description2}}

\begin{document}

This is \gls{def1} and this is \gls{def2}.
\clearpage
\printglossaries
\end{document}


Now the big araric moment just press ALT+SHIFT+F? (this is in windows and it can be F1, or F2, it depends):
Result:

-

To simplify the compilation and have more control over the compilation steps I recommend the cool tool arara. The tool is well explained in the documentation where you can learn also what are arara rules. The main idea is to setup the compilation steps in your root file. This can be achieved by the following syntax

% arara: <rule>


For pdflatex it is simple:

% arara: pdflatex


For glossaries it is:

% arara: makeglossaries


and so on.

You can setup TeXStudio for arara as follows.

1. Found out the location of the executable arara. Normally it is the same path as pdflatex is setuped by TeXStudio. If you are using a Unix system you can do

which arara


which results on my machine to:

/usr/texbin/arara

2. Open TeXStudio and add a new user-command as shown in the image: The setup is:

user0:Arara       /usr/texbin/arara -v -l %


After saving you have finished the implementation of arara. If you want to use the internal viewer of TeXStudio you should use the following definition:

user0:Arara       /usr/texbin/arara -v -l % | txs:///view

3. To compile with this new user command you can use a short cut or the menu:
Tools-->User--Arara

4. If you want to use the menu bar button, you can add arara to the custom menu panel.

% arara: pdflatex: { draft: true }

Can I use it if I would compile with XeLaTeX? and is there any special thing if I am using windows? if so can you please update your nice answer. You made me discover arara, and I found that Alt+Shift+F2 has already been assigned after passing arara into TexStudio. –  doctorate Jun 13 '13 at 6:30
@doctorate: Using XeLaTeX means to select the rule xelatex: % arara: xelatex. –  Marco Daniel Jun 13 '13 at 8:09